-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
1,570 additions
and
1,282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,50 @@ | ||
use soroban_sdk::{testutils::Address as _, vec, Address, Env}; | ||
|
||
use self::setup::{ | ||
deploy_factory_contract, install_lp_contract, install_multihop_wasm, install_stable_lp, | ||
install_stake_wasm, install_token_wasm, | ||
}; | ||
|
||
mod config; | ||
mod queries; | ||
mod setup; | ||
|
||
mod queries; | ||
#[test] | ||
#[should_panic(expected = "Factory: Initialize: initializing contract twice is not allowed")] | ||
fn test_deploy_factory_twice_should_fail() { | ||
let env = Env::default(); | ||
env.mock_all_auths(); | ||
env.cost_estimate().budget().reset_unlimited(); | ||
|
||
let admin = Address::generate(&env); | ||
|
||
let auth_user = Address::generate(&env); | ||
let multihop_wasm_hash = install_multihop_wasm(&env); | ||
let lp_wasm_hash = install_lp_contract(&env); | ||
let stable_wasm_hash = install_stable_lp(&env); | ||
let stake_wasm_hash = install_stake_wasm(&env); | ||
let token_wasm_hash = install_token_wasm(&env); | ||
|
||
let factory = deploy_factory_contract(&env, admin.clone()); | ||
|
||
factory.initialize( | ||
&admin, | ||
&multihop_wasm_hash, | ||
&lp_wasm_hash, | ||
&stable_wasm_hash, | ||
&stake_wasm_hash, | ||
&token_wasm_hash, | ||
&vec![&env, auth_user.clone()], | ||
&10u32, | ||
); | ||
factory.initialize( | ||
&admin, | ||
&multihop_wasm_hash, | ||
&lp_wasm_hash, | ||
&stable_wasm_hash, | ||
&stake_wasm_hash, | ||
&token_wasm_hash, | ||
&vec![&env, auth_user.clone()], | ||
&10u32, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.