Skip to content

Commit

Permalink
Add soroban governor submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
cptartur committed May 27, 2024
1 parent b40d7fa commit 2b1b53b
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/contracts-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
working-directory: ./contracts
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "contracts/governor_wrapper/soroban-governor"]
path = contracts/governor_wrapper/soroban-governor
url = https://github.com/script3/soroban-governor.git
17 changes: 17 additions & 0 deletions contracts/governor_wrapper/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use std::path::Path;
use std::process::Command;

fn main() {
let soroban_governor_path = Path::new("soroban-governor");
let output = Command::new("make")
.current_dir(soroban_governor_path)
.arg("build")
.status()
.expect("Failed to build soroban-governor");
assert_eq!(
output.code().expect("Process did not exit correctly"),
0,
"Build failed"
);
println!("cargo::rerun-if-changed=soroban-governor");
}
1 change: 1 addition & 0 deletions contracts/governor_wrapper/soroban-governor
Submodule soroban-governor added at 0a7788
2 changes: 1 addition & 1 deletion contracts/governor_wrapper/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mod types;
mod votes_admin {
use soroban_sdk::contractimport;

contractimport!(file = "soroban_admin_votes.wasm");
contractimport!(file = "./soroban-governor/target/wasm32-unknown-unknown/optimized/soroban_admin_votes.wasm");
}

mod governance {
Expand Down
2 changes: 1 addition & 1 deletion contracts/governor_wrapper/tests/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mod governance {
mod admin_votes {
use soroban_sdk::contractimport;

contractimport!(file = "./soroban_admin_votes.wasm");
contractimport!(file = "./soroban-governor/target/wasm32-unknown-unknown/optimized/soroban_admin_votes.wasm");
}

#[test]
Expand Down

0 comments on commit 2b1b53b

Please sign in to comment.