From e7f3e28d2d3a493226151229bf95baf43714fc92 Mon Sep 17 00:00:00 2001 From: noah Date: Thu, 7 Nov 2024 19:49:28 -0500 Subject: [PATCH] remove dao-testing dependency on cw-fund-distributor and don't publish (#898) --- Cargo.lock | 2 -- .../distribution/cw-fund-distributor/Cargo.toml | 1 - .../src/testing/adversarial_tests.rs | 5 +++-- .../cw-fund-distributor/src/testing/mod.rs | 13 +++++++++++++ .../cw-fund-distributor/src/testing/tests.rs | 7 ++++--- packages/dao-testing/Cargo.toml | 1 - packages/dao-testing/src/contracts/latest.rs | 10 ---------- scripts/publish.sh | 5 ----- 8 files changed, 20 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index be53a5c71..0f101d9b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -848,7 +848,6 @@ version = "2.6.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cw-fund-distributor", "cw-multi-test", "cw-paginate-storage 2.6.0", "cw-storage-plus 1.2.0", @@ -2304,7 +2303,6 @@ dependencies = [ "cosmwasm-std", "cw-admin-factory", "cw-core", - "cw-fund-distributor", "cw-hooks 2.6.0", "cw-multi-test", "cw-payroll-factory", diff --git a/contracts/distribution/cw-fund-distributor/Cargo.toml b/contracts/distribution/cw-fund-distributor/Cargo.toml index 6d67b634d..2167dcbe2 100644 --- a/contracts/distribution/cw-fund-distributor/Cargo.toml +++ b/contracts/distribution/cw-fund-distributor/Cargo.toml @@ -30,7 +30,6 @@ dao-interface = { workspace = true } cw-paginate-storage = { workspace = true } [dev-dependencies] -cw-fund-distributor = { workspace = true } dao-dao-core = { workspace = true, features = ["library"] } dao-testing = { workspace = true } cw-multi-test = { workspace = true } diff --git a/contracts/distribution/cw-fund-distributor/src/testing/adversarial_tests.rs b/contracts/distribution/cw-fund-distributor/src/testing/adversarial_tests.rs index cc0e0c865..4f3c2591e 100644 --- a/contracts/distribution/cw-fund-distributor/src/testing/adversarial_tests.rs +++ b/contracts/distribution/cw-fund-distributor/src/testing/adversarial_tests.rs @@ -5,10 +5,11 @@ use cw20::{BalanceResponse, Cw20Coin}; use cw_multi_test::{next_block, App, BankSudo, Executor, SudoMsg}; use cw_utils::Duration; use dao_testing::contracts::{ - cw20_base_contract, cw20_stake_contract, cw_fund_distributor_contract, - dao_voting_cw20_staked_contract, + cw20_base_contract, cw20_stake_contract, dao_voting_cw20_staked_contract, }; +use super::cw_fund_distributor_contract; + const CREATOR_ADDR: &str = "creator"; const FEE_DENOM: &str = "ujuno"; diff --git a/contracts/distribution/cw-fund-distributor/src/testing/mod.rs b/contracts/distribution/cw-fund-distributor/src/testing/mod.rs index 9f1e9f269..281075c7d 100644 --- a/contracts/distribution/cw-fund-distributor/src/testing/mod.rs +++ b/contracts/distribution/cw-fund-distributor/src/testing/mod.rs @@ -1,2 +1,15 @@ +use cosmwasm_std::Empty; +use cw_multi_test::{Contract, ContractWrapper}; + mod adversarial_tests; mod tests; + +pub fn cw_fund_distributor_contract() -> Box> { + let contract = ContractWrapper::new( + crate::contract::execute, + crate::contract::instantiate, + crate::contract::query, + ) + .with_migrate(crate::contract::migrate); + Box::new(contract) +} diff --git a/contracts/distribution/cw-fund-distributor/src/testing/tests.rs b/contracts/distribution/cw-fund-distributor/src/testing/tests.rs index d86ca86a0..504fc7157 100644 --- a/contracts/distribution/cw-fund-distributor/src/testing/tests.rs +++ b/contracts/distribution/cw-fund-distributor/src/testing/tests.rs @@ -2,13 +2,12 @@ use crate::msg::{ CW20EntitlementResponse, CW20Response, DenomResponse, ExecuteMsg, InstantiateMsg, MigrateMsg, NativeEntitlementResponse, QueryMsg, TotalPowerResponse, VotingContractResponse, }; +use crate::ContractError; use cosmwasm_std::{to_json_binary, Addr, Binary, Coin, Uint128, WasmMsg}; use cw20::Cw20Coin; -use cw_fund_distributor::ContractError; use cw_multi_test::{next_block, App, BankSudo, Executor, SudoMsg}; use dao_testing::contracts::{ - cw20_base_contract, cw20_stake_contract, cw_fund_distributor_contract, - dao_voting_cw20_staked_contract, + cw20_base_contract, cw20_stake_contract, dao_voting_cw20_staked_contract, }; use crate::msg::ExecuteMsg::{ClaimAll, ClaimCW20, ClaimNatives}; @@ -16,6 +15,8 @@ use crate::msg::QueryMsg::TotalPower; use cosmwasm_std::StdError::GenericErr; use cw_utils::Duration; +use super::cw_fund_distributor_contract; + const CREATOR_ADDR: &str = "creator"; const FEE_DENOM: &str = "ujuno"; diff --git a/packages/dao-testing/Cargo.toml b/packages/dao-testing/Cargo.toml index 46429de16..374a7f16f 100644 --- a/packages/dao-testing/Cargo.toml +++ b/packages/dao-testing/Cargo.toml @@ -42,7 +42,6 @@ serde_json = { workspace = true } btsg-ft-factory = { workspace = true } cw-admin-factory = { workspace = true } -cw-fund-distributor = { workspace = true } cw-hooks = { workspace = true } cw-payroll-factory = { workspace = true } cw-token-swap = { workspace = true } diff --git a/packages/dao-testing/src/contracts/latest.rs b/packages/dao-testing/src/contracts/latest.rs index 1bbc8aefd..cc694f2c4 100644 --- a/packages/dao-testing/src/contracts/latest.rs +++ b/packages/dao-testing/src/contracts/latest.rs @@ -244,16 +244,6 @@ pub fn dao_test_custom_factory_contract() -> Box> { Box::new(contract) } -pub fn cw_fund_distributor_contract() -> Box> { - let contract = ContractWrapper::new( - cw_fund_distributor::contract::execute, - cw_fund_distributor::contract::instantiate, - cw_fund_distributor::contract::query, - ) - .with_migrate(cw_fund_distributor::contract::migrate); - Box::new(contract) -} - pub fn dao_rewards_distributor_contract() -> Box> { let contract = ContractWrapper::new( dao_rewards_distributor::contract::execute, diff --git a/scripts/publish.sh b/scripts/publish.sh index aa5e3c973..a6f18a6f2 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -204,11 +204,6 @@ cd contracts/external/cw-admin-factory cargo hack publish --no-dev-deps --allow-dirty cd "$START_DIR" -# TODO: uncomment once cleaned up and audited -# cd contracts/distribution/cw-fund-distributor -# cargo hack publish --no-dev-deps --allow-dirty -# cd "$START_DIR" - cd contracts/distribution/dao-rewards-distributor cargo hack publish --no-dev-deps --allow-dirty cd "$START_DIR"