Skip to content
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 #512

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion framework/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added framework/artifacts/abstract_account-mock.wasm
Binary file not shown.
Binary file modified framework/artifacts/abstract_account-xion.wasm
Binary file not shown.
Binary file modified framework/artifacts/abstract_account.wasm
Binary file not shown.
Binary file added framework/artifacts/abstract_ans_host-mock.wasm
Binary file not shown.
Binary file not shown.
Binary file modified framework/artifacts/abstract_ibc_client.wasm
Binary file not shown.
Binary file added framework/artifacts/abstract_ibc_host-mock.wasm
Binary file not shown.
Binary file modified framework/artifacts/abstract_ibc_host.wasm
Binary file not shown.
Binary file not shown.
Binary file modified framework/artifacts/abstract_ica_client.wasm
Binary file not shown.
Binary file not shown.
Binary file modified framework/artifacts/abstract_module_factory.wasm
Binary file not shown.
Binary file added framework/artifacts/abstract_registry-mock.wasm
Binary file not shown.
19 changes: 13 additions & 6 deletions framework/artifacts/checksums.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
04f4407f6bcd706a28327afb3bf5b2f16a18d75d0adc376ef44f8a4768d41877 abstract_account-xion.wasm
55124e42532e6cbfa306a8d85d3c8a634ec92d2803fe4dfeb8ed7918cd7e0e0c abstract_account.wasm
4f273fe086748453395aa123c9222cf7ca3997143877082807dc60f59dabd50d abstract_account-mock.wasm
296c6f5c4c6007afbd1cfd3f65c71759ba507719a3bde768f1ed10c9cc1d7164 abstract_account-xion.wasm
cd8bab5fec3e41400c89eb017bc92dc38e552c0c3bb8598c796fc1d898492cb1 abstract_account.wasm
216d5c99091c3427ff55933c9d9d4b45dcedfbe0fe464c245b005b898a9af240 abstract_ans_host-mock.wasm
5f94f255722d33689eeb631bc796fbc1598985f8922d1987573644525dab4a1c abstract_ans_host.wasm
5e920677063397df022ce9ca9dd5e4f799c5ab7f601b7927cef013ca6be2486e abstract_ibc_client.wasm
3a14e2a3beeecc21d830367be33406dd2b5a33ab6733302b07fed0f3046f45dd abstract_ibc_host.wasm
9fb8a8e96e94977fd0b17265f1d4276484fe728ed943e3adcf9b4eca35ebf96a abstract_ica_client.wasm
11f769be8bf52d69c4af2d0ed539747ae359586740e3d05cb4ef20b1f8589422 abstract_module_factory.wasm
c59194565db680127e3500ed1f11fad03d1c76863d96c0d7d2772753da48bbae abstract_ibc_client-mock.wasm
f4aa3c8692a004fb60faf72b9170d0f80f40d32f1d96be77ea78e7b9cddba8b3 abstract_ibc_client.wasm
03d6636272834d264390d2597daa8bc5764cca8dfa94421eb222bbb7655f4634 abstract_ibc_host-mock.wasm
a961da69e3ec204492ea92f9201159d6e6df54e849541650934e4fc79e403d22 abstract_ibc_host.wasm
58e8f1838e65df89663fe1a2a5cfdcd95709589ccf3c4113ed6f62b94a828f21 abstract_ica_client-mock.wasm
2277ce3043802097dc106ffc00a7ae67c88eca251f30103826470dbbace0022b abstract_ica_client.wasm
a31f93664445934c93df2c576ffd9ad4e0f272b0fbb41d1c10d425e3fef4e2d0 abstract_module_factory-mock.wasm
7f35fcc795cdc5b25d7bffe6cb266314e47cb1af5047a6de0a4e88807d8e7ab0 abstract_module_factory.wasm
7e1af6dd7a0541d83f16f6de07ae43d8f07ee6dd02487c31d7fbc4d6284d494c abstract_registry-mock.wasm
dea92cb8f17c18cb3b8ab64b832951d187f7c28747727811eecd640a096d7b35 abstract_registry.wasm
10 changes: 9 additions & 1 deletion framework/contracts/account/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,18 @@ crate-type = ["cdylib", "rlib"]
default = ["export"]
export = []
xion = ["abstract-xion"]
mock-deployment = ["abstract-std/mock-deployment"]

[package.metadata.optimizer]
standard-build = true
builds = [{ name = "xion", features = ["xion"] }]
builds = [
{ name = "xion", features = [
"xion",
] },
{ name = "mock", features = [
"mock-deployment",
] },
]

[dependencies]
cosmwasm-std = { workspace = true }
Expand Down
5 changes: 5 additions & 0 deletions framework/contracts/native/ans-host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ crate-type = ["cdylib", "rlib"]
[features]
default = ["export"]
export = []
mock-deployment = ["abstract-std/mock-deployment"]

[package.metadata.optimizer]
standard-build = true
builds = [{ name = "mock", features = ["mock-deployment"] }]

[dependencies]
cosmwasm-std = { workspace = true }
Expand Down
5 changes: 5 additions & 0 deletions framework/contracts/native/ibc-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ crate-type = ["cdylib", "rlib"]
[features]
default = ["export"]
export = []
mock-deployment = ["abstract-std/mock-deployment"]

[package.metadata.optimizer]
standard-build = true
builds = [{ name = "mock", features = ["mock-deployment"] }]

[dependencies]
cosmwasm-std = { workspace = true, features = ["stargate", "staking"] }
Expand Down
4 changes: 4 additions & 0 deletions framework/contracts/native/ibc-host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ crate-type = ["cdylib", "rlib"]
default = ["export"]
export = []
schema = []
mock-deployment = ["abstract-std/mock-deployment"]

[package.metadata.optimizer]
standard-build = true
builds = [{ name = "mock", features = ["mock-deployment"] }]

[dependencies]
cosmwasm-std = { workspace = true, features = ["stargate"] }
Expand Down
5 changes: 5 additions & 0 deletions framework/contracts/native/ica-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ crate-type = ["cdylib", "rlib"]
[features]
default = ["export"]
export = []
mock-deployment = ["abstract-std/mock-deployment"]

[package.metadata.optimizer]
standard-build = true
builds = [{ name = "mock", features = ["mock-deployment"] }]

[dependencies]
cosmwasm-std = { workspace = true, features = ["stargate", "staking"] }
Expand Down
4 changes: 4 additions & 0 deletions framework/contracts/native/module-factory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ crate-type = ["cdylib", "rlib"]
default = ["export"]
export = []
# for quicker tests, cargo test --lib
mock-deployment = ["abstract-std/mock-deployment"]

[package.metadata.optimizer]
standard-build = true
builds = [{ name = "mock", features = ["mock-deployment"] }]

[dependencies]
cosmwasm-std = { workspace = true }
Expand Down
4 changes: 4 additions & 0 deletions framework/contracts/native/registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ crate-type = ["cdylib", "rlib"]
[features]
default = ["export"]
export = []
mock-deployment = ["abstract-std/mock-deployment"]

[package.metadata.optimizer]
standard-build = true
builds = [{ name = "mock", features = ["mock-deployment"] }]

[dependencies]
cosmwasm-std = { workspace = true }
Expand Down
4 changes: 4 additions & 0 deletions framework/packages/abstract-adapter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ crate-type = ["cdylib", "rlib"]
test-utils = ["dep:abstract-testing", "abstract-sdk/test-utils"]
schema = []
stargate = ["abstract-sdk/stargate"]
mock-deployment = [
"abstract-interface/mock-deployment",
"abstract-std/mock-deployment",
]

[dependencies]
cosmwasm-std = { workspace = true }
Expand Down
12 changes: 11 additions & 1 deletion framework/packages/abstract-adapter/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,19 @@ macro_rules! __cw_orch_interfaces__ {
for $interface_name<Chain>
{
fn wasm(_chain: &cw_orch::prelude::ChainInfoOwned) -> ::cw_orch::prelude::WasmPath {
let build_postfix = {
#[cfg(feature = "mock-deployment")]
{
cw_orch::build::BuildPostfix::Custom("mock".to_string())
}
#[cfg(not(feature = "mock-deployment"))]
{
cw_orch::build::BuildPostfix::None
}
};
let wasm_name = env!("CARGO_CRATE_NAME").replace('-', "_");
::cw_orch::prelude::ArtifactsDir::auto(Some(env!("CARGO_MANIFEST_DIR").to_string()))
.find_wasm_path(&wasm_name)
.find_wasm_path_with_build_postfix(&wasm_name, build_postfix)
.unwrap()
}

Expand Down
4 changes: 4 additions & 0 deletions framework/packages/abstract-app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ crate-type = ["cdylib", "rlib"]
test-utils = ["dep:abstract-testing", "abstract-sdk/test-utils"]
schema = []
stargate = ["abstract-sdk/stargate"]
mock-deployment = [
"abstract-interface/mock-deployment",
"abstract-std/mock-deployment",
]

[dependencies]
cosmwasm-std = { workspace = true }
Expand Down
12 changes: 11 additions & 1 deletion framework/packages/abstract-app/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,19 @@ macro_rules! __cw_orch_interfaces__ {
for $interface_name<Chain>
{
fn wasm(_chain: &::cw_orch::prelude::ChainInfoOwned) -> ::cw_orch::prelude::WasmPath {
let build_postfix = {
#[cfg(feature = "mock-deployment")]
{
cw_orch::build::BuildPostfix::Custom("mock".to_string())
}
#[cfg(not(feature = "mock-deployment"))]
{
cw_orch::build::BuildPostfix::None
}
};
let wasm_name = env!("CARGO_CRATE_NAME").replace('-', "_");
::cw_orch::prelude::ArtifactsDir::auto(Some(env!("CARGO_MANIFEST_DIR").to_string()))
.find_wasm_path(&wasm_name)
.find_wasm_path_with_build_postfix(&wasm_name, build_postfix)
.unwrap()
}
Comment on lines 219 to 236
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this one, but I don't know how to solve it better in current implementation.
Issue that it will require the module to have exactly module-deployment feature. This issue comes out because we generate this code with macro and feature checks is happening after macro gets evaluated inside user crate, and not on abstract-app level

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Buckram123 so this will be removed with the new solution right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Buckram123 so this will be removed with the new solution right?

Drafting this PR for now. But yes, hopefully all magic would be limited in a build script


Expand Down
2 changes: 2 additions & 0 deletions framework/packages/abstract-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ default = ["integration"]
daemon = ["cw-orch/daemon"]
integration = []
interchain = ["dep:cw-orch-interchain", "dep:cw-orch-polytone"]
mock-deployment = ["abstract-std/mock-deployment"]

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
cosmwasm-std = { workspace = true }
Expand All @@ -41,6 +42,7 @@ abstract-std = { workspace = true }
cw-orch = { workspace = true }
cw-orch-interchain = { workspace = true, optional = true }
cw-orch-polytone = { workspace = true, optional = true }
bip32 = { version = "0.5.2" }

log = "0.4.14"
serde_json = "1.0.79"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use cw_orch::{
};
pub const ABSTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");
use dotenv::dotenv;
use networks::PION_1;
use networks::{LOCAL_JUNO, PION_1};

const CHAIN: ChainInfo = PION_1;

Expand All @@ -19,7 +19,7 @@ fn main() -> anyhow::Result<()> {

let cosmos_sender = cw_orch::daemon::RUNTIME.block_on(CosmosSender::new(
&Arc::new(CHAIN.into()),
CosmosOptions::default(),
CosmosOptions::default().mnemonic("clip hire initial neck maid actor venue client foam budget lock catalog sweet steak waste crater broccoli pipe steak sister coyote moment obvious choose"),
))?;
let public_key = cosmos_sender
.private_key
Expand Down
24 changes: 19 additions & 5 deletions framework/packages/abstract-interface/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ pub struct AccountDetails {
#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)]
pub struct AccountI<Chain>;

impl<Chain> AsRef<AccountI<Chain>> for AccountI<Chain> {
fn as_ref(&self) -> &AccountI<Chain> {
self
}
}

impl<Chain: CwEnv> AccountI<Chain> {
pub fn load_from(
abstract_deployment: &Abstract<Chain>,
Expand Down Expand Up @@ -733,12 +739,20 @@ impl<Chain: CwEnv> Uploadable for AccountI<Chain> {
.with_reply(::account::contract::reply),
)
}
fn wasm(chain: &ChainInfoOwned) -> WasmPath {

fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
let build_postfix = {
#[cfg(feature = "mock-deployment")]
{
cw_orch::build::BuildPostfix::Custom("mock".to_string())
}
#[cfg(not(feature = "mock-deployment"))]
{
cw_orch::build::BuildPostfix::ChainName(_chain)
}
};
artifacts_dir_from_workspace!()
.find_wasm_path_with_build_postfix(
"account",
cw_orch::build::BuildPostfix::ChainName(chain),
)
.find_wasm_path_with_build_postfix("account", build_postfix)
.unwrap()
}
}
Expand Down
12 changes: 12 additions & 0 deletions framework/packages/abstract-interface/src/deployment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,18 @@ impl<Chain: CwEnv<Sender = Addr>> Abstract<Chain> {
}
}

#[cfg(feature = "mock-deployment")]
impl<Chain: CwEnv> Abstract<Chain> {
pub fn mock_mnemonic() -> bip32::Mnemonic {
bip32::Mnemonic::new(native_addrs::MOCK_MNEMONIC, bip32::Language::English).unwrap()
}

pub fn mock_derive_path(coin_type: Option<u32>) -> String {
let coin_type = coin_type.unwrap_or(118);
format!("m/44'/{coin_type}'/0'/0/0")
}
}

#[cfg(test)]
mod test {
#![allow(clippy::needless_borrows_for_generic_args)]
Expand Down
12 changes: 11 additions & 1 deletion framework/packages/abstract-interface/src/native/ans_host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,18 @@ impl<Chain: CwEnv> Uploadable for AnsHost<Chain> {
)
}
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
let build_postfix = {
#[cfg(feature = "mock-deployment")]
{
cw_orch::build::BuildPostfix::Custom("mock".to_string())
}
#[cfg(not(feature = "mock-deployment"))]
{
cw_orch::build::BuildPostfix::None
}
};
artifacts_dir_from_workspace!()
.find_wasm_path("ans_host")
.find_wasm_path_with_build_postfix("ans_host", build_postfix)
.unwrap()
}
}
Expand Down
12 changes: 11 additions & 1 deletion framework/packages/abstract-interface/src/native/ibc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,18 @@ impl<Chain: CwEnv> Uploadable for IbcClient<Chain> {
)
}
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
let build_postfix = {
#[cfg(feature = "mock-deployment")]
{
cw_orch::build::BuildPostfix::Custom("mock".to_string())
}
#[cfg(not(feature = "mock-deployment"))]
{
cw_orch::build::BuildPostfix::None
}
};
artifacts_dir_from_workspace!()
.find_wasm_path("ibc_client")
.find_wasm_path_with_build_postfix("ibc_client", build_postfix)
.unwrap()
}
}
Expand Down
12 changes: 11 additions & 1 deletion framework/packages/abstract-interface/src/native/ibc_host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,18 @@ impl<Chain: CwEnv> Uploadable for IbcHost<Chain> {
)
}
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
let build_postfix = {
#[cfg(feature = "mock-deployment")]
{
cw_orch::build::BuildPostfix::Custom("mock".to_string())
}
#[cfg(not(feature = "mock-deployment"))]
{
cw_orch::build::BuildPostfix::None
}
};
artifacts_dir_from_workspace!()
.find_wasm_path("ibc_host")
.find_wasm_path_with_build_postfix("ibc_host", build_postfix)
.unwrap()
}
}
Loading
Loading