-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update osmosis tests(with modified wasm) #518
Conversation
…is-test-with-modified-wasm
…s-test-with-modified-wasm
let public_key = bip32::Mnemonic::new(&creator, Default::default()) | ||
.map(|phrase| { | ||
let seed = phrase.to_seed(""); | ||
let derive_path: bip32::DerivationPath = "m/44'/118'/0'/0/0".parse().unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have to add coin_type
or derive_path
as another env? IMO it's an overkill until someone needs it
native_addrs::creator_address(hrp)?, | ||
"Only predetermined abstract admin can deploy abstract contracts, see `native_addrs.rs`" | ||
); | ||
|
||
let admin = sender_addr.to_string(); | ||
// upload | ||
let mut deployment = Self::store_on(chain.clone())?; | ||
let blob_code_id = deployment.blob.code_id()?; | ||
|
||
let creator_account_id: cosmrs::AccountId = admin.as_str().parse().unwrap(); | ||
let canon_creator = CanonicalAddr::from(creator_account_id.to_bytes()); | ||
|
||
let expected_addr = |salt: &[u8]| -> Result<CanonicalAddr, Instantiate2AddressError> { | ||
instantiate2_address(&cw_blob::CHECKSUM, &canon_creator, salt) | ||
}; | ||
|
||
deployment.ans_host.deterministic_instantiate( | ||
&abstract_std::ans_host::MigrateMsg::Instantiate( | ||
abstract_std::ans_host::InstantiateMsg { | ||
admin: admin.to_string(), | ||
}, | ||
), | ||
blob_code_id, | ||
expected_addr(native_addrs::ANS_HOST_SALT)?, | ||
Binary::from(native_addrs::ANS_HOST_SALT), | ||
)?; | ||
|
||
deployment.registry.deterministic_instantiate( | ||
&abstract_std::registry::MigrateMsg::Instantiate( | ||
abstract_std::registry::InstantiateMsg { | ||
admin: admin.to_string(), | ||
#[cfg(feature = "integration")] | ||
security_disabled: Some(true), | ||
#[cfg(not(feature = "integration"))] | ||
security_disabled: Some(false), | ||
namespace_registration_fee: None, | ||
}, | ||
), | ||
blob_code_id, | ||
expected_addr(native_addrs::REGISTRY_SALT)?, | ||
Binary::from(native_addrs::REGISTRY_SALT), | ||
)?; | ||
deployment.module_factory.deterministic_instantiate( | ||
&abstract_std::module_factory::MigrateMsg::Instantiate( | ||
abstract_std::module_factory::InstantiateMsg { | ||
admin: admin.to_string(), | ||
}, | ||
), | ||
blob_code_id, | ||
expected_addr(native_addrs::MODULE_FACTORY_SALT)?, | ||
Binary::from(native_addrs::MODULE_FACTORY_SALT), | ||
)?; | ||
|
||
// We also instantiate ibc contracts | ||
deployment.ibc.client.deterministic_instantiate( | ||
&abstract_std::ibc_client::MigrateMsg::Instantiate( | ||
abstract_std::ibc_client::InstantiateMsg {}, | ||
), | ||
blob_code_id, | ||
expected_addr(native_addrs::IBC_CLIENT_SALT)?, | ||
Binary::from(native_addrs::IBC_CLIENT_SALT), | ||
)?; | ||
deployment.ibc.host.deterministic_instantiate( | ||
&abstract_std::ibc_host::MigrateMsg::Instantiate( | ||
abstract_std::ibc_host::InstantiateMsg {}, | ||
), | ||
blob_code_id, | ||
expected_addr(native_addrs::IBC_HOST_SALT)?, | ||
Binary::from(native_addrs::IBC_HOST_SALT), | ||
)?; | ||
deployment.ibc.register(&deployment.registry)?; | ||
|
||
deployment.registry.register_base(&deployment.account)?; | ||
deployment | ||
.registry | ||
.register_natives(deployment.contracts())?; | ||
deployment.registry.approve_any_abstract_modules()?; | ||
|
||
// Create the first abstract account in integration environments | ||
#[cfg(feature = "integration")] | ||
use abstract_std::objects::gov_type::GovernanceDetails; | ||
#[cfg(feature = "integration")] | ||
AccountI::create_default_account( | ||
&deployment, | ||
GovernanceDetails::Monarchy { | ||
monarch: chain.sender_addr().to_string(), | ||
}, | ||
)?; | ||
let mut deployment = Self::_deploy(&chain)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was thinking about having second deploy function, like mock_deploy, where we allow changing creator, and in default we check if creator matches to the original
const MOCK_MNEMONIC: &str = "clip hire initial neck maid actor venue client foam budget lock catalog sweet steak waste crater broccoli pipe steak sister coyote moment obvious choose"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can get it from env, but what do we do if it's not set?
Deploying abstract-docs with
|
Latest commit: |
3d06f9b
|
Status: | ✅ Deploy successful! |
Preview URL: | https://ac36e985.abstract-docs.pages.dev |
Branch Preview URL: | https://buckram-update-osmosis-test.abstract-docs.pages.dev |
Closed in favor #528 |
Alternative to #512
Here we use build script to change creator, instead of adding a new feature.
From the user perspective.
This approach:
ABSTRACT_CREATOR
#512 :
abstract-MODULE
and all of the abstract module dependencies (for example dex adapter)abstract-MODULE
(right now feature namedmock-deployment
)It's not a final, before I finish would be nice to have final approve on one of the methods
TODO, if this method gets approved:
.cargo/config.toml#env
section, because this file usually public and also will be moved inside docker(so no need to set it separately for the docker), but it's easy to deploy the wrong version this wayABSTRACT_CREATOR
in tests, tests that use wasms, will fail in release version, are we fine with that, anything we can do with it?