Skip to content

Commit

Permalink
Lint + not(target_arch = "wasm32") in lib.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
ismellike committed Jul 19, 2024
1 parent 18241d0 commit 6db4637
Show file tree
Hide file tree
Showing 26 changed files with 38 additions and 89 deletions.
2 changes: 1 addition & 1 deletion contracts/external/cw-payroll-factory/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub enum ReceiveMsg {
}

#[cw_serde]
#[derive(QueryResponses,cw_orch::QueryFns)]
#[derive(QueryResponses, cw_orch::QueryFns)]
pub enum QueryMsg {
/// Returns list of all vesting payment contracts
#[returns(Vec<crate::state::VestingContract>)]
Expand Down
5 changes: 1 addition & 4 deletions packages/cw-orch/src/core.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use cw_orch::interface;
#[cfg(not(target_arch = "wasm32"))]
use cw_orch::prelude::*;
use cw_orch::{interface, prelude::*};

use dao_dao_core::contract::{execute, instantiate, migrate, query, reply};
use dao_interface::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg};

#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)]
pub struct DaoDaoCore;

#[cfg(not(target_arch = "wasm32"))]
impl<Chain> Uploadable for DaoDaoCore<Chain> {
/// Return the path to the wasm file corresponding to the contract
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
Expand Down
2 changes: 1 addition & 1 deletion packages/cw-orch/src/external/cw721_roles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ impl<Chain> Uploadable for DaoExternalCw721Roles<Chain> {
fn wrapper() -> Box<dyn MockContract<Empty>> {
Box::new(ContractWrapper::new_with_empty(execute, instantiate, query))
}
}
}
2 changes: 1 addition & 1 deletion packages/cw-orch/src/external/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ pub use cw_vesting::DaoExternalCwVesting;
pub use migrator::DaoExternalMigrator;
pub use payroll_factory::DaoExternalPayrollFactory;
pub use token_swap::DaoExternalTokenSwap;
pub use tokenfactory_issuer::DaoExternalTokenfactoryIssuer;
pub use tokenfactory_issuer::DaoExternalTokenfactoryIssuer;
1 change: 0 additions & 1 deletion packages/cw-orch/src/external/token_swap.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use cosmwasm_std::Reply;
use cw_orch::{interface, prelude::*};

use cw_token_swap::contract::{execute, instantiate, migrate, query};
Expand Down
14 changes: 14 additions & 0 deletions packages/cw-orch/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
#[cfg(not(target_arch = "wasm32"))]
mod core;
#[cfg(not(target_arch = "wasm32"))]
mod external;
#[cfg(not(target_arch = "wasm32"))]
mod pre_propose;
#[cfg(not(target_arch = "wasm32"))]
mod proposal;
#[cfg(not(target_arch = "wasm32"))]
mod staking;
#[cfg(not(target_arch = "wasm32"))]
mod test_contracts;
#[cfg(not(target_arch = "wasm32"))]
mod voting;

#[cfg(not(target_arch = "wasm32"))]
pub use core::*;
#[cfg(not(target_arch = "wasm32"))]
pub use external::*;
#[cfg(not(target_arch = "wasm32"))]
pub use pre_propose::*;
#[cfg(not(target_arch = "wasm32"))]
pub use proposal::*;
#[cfg(not(target_arch = "wasm32"))]
pub use staking::*;
#[cfg(not(target_arch = "wasm32"))]
pub use test_contracts::*;
#[cfg(not(target_arch = "wasm32"))]
pub use voting::*;

#[cfg(feature = "wasm_test")]
Expand Down
5 changes: 1 addition & 4 deletions packages/cw-orch/src/pre_propose/approval_single.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use cw_orch::interface;
#[cfg(not(target_arch = "wasm32"))]
use cw_orch::prelude::*;
use cw_orch::{interface, prelude::*};

use dao_pre_propose_approval_single::contract::{execute, instantiate, query};
use dao_pre_propose_approval_single::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};

#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)]
pub struct DaoPreProposeApprovalSingle;

#[cfg(not(target_arch = "wasm32"))]
impl<Chain> Uploadable for DaoPreProposeApprovalSingle<Chain> {
/// Return the path to the wasm file corresponding to the contract
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
Expand Down
5 changes: 1 addition & 4 deletions packages/cw-orch/src/pre_propose/approver.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use cw_orch::interface;
#[cfg(not(target_arch = "wasm32"))]
use cw_orch::prelude::*;
use cw_orch::{interface, prelude::*};

use dao_pre_propose_approver::contract::{execute, instantiate, query};
use dao_pre_propose_approver::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};

#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)]
pub struct DaoPreProposeApprover;

#[cfg(not(target_arch = "wasm32"))]
impl<Chain> Uploadable for DaoPreProposeApprover<Chain> {
/// Return the path to the wasm file corresponding to the contract
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
Expand Down
5 changes: 1 addition & 4 deletions packages/cw-orch/src/pre_propose/multiple.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use cw_orch::interface;
#[cfg(not(target_arch = "wasm32"))]
use cw_orch::prelude::*;
use cw_orch::{interface, prelude::*};

use dao_pre_propose_multiple::contract::{execute, instantiate, query};
use dao_pre_propose_multiple::contract::{ExecuteMsg, InstantiateMsg, QueryMsg};

#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)]
pub struct DaoPreProposeMultiple;

#[cfg(not(target_arch = "wasm32"))]
impl<Chain> Uploadable for DaoPreProposeMultiple<Chain> {
/// Return the path to the wasm file corresponding to the contract
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
Expand Down
5 changes: 1 addition & 4 deletions packages/cw-orch/src/pre_propose/single.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use cw_orch::interface;
#[cfg(not(target_arch = "wasm32"))]
use cw_orch::prelude::*;
use cw_orch::{interface, prelude::*};

use dao_pre_propose_single::contract::{execute, instantiate, query};
use dao_pre_propose_single::contract::{ExecuteMsg, InstantiateMsg, QueryMsg};

#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)]
pub struct DaoPreProposeSingle;

#[cfg(not(target_arch = "wasm32"))]
impl<Chain> Uploadable for DaoPreProposeSingle<Chain> {
/// Return the path to the wasm file corresponding to the contract
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
Expand Down
5 changes: 1 addition & 4 deletions packages/cw-orch/src/proposal/condorcet.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use cw_orch::interface;
#[cfg(not(target_arch = "wasm32"))]
use cw_orch::prelude::*;
use cw_orch::{interface, prelude::*};

use dao_proposal_condorcet::contract::{execute, instantiate, query, reply};
use dao_proposal_condorcet::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};

#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)]
pub struct DaoProposalCondorcet;

#[cfg(not(target_arch = "wasm32"))]
impl<Chain> Uploadable for DaoProposalCondorcet<Chain> {
/// Return the path to the wasm file corresponding to the contract
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
Expand Down
5 changes: 1 addition & 4 deletions packages/cw-orch/src/proposal/multiple.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use cw_orch::interface;
#[cfg(not(target_arch = "wasm32"))]
use cw_orch::prelude::*;
use cw_orch::{interface, prelude::*};

use dao_proposal_multiple::contract::{execute, instantiate, migrate, query, reply};
use dao_proposal_multiple::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg};

#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)]
pub struct DaoProposalMultiple;

#[cfg(not(target_arch = "wasm32"))]
impl<Chain> Uploadable for DaoProposalMultiple<Chain> {
/// Return the path to the wasm file corresponding to the contract
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
Expand Down
5 changes: 1 addition & 4 deletions packages/cw-orch/src/proposal/single.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use cw_orch::interface;
#[cfg(not(target_arch = "wasm32"))]
use cw_orch::prelude::*;
use cw_orch::{interface, prelude::*};

use dao_proposal_single::contract::{execute, instantiate, migrate, query, reply};
use dao_proposal_single::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg};

#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)]
pub struct DaoProposalSingle;

#[cfg(not(target_arch = "wasm32"))]
impl<Chain> Uploadable for DaoProposalSingle<Chain> {
/// Return the path to the wasm file corresponding to the contract
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
Expand Down
5 changes: 1 addition & 4 deletions packages/cw-orch/src/staking/cw20_stake.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use cw_orch::interface;
#[cfg(not(target_arch = "wasm32"))]
use cw_orch::prelude::*;
use cw_orch::{interface, prelude::*};

use cw20_stake::contract::{execute, instantiate, migrate, query};
use cw20_stake::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg};

#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)]
pub struct Cw20Stake;

#[cfg(not(target_arch = "wasm32"))]
impl<Chain> Uploadable for Cw20Stake<Chain> {
/// Return the path to the wasm file corresponding to the contract
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
Expand Down
5 changes: 1 addition & 4 deletions packages/cw-orch/src/staking/external_rewards.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use cw_orch::interface;
#[cfg(not(target_arch = "wasm32"))]
use cw_orch::prelude::*;
use cw_orch::{interface, prelude::*};

use cw20_stake_external_rewards::contract::{execute, instantiate, migrate, query};
use cw20_stake_external_rewards::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg};

#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)]
pub struct Cw20StakeExternalRewards;

#[cfg(not(target_arch = "wasm32"))]
impl<Chain> Uploadable for Cw20StakeExternalRewards<Chain> {
/// Return the path to the wasm file corresponding to the contract
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
Expand Down
5 changes: 1 addition & 4 deletions packages/cw-orch/src/staking/reward_distributor.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use cw_orch::interface;
#[cfg(not(target_arch = "wasm32"))]
use cw_orch::prelude::*;
use cw_orch::{interface, prelude::*};

use cw20_stake_reward_distributor::contract::{execute, instantiate, migrate, query};
use cw20_stake_reward_distributor::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg};

#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)]
pub struct Cw20StakeRewardDistributor;

#[cfg(not(target_arch = "wasm32"))]
impl<Chain> Uploadable for Cw20StakeRewardDistributor<Chain> {
/// Return the path to the wasm file corresponding to the contract
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
Expand Down
6 changes: 1 addition & 5 deletions packages/cw-orch/src/test_contracts/cw721.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,17 @@ use cw721_base::{
entry::{execute, instantiate, query},
ExecuteMsg, InstantiateMsg, QueryMsg,
};
use cw_orch::interface;
#[cfg(not(target_arch = "wasm32"))]
use cw_orch::prelude::*;
use cw_orch::{interface, prelude::*};

pub type Cw721BaseQueryMsg = QueryMsg<Empty>;
#[interface(InstantiateMsg, ExecuteMsg<T, E>, Cw721BaseQueryMsg, Empty)]
pub struct Cw721BaseGeneric;

#[cfg(not(target_arch = "wasm32"))]
impl<Chain: CwEnv, T, E> Uploadable for Cw721BaseGeneric<Chain, T, E> {
// Return a CosmWasm contract wrapper
fn wrapper() -> Box<dyn MockContract<Empty>> {
Box::new(ContractWrapper::new_with_empty(execute, instantiate, query))
}
}

#[cfg(not(target_arch = "wasm32"))]
pub type Cw721Base<Chain> = Cw721BaseGeneric<Chain, Option<Empty>, Empty>;
5 changes: 1 addition & 4 deletions packages/cw-orch/src/test_contracts/proposal_hook_counter.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use cw_orch::interface;
#[cfg(not(target_arch = "wasm32"))]
use cw_orch::prelude::*;
use cw_orch::{interface, prelude::*};

use dao_proposal_hook_counter::contract::{execute, instantiate, query};
use dao_proposal_hook_counter::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};

#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)]
pub struct DaoProposalHookCounter;

#[cfg(not(target_arch = "wasm32"))]
impl<Chain> Uploadable for DaoProposalHookCounter<Chain> {
/// Return the path to the wasm file corresponding to the contract
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
Expand Down
5 changes: 1 addition & 4 deletions packages/cw-orch/src/test_contracts/proposal_sudo.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use cw_orch::interface;
#[cfg(not(target_arch = "wasm32"))]
use cw_orch::prelude::*;
use cw_orch::{interface, prelude::*};

use dao_proposal_sudo::contract::{execute, instantiate, query};
use dao_proposal_sudo::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};

#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)]
pub struct DaoProposalSudo;

#[cfg(not(target_arch = "wasm32"))]
impl<Chain> Uploadable for DaoProposalSudo<Chain> {
/// Return the path to the wasm file corresponding to the contract
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
Expand Down
5 changes: 1 addition & 4 deletions packages/cw-orch/src/test_contracts/test_custom_factory.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use cw_orch::interface;
#[cfg(not(target_arch = "wasm32"))]
use cw_orch::prelude::*;
use cw_orch::{interface, prelude::*};

use dao_test_custom_factory::contract::{execute, instantiate, query, reply};
use dao_test_custom_factory::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};

#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)]
pub struct DaoTestCustomFactory;

#[cfg(not(target_arch = "wasm32"))]
impl<Chain> Uploadable for DaoTestCustomFactory<Chain> {
/// Return the path to the wasm file corresponding to the contract
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
Expand Down
5 changes: 1 addition & 4 deletions packages/cw-orch/src/test_contracts/voting_cw20_balance.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use cw_orch::interface;
#[cfg(not(target_arch = "wasm32"))]
use cw_orch::prelude::*;
use cw_orch::{interface, prelude::*};

use dao_voting_cw20_balance::contract::{execute, instantiate, query, reply};
use dao_voting_cw20_balance::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};

#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)]
pub struct DaoVotingCw20Balance;

#[cfg(not(target_arch = "wasm32"))]
impl<Chain> Uploadable for DaoVotingCw20Balance<Chain> {
/// Return the path to the wasm file corresponding to the contract
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
Expand Down
5 changes: 1 addition & 4 deletions packages/cw-orch/src/voting/cw20_staked.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use cw_orch::interface;
#[cfg(not(target_arch = "wasm32"))]
use cw_orch::prelude::*;
use cw_orch::{interface, prelude::*};

use dao_voting_cw20_staked::contract::{execute, instantiate, migrate, query, reply};
use dao_voting_cw20_staked::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg};

#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)]
pub struct DaoVotingCw20Staked;

#[cfg(not(target_arch = "wasm32"))]
impl<Chain> Uploadable for DaoVotingCw20Staked<Chain> {
/// Return the path to the wasm file corresponding to the contract
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
Expand Down
5 changes: 1 addition & 4 deletions packages/cw-orch/src/voting/cw4.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use cw_orch::interface;
#[cfg(not(target_arch = "wasm32"))]
use cw_orch::prelude::*;
use cw_orch::{interface, prelude::*};

use dao_voting_cw4::contract::{execute, instantiate, migrate, query, reply};
use dao_voting_cw4::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg};

#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)]
pub struct DaoVotingCw4;

#[cfg(not(target_arch = "wasm32"))]
impl<Chain> Uploadable for DaoVotingCw4<Chain> {
/// Return the path to the wasm file corresponding to the contract
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
Expand Down
5 changes: 1 addition & 4 deletions packages/cw-orch/src/voting/cw721_roles.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use cw_orch::interface;
#[cfg(not(target_arch = "wasm32"))]
use cw_orch::prelude::*;
use cw_orch::{interface, prelude::*};

use dao_voting_cw721_roles::contract::{execute, instantiate, query, reply};
use dao_voting_cw721_roles::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};

#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)]
pub struct DaoVotingCw721Roles;

#[cfg(not(target_arch = "wasm32"))]
impl<Chain> Uploadable for DaoVotingCw721Roles<Chain> {
/// Return the path to the wasm file corresponding to the contract
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
Expand Down
5 changes: 1 addition & 4 deletions packages/cw-orch/src/voting/cw721_staked.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use cw_orch::interface;
#[cfg(not(target_arch = "wasm32"))]
use cw_orch::prelude::*;
use cw_orch::{interface, prelude::*};

use dao_voting_cw721_staked::contract::{execute, instantiate, migrate, query, reply};
use dao_voting_cw721_staked::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg};

#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)]
pub struct DaoVotingCw721Staked;

#[cfg(not(target_arch = "wasm32"))]
impl<Chain> Uploadable for DaoVotingCw721Staked<Chain> {
/// Return the path to the wasm file corresponding to the contract
fn wasm(_chain: &ChainInfoOwned) -> WasmPath {
Expand Down
Loading

0 comments on commit 6db4637

Please sign in to comment.