From 761a780e71830c9c11d1d0faf504d03dcb9fd3dc Mon Sep 17 00:00:00 2001 From: Gabe Date: Fri, 19 Jul 2024 02:40:02 -0500 Subject: [PATCH] Update to cw-orch .24.1 --- Cargo.lock | 128 ++++++++++++++------ Cargo.toml | 2 +- contracts/dao-dao-core/src/tests.rs | 52 ++++---- contracts/test/dao-proposal-sudo/src/msg.rs | 2 +- 4 files changed, 122 insertions(+), 62 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8e351aba3..655be5417 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,7 +43,7 @@ dependencies = [ "abstract-cw4-group", "abstract-cw4-stake", "cosmwasm-std", - "cw-orch", + "cw-orch 0.22.2", ] [[package]] @@ -69,7 +69,7 @@ dependencies = [ "abstract-cw2", "cosmwasm-schema", "cosmwasm-std", - "cw-orch", + "cw-orch 0.22.2", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "schemars", @@ -88,7 +88,7 @@ dependencies = [ "abstract-cw2", "cosmwasm-schema", "cosmwasm-std", - "cw-orch", + "cw-orch 0.22.2", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "schemars", @@ -118,7 +118,7 @@ checksum = "00d5e4b8084c3a2b3e42502e6c4fe3ed985dc72e86eb612bcc527f4a0443fa42" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cw-orch", + "cw-orch 0.22.2", "cw-utils 1.0.3", "schemars", "serde", @@ -134,7 +134,7 @@ dependencies = [ "abstract-cw20", "cosmwasm-schema", "cosmwasm-std", - "cw-orch", + "cw-orch 0.22.2", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "schemars", @@ -154,7 +154,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-controllers 1.1.2", - "cw-orch", + "cw-orch 0.22.2", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "schemars", @@ -188,7 +188,7 @@ dependencies = [ "abstract-cw3", "cosmwasm-schema", "cosmwasm-std", - "cw-orch", + "cw-orch 0.22.2", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "schemars", @@ -209,7 +209,7 @@ dependencies = [ "abstract-cw4", "cosmwasm-schema", "cosmwasm-std", - "cw-orch", + "cw-orch 0.22.2", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "schemars", @@ -241,7 +241,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-controllers 1.1.2", - "cw-orch", + "cw-orch 0.22.2", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "schemars", @@ -261,7 +261,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-controllers 1.1.2", - "cw-orch", + "cw-orch 0.22.2", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "schemars", @@ -1152,9 +1152,30 @@ dependencies = [ "cosmwasm-std", "cw-orch-contract-derive", "cw-orch-core", - "cw-orch-fns-derive", - "cw-orch-mock", - "cw-orch-traits", + "cw-orch-fns-derive 0.19.1", + "cw-orch-mock 0.22.2", + "cw-orch-traits 0.22.0", + "cw-utils 1.0.3", + "hex", + "log", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "cw-orch" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c81cb500eb2f9be31a0f90c7ce66572ee4a790ffbae1c6b42ff2e3f9faf3479" +dependencies = [ + "anyhow", + "cosmwasm-std", + "cw-orch-contract-derive", + "cw-orch-core", + "cw-orch-fns-derive 0.22.0", + "cw-orch-mock 0.23.2", + "cw-orch-traits 0.23.1", "cw-utils 1.0.3", "hex", "log", @@ -1176,14 +1197,15 @@ dependencies = [ [[package]] name = "cw-orch-core" -version = "1.0.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c8e62b4d04699596bc2f45c57a8e5459495584d8127588ae4bbe7f95d616b61" +checksum = "81af5ba67fdc434c6e90739ae89b91bff4dc2b87dc85f8a41aa822329c951bf8" dependencies = [ "abstract-cw-multi-test", "anyhow", "cosmos-sdk-proto 0.21.1", "cosmwasm-std", + "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "dirs", "log", @@ -1205,6 +1227,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "cw-orch-fns-derive" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e21b23116a0702f540d7fa3f16e8276682d860b589fed56259220ad59d768e" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "cw-orch-mock" version = "0.22.2" @@ -1220,6 +1254,21 @@ dependencies = [ "sha2 0.10.8", ] +[[package]] +name = "cw-orch-mock" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57beb30d841bde79df51c9402741ef926ca8ef7ecd3570aa180074f767ac04d3" +dependencies = [ + "abstract-cw-multi-test", + "cosmwasm-std", + "cw-orch-core", + "cw-utils 1.0.3", + "log", + "serde", + "sha2 0.10.8", +] + [[package]] name = "cw-orch-traits" version = "0.22.0" @@ -1231,6 +1280,17 @@ dependencies = [ "prost-types 0.12.3", ] +[[package]] +name = "cw-orch-traits" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05bb98fc8d7d51c632ae217f5040edb91695351977778d6cb7ea3c3d4efa890" +dependencies = [ + "cw-orch-core", + "prost 0.12.3", + "prost-types 0.12.3", +] + [[package]] name = "cw-ownable" version = "0.5.1" @@ -1701,7 +1761,7 @@ dependencies = [ "cw-controllers 1.1.2", "cw-hooks", "cw-multi-test", - "cw-orch", + "cw-orch 0.24.1", "cw-ownable", "cw-paginate-storage 2.5.0", "cw-storage-plus 1.2.0", @@ -1725,7 +1785,7 @@ dependencies = [ "cosmwasm-std", "cw-controllers 1.1.2", "cw-multi-test", - "cw-orch", + "cw-orch 0.24.1", "cw-ownable", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", @@ -1746,7 +1806,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", - "cw-orch", + "cw-orch 0.24.1", "cw-ownable", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", @@ -1982,7 +2042,7 @@ name = "dao-cw-orch" version = "2.5.0" dependencies = [ "cosmwasm-std", - "cw-orch", + "cw-orch 0.22.2", "cw20-stake 2.5.0", "cw20-stake-external-rewards", "cw20-stake-reward-distributor", @@ -2029,7 +2089,7 @@ dependencies = [ "cosmwasm-std", "cw-core", "cw-multi-test", - "cw-orch", + "cw-orch 0.24.1", "cw-paginate-storage 2.5.0", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", @@ -2078,7 +2138,7 @@ version = "2.5.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cw-orch", + "cw-orch 0.24.1", "cw-utils 1.0.3", "cw2 1.1.2", "cw20 1.1.2", @@ -2182,7 +2242,7 @@ dependencies = [ "cw-denom", "cw-hooks", "cw-multi-test", - "cw-orch", + "cw-orch 0.24.1", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw2 1.1.2", @@ -2249,7 +2309,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", - "cw-orch", + "cw-orch 0.24.1", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw2 1.1.2", @@ -2272,7 +2332,7 @@ dependencies = [ "cosmwasm-std", "cw-hooks", "cw-multi-test", - "cw-orch", + "cw-orch 0.24.1", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw2 1.1.2", @@ -2297,7 +2357,7 @@ dependencies = [ "cw-denom", "cw-hooks", "cw-multi-test", - "cw-orch", + "cw-orch 0.24.1", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw2 1.1.2", @@ -2335,7 +2395,7 @@ dependencies = [ "cw-denom", "cw-hooks", "cw-multi-test", - "cw-orch", + "cw-orch 0.24.1", "cw-proposal-single", "cw-storage-plus 1.2.0", "cw-utils 0.13.4", @@ -2371,7 +2431,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", - "cw-orch", + "cw-orch 0.24.1", "cw-storage-plus 1.2.0", "cw2 1.1.2", "dao-dao-macros", @@ -2416,7 +2476,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", - "cw-orch", + "cw-orch 0.24.1", "cw-ownable", "cw-storage-plus 1.2.0", "cw-tokenfactory-issuer", @@ -2509,7 +2569,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", - "cw-orch", + "cw-orch 0.24.1", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw2 1.1.2", @@ -2527,7 +2587,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", - "cw-orch", + "cw-orch 0.24.1", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw2 1.1.2", @@ -2547,7 +2607,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", - "cw-orch", + "cw-orch 0.24.1", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw2 1.1.2", @@ -2566,7 +2626,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", - "cw-orch", + "cw-orch 0.24.1", "cw-ownable", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", @@ -2593,7 +2653,7 @@ dependencies = [ "cw-controllers 1.1.2", "cw-hooks", "cw-multi-test", - "cw-orch", + "cw-orch 0.24.1", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw2 1.1.2", @@ -2653,7 +2713,7 @@ dependencies = [ "cw-controllers 1.1.2", "cw-hooks", "cw-multi-test", - "cw-orch", + "cw-orch 0.24.1", "cw-ownable", "cw-storage-plus 1.2.0", "cw-tokenfactory-issuer", diff --git a/Cargo.toml b/Cargo.toml index 354503e30..329c5df67 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -77,7 +77,7 @@ syn = { version = "1.0", features = ["derive"] } test-context = "0.1" thiserror = { version = "1.0" } wynd-utils = "0.4" -cw-orch = "0.22.2" +cw-orch = "0.24.1" # One commit ahead of version 0.3.0. Allows initialization with an # optional owner. diff --git a/contracts/dao-dao-core/src/tests.rs b/contracts/dao-dao-core/src/tests.rs index e20eab146..52a350ec9 100644 --- a/contracts/dao-dao-core/src/tests.rs +++ b/contracts/dao-dao-core/src/tests.rs @@ -223,7 +223,7 @@ fn test_update_config() -> cw_orch::anyhow::Result<()> { gov.upload()?; let govmod_instantiate = dao_proposal_sudo::msg::InstantiateMsg { - root: mock.sender().to_string(), + root: mock.sender_addr().to_string(), }; let gov_instantiate = InstantiateMsg { @@ -290,7 +290,7 @@ fn test_swap_governance(swaps: Vec<(u32, u32)>) { gov.upload().unwrap(); let govmod_instantiate = dao_proposal_sudo::msg::InstantiateMsg { - root: mock.sender().to_string(), + root: mock.sender_addr().to_string(), }; let gov_instantiate = InstantiateMsg { @@ -436,7 +436,7 @@ fn test_removed_modules_can_not_execute() { gov.upload().unwrap(); let govmod_instantiate = dao_proposal_sudo::msg::InstantiateMsg { - root: mock.sender().to_string(), + root: mock.sender_addr().to_string(), }; let gov_instantiate = InstantiateMsg { @@ -555,7 +555,7 @@ fn test_module_already_disabled() { gov.upload().unwrap(); let govmod_instantiate = dao_proposal_sudo::msg::InstantiateMsg { - root: mock.sender().to_string(), + root: mock.sender_addr().to_string(), }; let gov_instantiate = InstantiateMsg { @@ -632,7 +632,7 @@ fn test_swap_voting_module() { gov.upload().unwrap(); let govmod_instantiate = dao_proposal_sudo::msg::InstantiateMsg { - root: mock.sender().to_string(), + root: mock.sender_addr().to_string(), }; let gov_instantiate = InstantiateMsg { @@ -704,7 +704,7 @@ fn test_permissions() { gov.upload().unwrap(); let govmod_instantiate = dao_proposal_sudo::msg::InstantiateMsg { - root: mock.sender().to_string(), + root: mock.sender_addr().to_string(), }; let gov_instantiate = InstantiateMsg { @@ -791,7 +791,7 @@ fn do_standard_instantiate( cw20.upload().unwrap(); let govmod_instantiate = dao_proposal_sudo::msg::InstantiateMsg { - root: mock.sender().to_string(), + root: mock.sender_addr().to_string(), }; let voting_instantiate = dao_voting_cw20_balance::msg::InstantiateMsg { token_info: dao_voting_cw20_balance::msg::TokenInfo::New { @@ -801,7 +801,7 @@ fn do_standard_instantiate( symbol: "DAO".to_string(), decimals: 6, initial_balances: vec![cw20::Cw20Coin { - address: mock.sender().to_string(), + address: mock.sender_addr().to_string(), amount: Uint128::from(2u64), }], marketing: None, @@ -1168,7 +1168,7 @@ fn test_passthrough_voting_queries() { let (gov, _, mock, _) = do_standard_instantiate(true, false); assert_eq!( - gov.voting_power_at_height(mock.sender().to_string(), None) + gov.voting_power_at_height(mock.sender_addr().to_string(), None) .unwrap(), VotingPowerAtHeightResponse { power: Uint128::from(2u64), @@ -1234,7 +1234,7 @@ fn test_list_items() { gov.upload().unwrap(); cw20.upload().unwrap(); let govmod_instantiate = dao_proposal_sudo::msg::InstantiateMsg { - root: mock.sender().to_string(), + root: mock.sender_addr().to_string(), }; let voting_instantiate = dao_voting_cw20_balance::msg::InstantiateMsg { token_info: dao_voting_cw20_balance::msg::TokenInfo::New { @@ -1244,7 +1244,7 @@ fn test_list_items() { symbol: "DAO".to_string(), decimals: 6, initial_balances: vec![cw20::Cw20Coin { - address: mock.sender().to_string(), + address: mock.sender_addr().to_string(), amount: Uint128::from(2u64), }], marketing: None, @@ -1335,7 +1335,7 @@ fn test_instantiate_with_items() { cw20.upload().unwrap(); let govmod_instantiate = dao_proposal_sudo::msg::InstantiateMsg { - root: mock.sender().to_string(), + root: mock.sender_addr().to_string(), }; let voting_instantiate = dao_voting_cw20_balance::msg::InstantiateMsg { token_info: dao_voting_cw20_balance::msg::TokenInfo::New { @@ -1345,7 +1345,7 @@ fn test_instantiate_with_items() { symbol: "DAO".to_string(), decimals: 6, initial_balances: vec![cw20::Cw20Coin { - address: mock.sender().to_string(), + address: mock.sender_addr().to_string(), amount: Uint128::from(2u64), }], marketing: None, @@ -1578,7 +1578,7 @@ fn test_cw721_receive() { &cw721_base::msg::InstantiateMsg { name: "ekez".to_string(), symbol: "ekez".to_string(), - minter: mock.sender().to_string(), + minter: mock.sender_addr().to_string(), }, None, None, @@ -1592,7 +1592,7 @@ fn test_cw721_receive() { &cw721_base::msg::InstantiateMsg { name: "ekez".to_string(), symbol: "ekez".to_string(), - minter: mock.sender().to_string(), + minter: mock.sender_addr().to_string(), }, None, None, @@ -1603,7 +1603,7 @@ fn test_cw721_receive() { .execute( &cw721_base::msg::ExecuteMsg::, Empty>::Mint { token_id: "ekez".to_string(), - owner: mock.sender().to_string(), + owner: mock.sender_addr().to_string(), token_uri: None, extension: None, }, @@ -1678,7 +1678,7 @@ fn test_cw721_receive_no_auto_add() { &cw721_base::msg::InstantiateMsg { name: "ekez".to_string(), symbol: "ekez".to_string(), - minter: mock.sender().to_string(), + minter: mock.sender_addr().to_string(), }, None, None, @@ -1692,7 +1692,7 @@ fn test_cw721_receive_no_auto_add() { &cw721_base::msg::InstantiateMsg { name: "ekez".to_string(), symbol: "ekez".to_string(), - minter: mock.sender().to_string(), + minter: mock.sender_addr().to_string(), }, None, None, @@ -1899,7 +1899,7 @@ fn test_migrate_from_compatible() { cw20.upload().unwrap(); let govmod_instantiate = dao_proposal_sudo::msg::InstantiateMsg { - root: mock.sender().to_string(), + root: mock.sender_addr().to_string(), }; let voting_instantiate = dao_voting_cw20_balance::msg::InstantiateMsg { token_info: dao_voting_cw20_balance::msg::TokenInfo::New { @@ -1909,7 +1909,7 @@ fn test_migrate_from_compatible() { symbol: "DAO".to_string(), decimals: 6, initial_balances: vec![cw20::Cw20Coin { - address: mock.sender().to_string(), + address: mock.sender_addr().to_string(), amount: Uint128::from(2u64), }], marketing: None, @@ -1942,7 +1942,7 @@ fn test_migrate_from_compatible() { initial_items: None, }; - gov.instantiate(&gov_instantiate, Some(&mock.sender()), None) + gov.instantiate(&gov_instantiate, Some(&mock.sender_addr()), None) .unwrap(); let state = gov.dump_state().unwrap(); @@ -1973,7 +1973,7 @@ fn test_migrate_from_beta() { cw20.upload().unwrap(); let proposal_instantiate = dao_proposal_sudo::msg::InstantiateMsg { - root: mock.sender().to_string(), + root: mock.sender_addr().to_string(), }; let voting_instantiate = dao_voting_cw20_balance::msg::InstantiateMsg { token_info: dao_voting_cw20_balance::msg::TokenInfo::New { @@ -1983,7 +1983,7 @@ fn test_migrate_from_beta() { symbol: "DAO".to_string(), decimals: 6, initial_balances: vec![cw20::Cw20Coin { - address: mock.sender().to_string(), + address: mock.sender_addr().to_string(), amount: Uint128::from(2u64), }], marketing: None, @@ -2022,7 +2022,7 @@ fn test_migrate_from_beta() { }; v1_gov - .instantiate(&v1_core_instantiate, Some(&mock.sender()), None) + .instantiate(&v1_core_instantiate, Some(&mock.sender_addr()), None) .unwrap(); gov.set_address(&v1_gov.address().unwrap()); @@ -2154,7 +2154,7 @@ fn test_module_prefixes() { gov.upload().unwrap(); let govmod_instantiate = dao_proposal_sudo::msg::InstantiateMsg { - root: mock.sender().to_string(), + root: mock.sender_addr().to_string(), }; let gov_instantiate = InstantiateMsg { @@ -2233,7 +2233,7 @@ fn test_add_remove_subdaos() { let (gov, _proposal, mock, _) = do_standard_instantiate(false, false); test_unauthorized( - &gov.call_as(&mock.sender()), + &gov.call_as(&mock.sender_addr()), ExecuteMsg::UpdateSubDaos { to_add: vec![], to_remove: vec![], diff --git a/contracts/test/dao-proposal-sudo/src/msg.rs b/contracts/test/dao-proposal-sudo/src/msg.rs index de00f94ad..f6b6e32dc 100644 --- a/contracts/test/dao-proposal-sudo/src/msg.rs +++ b/contracts/test/dao-proposal-sudo/src/msg.rs @@ -9,7 +9,7 @@ pub struct InstantiateMsg { #[cw_serde] #[derive(cw_orch::ExecuteFns)] pub enum ExecuteMsg { - #[fn_name("proposal_execute")] + #[cw_orch(fn_name("proposal_execute"))] Execute { msgs: Vec }, }