From 449e481d69fd25bf7fa83c451359310ac04d5812 Mon Sep 17 00:00:00 2001 From: Gabriel Lopez Date: Thu, 11 Jul 2024 02:21:52 -0500 Subject: [PATCH] Cargo schema + fix orch wasm build and tests --- .../dao-dao-core/schema/dao-dao-core.json | 198 +++++++++++++++--- .../dao-pre-propose-approval-single.json | 25 +++ .../schema/dao-pre-propose-multiple.json | 25 +++ .../schema/dao-pre-propose-single.json | 25 +++ .../schema/dao-proposal-condorcet.json | 50 +++++ .../schema/dao-proposal-multiple.json | 100 +++++++++ .../schema/dao-proposal-single.json | 100 +++++++++ packages/cw-orch/Cargo.toml | 4 + packages/cw-orch/src/core.rs | 5 +- packages/cw-orch/src/lib.rs | 1 + .../src/pre_propose/approval_single.rs | 5 +- packages/cw-orch/src/pre_propose/approver.rs | 5 +- packages/cw-orch/src/pre_propose/multiple.rs | 5 +- packages/cw-orch/src/pre_propose/single.rs | 5 +- packages/cw-orch/src/proposal/condorcet.rs | 5 +- packages/cw-orch/src/proposal/multiple.rs | 5 +- packages/cw-orch/src/proposal/single.rs | 5 +- packages/cw-orch/src/staking/cw20_stake.rs | 5 +- .../cw-orch/src/staking/external_rewards.rs | 5 +- .../cw-orch/src/staking/reward_distributor.rs | 5 +- packages/cw-orch/src/test_contracts/cw721.rs | 3 + packages/cw-orch/src/test_contracts/mod.rs | 1 + .../test_contracts/proposal_hook_counter.rs | 5 +- .../src/test_contracts/proposal_sudo.rs | 5 +- .../src/test_contracts/test_custom_factory.rs | 5 +- .../src/test_contracts/voting_cw20_balance.rs | 5 +- packages/cw-orch/src/voting/cw20_staked.rs | 5 +- packages/cw-orch/src/voting/cw4.rs | 5 +- packages/cw-orch/src/voting/cw721_roles.rs | 5 +- packages/cw-orch/src/voting/cw721_staked.rs | 5 +- packages/cw-orch/src/voting/token_staked.rs | 5 +- 31 files changed, 585 insertions(+), 47 deletions(-) diff --git a/contracts/dao-dao-core/schema/dao-dao-core.json b/contracts/dao-dao-core/schema/dao-dao-core.json index b1cca4f3d..23e45fd01 100644 --- a/contracts/dao-dao-core/schema/dao-dao-core.json +++ b/contracts/dao-dao-core/schema/dao-dao-core.json @@ -918,6 +918,10 @@ }, "additionalProperties": false }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, "DistributionMsg": { "description": "The message types of the distribution module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto", "oneOf": [ @@ -964,6 +968,31 @@ } }, "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). `depositor` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "fund_community_pool" + ], + "properties": { + "fund_community_pool": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "description": "The amount to spend", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false } ] }, @@ -1039,6 +1068,36 @@ } }, "additionalProperties": false + }, + { + "description": "This maps directly to [MsgVoteWeighted](https://github.com/cosmos/cosmos-sdk/blob/v0.45.8/proto/cosmos/gov/v1beta1/tx.proto#L66-L78) in the Cosmos SDK with voter set to the contract address.", + "type": "object", + "required": [ + "vote_weighted" + ], + "properties": { + "vote_weighted": { + "type": "object", + "required": [ + "options", + "proposal_id" + ], + "properties": { + "options": { + "type": "array", + "items": { + "$ref": "#/definitions/WeightedVoteOption" + } + }, + "proposal_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false } ] }, @@ -1463,6 +1522,60 @@ }, "additionalProperties": false }, + { + "description": "Instantiates a new contracts from previously uploaded Wasm code using a predictable address derivation algorithm implemented in [`cosmwasm_std::instantiate2_address`].\n\nThis is translated to a [MsgInstantiateContract2](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L73-L96). `sender` is automatically filled with the current contract's address. `fix_msg` is automatically set to false.", + "type": "object", + "required": [ + "instantiate2" + ], + "properties": { + "instantiate2": { + "type": "object", + "required": [ + "code_id", + "funds", + "label", + "msg", + "salt" + ], + "properties": { + "admin": { + "type": [ + "string", + "null" + ] + }, + "code_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "funds": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "label": { + "description": "A human-readable label for the contract.\n\nValid values should: - not be empty - not be bigger than 128 bytes (or some chain-specific limit) - not start / end with whitespace", + "type": "string" + }, + "msg": { + "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "salt": { + "$ref": "#/definitions/Binary" + } + } + } + }, + "additionalProperties": false + }, { "description": "Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to customize behavior.\n\nOnly the contract admin (as defined in wasmd), if any, is able to make this call.\n\nThis is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96). `sender` is automatically filled with the current contract's address.", "type": "object", @@ -1547,6 +1660,21 @@ "additionalProperties": false } ] + }, + "WeightedVoteOption": { + "type": "object", + "required": [ + "option", + "weight" + ], + "properties": { + "option": { + "$ref": "#/definitions/VoteOption" + }, + "weight": { + "$ref": "#/definitions/Decimal" + } + } } } }, @@ -2486,37 +2614,43 @@ }, "cw20_balances": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Cw20BalanceResponse", - "description": "Returned by the `Cw20Balances` query.", - "type": "object", - "required": [ - "addr", - "balance" - ], - "properties": { - "addr": { - "description": "The address of the token.", - "allOf": [ - { - "$ref": "#/definitions/Addr" - } - ] - }, - "balance": { - "description": "The contract's balance.", - "allOf": [ - { - "$ref": "#/definitions/Uint128" - } - ] - } + "title": "Array_of_Cw20BalanceResponse", + "type": "array", + "items": { + "$ref": "#/definitions/Cw20BalanceResponse" }, - "additionalProperties": false, "definitions": { "Addr": { "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", "type": "string" }, + "Cw20BalanceResponse": { + "description": "Returned by the `Cw20Balances` query.", + "type": "object", + "required": [ + "addr", + "balance" + ], + "properties": { + "addr": { + "description": "The address of the token.", + "allOf": [ + { + "$ref": "#/definitions/Addr" + } + ] + }, + "balance": { + "description": "The contract's balance.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] + } + }, + "additionalProperties": false + }, "Uint128": { "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", "type": "string" @@ -2895,10 +3029,20 @@ }, "list_items": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Array_of_String", + "title": "Array_of_Tuple_of_String_and_String", "type": "array", "items": { - "type": "string" + "type": "array", + "items": [ + { + "type": "string" + }, + { + "type": "string" + } + ], + "maxItems": 2, + "minItems": 2 } }, "list_sub_daos": { diff --git a/contracts/pre-propose/dao-pre-propose-approval-single/schema/dao-pre-propose-approval-single.json b/contracts/pre-propose/dao-pre-propose-approval-single/schema/dao-pre-propose-approval-single.json index 25303c6bd..9bb6f1213 100644 --- a/contracts/pre-propose/dao-pre-propose-approval-single/schema/dao-pre-propose-approval-single.json +++ b/contracts/pre-propose/dao-pre-propose-approval-single/schema/dao-pre-propose-approval-single.json @@ -848,6 +848,31 @@ } }, "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). `depositor` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "fund_community_pool" + ], + "properties": { + "fund_community_pool": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "description": "The amount to spend", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false } ] }, diff --git a/contracts/pre-propose/dao-pre-propose-multiple/schema/dao-pre-propose-multiple.json b/contracts/pre-propose/dao-pre-propose-multiple/schema/dao-pre-propose-multiple.json index a23f2cc06..7e2958b4d 100644 --- a/contracts/pre-propose/dao-pre-propose-multiple/schema/dao-pre-propose-multiple.json +++ b/contracts/pre-propose/dao-pre-propose-multiple/schema/dao-pre-propose-multiple.json @@ -840,6 +840,31 @@ } }, "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). `depositor` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "fund_community_pool" + ], + "properties": { + "fund_community_pool": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "description": "The amount to spend", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false } ] }, diff --git a/contracts/pre-propose/dao-pre-propose-single/schema/dao-pre-propose-single.json b/contracts/pre-propose/dao-pre-propose-single/schema/dao-pre-propose-single.json index d91d61190..6de3d4a04 100644 --- a/contracts/pre-propose/dao-pre-propose-single/schema/dao-pre-propose-single.json +++ b/contracts/pre-propose/dao-pre-propose-single/schema/dao-pre-propose-single.json @@ -840,6 +840,31 @@ } }, "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). `depositor` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "fund_community_pool" + ], + "properties": { + "fund_community_pool": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "description": "The amount to spend", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false } ] }, diff --git a/contracts/proposal/dao-proposal-condorcet/schema/dao-proposal-condorcet.json b/contracts/proposal/dao-proposal-condorcet/schema/dao-proposal-condorcet.json index 31094252c..73bc73dd9 100644 --- a/contracts/proposal/dao-proposal-condorcet/schema/dao-proposal-condorcet.json +++ b/contracts/proposal/dao-proposal-condorcet/schema/dao-proposal-condorcet.json @@ -480,6 +480,31 @@ } }, "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). `depositor` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "fund_community_pool" + ], + "properties": { + "fund_community_pool": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "description": "The amount to spend", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false } ] }, @@ -1707,6 +1732,31 @@ } }, "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). `depositor` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "fund_community_pool" + ], + "properties": { + "fund_community_pool": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "description": "The amount to spend", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false } ] }, diff --git a/contracts/proposal/dao-proposal-multiple/schema/dao-proposal-multiple.json b/contracts/proposal/dao-proposal-multiple/schema/dao-proposal-multiple.json index 75729fda4..51bc3ffa2 100644 --- a/contracts/proposal/dao-proposal-multiple/schema/dao-proposal-multiple.json +++ b/contracts/proposal/dao-proposal-multiple/schema/dao-proposal-multiple.json @@ -988,6 +988,31 @@ } }, "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). `depositor` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "fund_community_pool" + ], + "properties": { + "fund_community_pool": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "description": "The amount to spend", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false } ] }, @@ -3097,6 +3122,31 @@ } }, "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). `depositor` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "fund_community_pool" + ], + "properties": { + "fund_community_pool": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "description": "The amount to spend", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false } ] }, @@ -4485,6 +4535,31 @@ } }, "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). `depositor` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "fund_community_pool" + ], + "properties": { + "fund_community_pool": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "description": "The amount to spend", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false } ] }, @@ -5831,6 +5906,31 @@ } }, "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). `depositor` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "fund_community_pool" + ], + "properties": { + "fund_community_pool": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "description": "The amount to spend", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false } ] }, diff --git a/contracts/proposal/dao-proposal-single/schema/dao-proposal-single.json b/contracts/proposal/dao-proposal-single/schema/dao-proposal-single.json index 9738cadec..fdd578d12 100644 --- a/contracts/proposal/dao-proposal-single/schema/dao-proposal-single.json +++ b/contracts/proposal/dao-proposal-single/schema/dao-proposal-single.json @@ -1041,6 +1041,31 @@ } }, "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). `depositor` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "fund_community_pool" + ], + "properties": { + "fund_community_pool": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "description": "The amount to spend", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false } ] }, @@ -3203,6 +3228,31 @@ } }, "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). `depositor` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "fund_community_pool" + ], + "properties": { + "fund_community_pool": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "description": "The amount to spend", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false } ] }, @@ -4602,6 +4652,31 @@ } }, "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). `depositor` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "fund_community_pool" + ], + "properties": { + "fund_community_pool": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "description": "The amount to spend", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false } ] }, @@ -5947,6 +6022,31 @@ } }, "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). `depositor` is automatically filled with the current contract's address.", + "type": "object", + "required": [ + "fund_community_pool" + ], + "properties": { + "fund_community_pool": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "description": "The amount to spend", + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false } ] }, diff --git a/packages/cw-orch/Cargo.toml b/packages/cw-orch/Cargo.toml index 5b637879e..e4d3826e2 100644 --- a/packages/cw-orch/Cargo.toml +++ b/packages/cw-orch/Cargo.toml @@ -7,6 +7,10 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[features] +default = [] +wasm_test = [] + [dependencies] cosmwasm-std.workspace = true cw-orch = { version = "0.22.2" } diff --git a/packages/cw-orch/src/core.rs b/packages/cw-orch/src/core.rs index 501d56f4e..ff7fd24ea 100644 --- a/packages/cw-orch/src/core.rs +++ b/packages/cw-orch/src/core.rs @@ -1,4 +1,6 @@ -use cw_orch::{interface, prelude::*}; +use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] +use cw_orch::prelude::*; use dao_dao_core::contract::{execute, instantiate, migrate, query, reply}; use dao_interface::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; @@ -6,6 +8,7 @@ use dao_interface::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)] pub struct DaoDaoCore; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for DaoDaoCore { /// Return the path to the wasm file corresponding to the contract fn wasm(_chain: &ChainInfoOwned) -> WasmPath { diff --git a/packages/cw-orch/src/lib.rs b/packages/cw-orch/src/lib.rs index 9d99e4775..3b933d3b6 100644 --- a/packages/cw-orch/src/lib.rs +++ b/packages/cw-orch/src/lib.rs @@ -12,5 +12,6 @@ pub use staking::*; pub use test_contracts::*; pub use voting::*; +#[cfg(feature = "wasm_test")] #[cfg(test)] pub mod tests; diff --git a/packages/cw-orch/src/pre_propose/approval_single.rs b/packages/cw-orch/src/pre_propose/approval_single.rs index 98b9927f6..6dffb7e26 100644 --- a/packages/cw-orch/src/pre_propose/approval_single.rs +++ b/packages/cw-orch/src/pre_propose/approval_single.rs @@ -1,4 +1,6 @@ -use cw_orch::{interface, prelude::*}; +use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] +use cw_orch::prelude::*; use dao_pre_propose_approval_single::contract::{execute, instantiate, query}; use dao_pre_propose_approval_single::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; @@ -6,6 +8,7 @@ use dao_pre_propose_approval_single::msg::{ExecuteMsg, InstantiateMsg, QueryMsg} #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)] pub struct DaoPreProposeApprovalSingle; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for DaoPreProposeApprovalSingle { /// Return the path to the wasm file corresponding to the contract fn wasm(_chain: &ChainInfoOwned) -> WasmPath { diff --git a/packages/cw-orch/src/pre_propose/approver.rs b/packages/cw-orch/src/pre_propose/approver.rs index cebd7c13a..85db3924d 100644 --- a/packages/cw-orch/src/pre_propose/approver.rs +++ b/packages/cw-orch/src/pre_propose/approver.rs @@ -1,4 +1,6 @@ -use cw_orch::{interface, prelude::*}; +use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] +use cw_orch::prelude::*; use dao_pre_propose_approver::contract::{execute, instantiate, query}; use dao_pre_propose_approver::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; @@ -6,6 +8,7 @@ use dao_pre_propose_approver::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)] pub struct DaoPreProposeApprover; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for DaoPreProposeApprover { /// Return the path to the wasm file corresponding to the contract fn wasm(_chain: &ChainInfoOwned) -> WasmPath { diff --git a/packages/cw-orch/src/pre_propose/multiple.rs b/packages/cw-orch/src/pre_propose/multiple.rs index 7517df320..4c5cafdb4 100644 --- a/packages/cw-orch/src/pre_propose/multiple.rs +++ b/packages/cw-orch/src/pre_propose/multiple.rs @@ -1,4 +1,6 @@ -use cw_orch::{interface, prelude::*}; +use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] +use cw_orch::prelude::*; use dao_pre_propose_multiple::contract::{execute, instantiate, query}; use dao_pre_propose_multiple::contract::{ExecuteMsg, InstantiateMsg, QueryMsg}; @@ -6,6 +8,7 @@ use dao_pre_propose_multiple::contract::{ExecuteMsg, InstantiateMsg, QueryMsg}; #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)] pub struct DaoPreProposeMultiple; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for DaoPreProposeMultiple { /// Return the path to the wasm file corresponding to the contract fn wasm(_chain: &ChainInfoOwned) -> WasmPath { diff --git a/packages/cw-orch/src/pre_propose/single.rs b/packages/cw-orch/src/pre_propose/single.rs index 891654455..5934c3e45 100644 --- a/packages/cw-orch/src/pre_propose/single.rs +++ b/packages/cw-orch/src/pre_propose/single.rs @@ -1,4 +1,6 @@ -use cw_orch::{interface, prelude::*}; +use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] +use cw_orch::prelude::*; use dao_pre_propose_single::contract::{execute, instantiate, query}; use dao_pre_propose_single::contract::{ExecuteMsg, InstantiateMsg, QueryMsg}; @@ -6,6 +8,7 @@ use dao_pre_propose_single::contract::{ExecuteMsg, InstantiateMsg, QueryMsg}; #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)] pub struct DaoPreProposeSingle; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for DaoPreProposeSingle { /// Return the path to the wasm file corresponding to the contract fn wasm(_chain: &ChainInfoOwned) -> WasmPath { diff --git a/packages/cw-orch/src/proposal/condorcet.rs b/packages/cw-orch/src/proposal/condorcet.rs index fdfb8fb50..5bfce3f22 100644 --- a/packages/cw-orch/src/proposal/condorcet.rs +++ b/packages/cw-orch/src/proposal/condorcet.rs @@ -1,4 +1,6 @@ -use cw_orch::{interface, prelude::*}; +use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] +use cw_orch::prelude::*; use dao_proposal_condorcet::contract::{execute, instantiate, query, reply}; use dao_proposal_condorcet::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; @@ -6,6 +8,7 @@ use dao_proposal_condorcet::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)] pub struct DaoProposalCondorcet; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for DaoProposalCondorcet { /// Return the path to the wasm file corresponding to the contract fn wasm(_chain: &ChainInfoOwned) -> WasmPath { diff --git a/packages/cw-orch/src/proposal/multiple.rs b/packages/cw-orch/src/proposal/multiple.rs index dc28e8ef0..d5d482ae6 100644 --- a/packages/cw-orch/src/proposal/multiple.rs +++ b/packages/cw-orch/src/proposal/multiple.rs @@ -1,4 +1,6 @@ -use cw_orch::{interface, prelude::*}; +use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] +use cw_orch::prelude::*; use dao_proposal_multiple::contract::{execute, instantiate, migrate, query, reply}; use dao_proposal_multiple::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; @@ -6,6 +8,7 @@ use dao_proposal_multiple::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMs #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)] pub struct DaoProposalMultiple; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for DaoProposalMultiple { /// Return the path to the wasm file corresponding to the contract fn wasm(_chain: &ChainInfoOwned) -> WasmPath { diff --git a/packages/cw-orch/src/proposal/single.rs b/packages/cw-orch/src/proposal/single.rs index 7db09ee3b..c84617f21 100644 --- a/packages/cw-orch/src/proposal/single.rs +++ b/packages/cw-orch/src/proposal/single.rs @@ -1,4 +1,6 @@ -use cw_orch::{interface, prelude::*}; +use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] +use cw_orch::prelude::*; use dao_proposal_single::contract::{execute, instantiate, migrate, query, reply}; use dao_proposal_single::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; @@ -6,6 +8,7 @@ use dao_proposal_single::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg} #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)] pub struct DaoProposalSingle; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for DaoProposalSingle { /// Return the path to the wasm file corresponding to the contract fn wasm(_chain: &ChainInfoOwned) -> WasmPath { diff --git a/packages/cw-orch/src/staking/cw20_stake.rs b/packages/cw-orch/src/staking/cw20_stake.rs index 8b43d844c..bfbfeb054 100644 --- a/packages/cw-orch/src/staking/cw20_stake.rs +++ b/packages/cw-orch/src/staking/cw20_stake.rs @@ -1,4 +1,6 @@ -use cw_orch::{interface, prelude::*}; +use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] +use cw_orch::prelude::*; use cw20_stake::contract::{execute, instantiate, migrate, query}; use cw20_stake::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; @@ -6,6 +8,7 @@ use cw20_stake::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)] pub struct Cw20Stake; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for Cw20Stake { /// Return the path to the wasm file corresponding to the contract fn wasm(_chain: &ChainInfoOwned) -> WasmPath { diff --git a/packages/cw-orch/src/staking/external_rewards.rs b/packages/cw-orch/src/staking/external_rewards.rs index 0d4f19c5c..919b66b3d 100644 --- a/packages/cw-orch/src/staking/external_rewards.rs +++ b/packages/cw-orch/src/staking/external_rewards.rs @@ -1,4 +1,6 @@ -use cw_orch::{interface, prelude::*}; +use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] +use cw_orch::prelude::*; use cw20_stake_external_rewards::contract::{execute, instantiate, migrate, query}; use cw20_stake_external_rewards::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; @@ -6,6 +8,7 @@ use cw20_stake_external_rewards::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, Q #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)] pub struct Cw20StakeExternalRewards; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for Cw20StakeExternalRewards { /// Return the path to the wasm file corresponding to the contract fn wasm(_chain: &ChainInfoOwned) -> WasmPath { diff --git a/packages/cw-orch/src/staking/reward_distributor.rs b/packages/cw-orch/src/staking/reward_distributor.rs index 2f398ca81..cc6e4f7a8 100644 --- a/packages/cw-orch/src/staking/reward_distributor.rs +++ b/packages/cw-orch/src/staking/reward_distributor.rs @@ -1,4 +1,6 @@ -use cw_orch::{interface, prelude::*}; +use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] +use cw_orch::prelude::*; use cw20_stake_reward_distributor::contract::{execute, instantiate, migrate, query}; use cw20_stake_reward_distributor::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; @@ -6,6 +8,7 @@ use cw20_stake_reward_distributor::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)] pub struct Cw20StakeRewardDistributor; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for Cw20StakeRewardDistributor { /// Return the path to the wasm file corresponding to the contract fn wasm(_chain: &ChainInfoOwned) -> WasmPath { diff --git a/packages/cw-orch/src/test_contracts/cw721.rs b/packages/cw-orch/src/test_contracts/cw721.rs index 2bd6fc9cd..2959d2090 100644 --- a/packages/cw-orch/src/test_contracts/cw721.rs +++ b/packages/cw-orch/src/test_contracts/cw721.rs @@ -4,12 +4,14 @@ use cw721_base::{ ExecuteMsg, InstantiateMsg, QueryMsg, }; use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] use cw_orch::prelude::*; pub type Cw721BaseQueryMsg = QueryMsg; #[interface(InstantiateMsg, ExecuteMsg, Cw721BaseQueryMsg, Empty)] pub struct Cw721BaseGeneric; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for Cw721BaseGeneric { // Return a CosmWasm contract wrapper fn wrapper() -> Box> { @@ -17,4 +19,5 @@ impl Uploadable for Cw721BaseGeneric { } } +#[cfg(not(target_arch = "wasm32"))] pub type Cw721Base = Cw721BaseGeneric, Empty>; diff --git a/packages/cw-orch/src/test_contracts/mod.rs b/packages/cw-orch/src/test_contracts/mod.rs index 674ad6cc6..fb92c9f7c 100644 --- a/packages/cw-orch/src/test_contracts/mod.rs +++ b/packages/cw-orch/src/test_contracts/mod.rs @@ -4,6 +4,7 @@ mod proposal_sudo; mod test_custom_factory; mod voting_cw20_balance; +#[cfg(not(target_arch = "wasm32"))] pub use cw721::Cw721Base; pub use proposal_hook_counter::DaoProposalHookCounter; pub use proposal_sudo::DaoProposalSudo; diff --git a/packages/cw-orch/src/test_contracts/proposal_hook_counter.rs b/packages/cw-orch/src/test_contracts/proposal_hook_counter.rs index 7dc26654e..5702cf132 100644 --- a/packages/cw-orch/src/test_contracts/proposal_hook_counter.rs +++ b/packages/cw-orch/src/test_contracts/proposal_hook_counter.rs @@ -1,4 +1,6 @@ -use cw_orch::{interface, prelude::*}; +use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] +use cw_orch::prelude::*; use dao_proposal_hook_counter::contract::{execute, instantiate, query}; use dao_proposal_hook_counter::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; @@ -6,6 +8,7 @@ use dao_proposal_hook_counter::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)] pub struct DaoProposalHookCounter; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for DaoProposalHookCounter { /// Return the path to the wasm file corresponding to the contract fn wasm(_chain: &ChainInfoOwned) -> WasmPath { diff --git a/packages/cw-orch/src/test_contracts/proposal_sudo.rs b/packages/cw-orch/src/test_contracts/proposal_sudo.rs index bd623624a..27ba05201 100644 --- a/packages/cw-orch/src/test_contracts/proposal_sudo.rs +++ b/packages/cw-orch/src/test_contracts/proposal_sudo.rs @@ -1,4 +1,6 @@ -use cw_orch::{interface, prelude::*}; +use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] +use cw_orch::prelude::*; use dao_proposal_sudo::contract::{execute, instantiate, query}; use dao_proposal_sudo::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; @@ -6,6 +8,7 @@ use dao_proposal_sudo::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)] pub struct DaoProposalSudo; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for DaoProposalSudo { /// Return the path to the wasm file corresponding to the contract fn wasm(_chain: &ChainInfoOwned) -> WasmPath { diff --git a/packages/cw-orch/src/test_contracts/test_custom_factory.rs b/packages/cw-orch/src/test_contracts/test_custom_factory.rs index 3424df887..e6dd8e963 100644 --- a/packages/cw-orch/src/test_contracts/test_custom_factory.rs +++ b/packages/cw-orch/src/test_contracts/test_custom_factory.rs @@ -1,4 +1,6 @@ -use cw_orch::{interface, prelude::*}; +use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] +use cw_orch::prelude::*; use dao_test_custom_factory::contract::{execute, instantiate, query, reply}; use dao_test_custom_factory::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; @@ -6,6 +8,7 @@ use dao_test_custom_factory::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)] pub struct DaoTestCustomFactory; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for DaoTestCustomFactory { /// Return the path to the wasm file corresponding to the contract fn wasm(_chain: &ChainInfoOwned) -> WasmPath { diff --git a/packages/cw-orch/src/test_contracts/voting_cw20_balance.rs b/packages/cw-orch/src/test_contracts/voting_cw20_balance.rs index fdf7b84c0..15b8c2cb3 100644 --- a/packages/cw-orch/src/test_contracts/voting_cw20_balance.rs +++ b/packages/cw-orch/src/test_contracts/voting_cw20_balance.rs @@ -1,4 +1,6 @@ -use cw_orch::{interface, prelude::*}; +use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] +use cw_orch::prelude::*; use dao_voting_cw20_balance::contract::{execute, instantiate, query, reply}; use dao_voting_cw20_balance::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; @@ -6,6 +8,7 @@ use dao_voting_cw20_balance::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)] pub struct DaoVotingCw20Balance; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for DaoVotingCw20Balance { /// Return the path to the wasm file corresponding to the contract fn wasm(_chain: &ChainInfoOwned) -> WasmPath { diff --git a/packages/cw-orch/src/voting/cw20_staked.rs b/packages/cw-orch/src/voting/cw20_staked.rs index 1f044a913..33ee57ed3 100644 --- a/packages/cw-orch/src/voting/cw20_staked.rs +++ b/packages/cw-orch/src/voting/cw20_staked.rs @@ -1,4 +1,6 @@ -use cw_orch::{interface, prelude::*}; +use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] +use cw_orch::prelude::*; use dao_voting_cw20_staked::contract::{execute, instantiate, migrate, query, reply}; use dao_voting_cw20_staked::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; @@ -6,6 +8,7 @@ use dao_voting_cw20_staked::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryM #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)] pub struct DaoVotingCw20Staked; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for DaoVotingCw20Staked { /// Return the path to the wasm file corresponding to the contract fn wasm(_chain: &ChainInfoOwned) -> WasmPath { diff --git a/packages/cw-orch/src/voting/cw4.rs b/packages/cw-orch/src/voting/cw4.rs index 11dfac5ea..d230cd5a1 100644 --- a/packages/cw-orch/src/voting/cw4.rs +++ b/packages/cw-orch/src/voting/cw4.rs @@ -1,4 +1,6 @@ -use cw_orch::{interface, prelude::*}; +use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] +use cw_orch::prelude::*; use dao_voting_cw4::contract::{execute, instantiate, migrate, query, reply}; use dao_voting_cw4::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; @@ -6,6 +8,7 @@ use dao_voting_cw4::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)] pub struct DaoVotingCw4; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for DaoVotingCw4 { /// Return the path to the wasm file corresponding to the contract fn wasm(_chain: &ChainInfoOwned) -> WasmPath { diff --git a/packages/cw-orch/src/voting/cw721_roles.rs b/packages/cw-orch/src/voting/cw721_roles.rs index 6469a0887..395d3b0ed 100644 --- a/packages/cw-orch/src/voting/cw721_roles.rs +++ b/packages/cw-orch/src/voting/cw721_roles.rs @@ -1,4 +1,6 @@ -use cw_orch::{interface, prelude::*}; +use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] +use cw_orch::prelude::*; use dao_voting_cw721_roles::contract::{execute, instantiate, query, reply}; use dao_voting_cw721_roles::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; @@ -6,6 +8,7 @@ use dao_voting_cw721_roles::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)] pub struct DaoVotingCw721Roles; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for DaoVotingCw721Roles { /// Return the path to the wasm file corresponding to the contract fn wasm(_chain: &ChainInfoOwned) -> WasmPath { diff --git a/packages/cw-orch/src/voting/cw721_staked.rs b/packages/cw-orch/src/voting/cw721_staked.rs index 5ed2f1ce1..e5b4bb02d 100644 --- a/packages/cw-orch/src/voting/cw721_staked.rs +++ b/packages/cw-orch/src/voting/cw721_staked.rs @@ -1,4 +1,6 @@ -use cw_orch::{interface, prelude::*}; +use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] +use cw_orch::prelude::*; use dao_voting_cw721_staked::contract::{execute, instantiate, migrate, query, reply}; use dao_voting_cw721_staked::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; @@ -6,6 +8,7 @@ use dao_voting_cw721_staked::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, Query #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)] pub struct DaoVotingCw721Staked; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for DaoVotingCw721Staked { /// Return the path to the wasm file corresponding to the contract fn wasm(_chain: &ChainInfoOwned) -> WasmPath { diff --git a/packages/cw-orch/src/voting/token_staked.rs b/packages/cw-orch/src/voting/token_staked.rs index a8f41ca94..733e00260 100644 --- a/packages/cw-orch/src/voting/token_staked.rs +++ b/packages/cw-orch/src/voting/token_staked.rs @@ -1,4 +1,6 @@ -use cw_orch::{interface, prelude::*}; +use cw_orch::interface; +#[cfg(not(target_arch = "wasm32"))] +use cw_orch::prelude::*; use dao_voting_token_staked::contract::{execute, instantiate, migrate, query, reply}; use dao_voting_token_staked::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; @@ -6,6 +8,7 @@ use dao_voting_token_staked::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, Query #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)] pub struct DaoVotingTokenStaked; +#[cfg(not(target_arch = "wasm32"))] impl Uploadable for DaoVotingTokenStaked { /// Return the path to the wasm file corresponding to the contract fn wasm(_chain: &ChainInfoOwned) -> WasmPath {