From 106b2fcc04187edd5a79a0b2f89a180ee5f58cd1 Mon Sep 17 00:00:00 2001 From: Joe Monem <66594578+joemonem@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:16:28 +0200 Subject: [PATCH] ref: Fixed Amount Splitter rename (#754) --- CHANGELOG.md | 1 + Cargo.lock | 38 +++++++++---------- .../.cargo/config | 0 .../.gitignore | 0 .../Cargo.toml | 2 +- .../examples/schema.rs | 2 +- .../src/contract.rs | 4 +- .../src/interface.rs | 10 +++++ .../src/lib.rs | 2 +- .../src/mock.rs | 24 ++++++------ .../src/state.rs | 4 ++ .../src/testing/mock_querier.rs | 0 .../src/testing/mod.rs | 0 .../src/testing/tests.rs | 2 +- .../src/interface.rs | 10 ----- .../src/state.rs | 4 -- ...t_splitter.rs => fixed_amount_splitter.rs} | 0 packages/andromeda-finance/src/lib.rs | 2 +- packages/deploy/Cargo.toml | 2 +- packages/deploy/src/contracts.rs | 6 +-- tests-integration/Cargo.toml | 4 +- ...t_splitter.rs => fixed_amount_splitter.rs} | 29 +++++++------- tests-integration/tests/mod.rs | 2 +- tests-integration/tests/splitter.rs | 8 ++-- 24 files changed, 81 insertions(+), 75 deletions(-) rename contracts/finance/{andromeda-set-amount-splitter => andromeda-fixed-amount-splitter}/.cargo/config (100%) rename contracts/finance/{andromeda-set-amount-splitter => andromeda-fixed-amount-splitter}/.gitignore (100%) rename contracts/finance/{andromeda-set-amount-splitter => andromeda-fixed-amount-splitter}/Cargo.toml (95%) rename contracts/finance/{andromeda-set-amount-splitter => andromeda-fixed-amount-splitter}/examples/schema.rs (65%) rename contracts/finance/{andromeda-set-amount-splitter => andromeda-fixed-amount-splitter}/src/contract.rs (99%) create mode 100644 contracts/finance/andromeda-fixed-amount-splitter/src/interface.rs rename contracts/finance/{andromeda-set-amount-splitter => andromeda-fixed-amount-splitter}/src/lib.rs (80%) rename contracts/finance/{andromeda-set-amount-splitter => andromeda-fixed-amount-splitter}/src/mock.rs (74%) create mode 100644 contracts/finance/andromeda-fixed-amount-splitter/src/state.rs rename contracts/finance/{andromeda-set-amount-splitter => andromeda-fixed-amount-splitter}/src/testing/mock_querier.rs (100%) rename contracts/finance/{andromeda-set-amount-splitter => andromeda-fixed-amount-splitter}/src/testing/mod.rs (100%) rename contracts/finance/{andromeda-set-amount-splitter => andromeda-fixed-amount-splitter}/src/testing/tests.rs (99%) delete mode 100644 contracts/finance/andromeda-set-amount-splitter/src/interface.rs delete mode 100644 contracts/finance/andromeda-set-amount-splitter/src/state.rs rename packages/andromeda-finance/src/{set_amount_splitter.rs => fixed_amount_splitter.rs} (100%) rename tests-integration/tests/{set_amount_splitter.rs => fixed_amount_splitter.rs} (88%) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebd139cc7..0c8e2711e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Address Validation: Cross-chain recipients don't need to be registered in VFS [(#725)](https://github.com/andromedaprotocol/andromeda-core/pull/725) - Weighted Splitter: Replace Recipient with AndrAddr in RemoveRecipient and GetUserWeight [(#739)](https://github.com/andromedaprotocol/andromeda-core/pull/739) - feat: IBC packet tracking adjustments [#748](https://github.com/andromedaprotocol/andromeda-core/pull/748) +- ref: Rename Set Amount Splitter to Fixed Amount Splitter [(#754)](https://github.com/andromedaprotocol/andromeda-core/pull/754) ### Fixed diff --git a/Cargo.lock b/Cargo.lock index 3e9d5f67c..fddba25cb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -384,6 +384,7 @@ dependencies = [ "andromeda-date-time", "andromeda-distance", "andromeda-economics", + "andromeda-fixed-amount-splitter", "andromeda-graph", "andromeda-ibc-registry", "andromeda-kernel", @@ -395,7 +396,6 @@ dependencies = [ "andromeda-primitive", "andromeda-rate-limiting-withdrawals", "andromeda-rates", - "andromeda-set-amount-splitter", "andromeda-shunting", "andromeda-splitter", "andromeda-std", @@ -497,6 +497,23 @@ dependencies = [ "serde", ] +[[package]] +name = "andromeda-fixed-amount-splitter" +version = "1.2.0-b.1" +dependencies = [ + "andromeda-app", + "andromeda-finance", + "andromeda-std", + "andromeda-testing", + "cosmwasm-schema", + "cosmwasm-std", + "cw-multi-test", + "cw-orch", + "cw-storage-plus 1.2.0", + "cw-utils 1.0.3", + "cw20", +] + [[package]] name = "andromeda-fixed-multisig" version = "0.1.0-b.1" @@ -831,23 +848,6 @@ dependencies = [ "test-case", ] -[[package]] -name = "andromeda-set-amount-splitter" -version = "1.2.0-b.1" -dependencies = [ - "andromeda-app", - "andromeda-finance", - "andromeda-std", - "andromeda-testing", - "cosmwasm-schema", - "cosmwasm-std", - "cw-multi-test", - "cw-orch", - "cw-storage-plus 1.2.0", - "cw-utils 1.0.3", - "cw20", -] - [[package]] name = "andromeda-shunting" version = "0.1.0-b.1" @@ -5101,6 +5101,7 @@ dependencies = [ "andromeda-economics", "andromeda-ecosystem", "andromeda-finance", + "andromeda-fixed-amount-splitter", "andromeda-fungible-tokens", "andromeda-ibc-registry", "andromeda-kernel", @@ -5111,7 +5112,6 @@ dependencies = [ "andromeda-non-fungible-tokens", "andromeda-primitive", "andromeda-rates", - "andromeda-set-amount-splitter", "andromeda-shunting", "andromeda-splitter", "andromeda-std", diff --git a/contracts/finance/andromeda-set-amount-splitter/.cargo/config b/contracts/finance/andromeda-fixed-amount-splitter/.cargo/config similarity index 100% rename from contracts/finance/andromeda-set-amount-splitter/.cargo/config rename to contracts/finance/andromeda-fixed-amount-splitter/.cargo/config diff --git a/contracts/finance/andromeda-set-amount-splitter/.gitignore b/contracts/finance/andromeda-fixed-amount-splitter/.gitignore similarity index 100% rename from contracts/finance/andromeda-set-amount-splitter/.gitignore rename to contracts/finance/andromeda-fixed-amount-splitter/.gitignore diff --git a/contracts/finance/andromeda-set-amount-splitter/Cargo.toml b/contracts/finance/andromeda-fixed-amount-splitter/Cargo.toml similarity index 95% rename from contracts/finance/andromeda-set-amount-splitter/Cargo.toml rename to contracts/finance/andromeda-fixed-amount-splitter/Cargo.toml index 48f2f415f..7c823df1c 100644 --- a/contracts/finance/andromeda-set-amount-splitter/Cargo.toml +++ b/contracts/finance/andromeda-fixed-amount-splitter/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "andromeda-set-amount-splitter" +name = "andromeda-fixed-amount-splitter" version = "1.2.0-b.1" edition = "2021" rust-version = "1.75.0" diff --git a/contracts/finance/andromeda-set-amount-splitter/examples/schema.rs b/contracts/finance/andromeda-fixed-amount-splitter/examples/schema.rs similarity index 65% rename from contracts/finance/andromeda-set-amount-splitter/examples/schema.rs rename to contracts/finance/andromeda-fixed-amount-splitter/examples/schema.rs index fb68c826a..4d5a63aad 100644 --- a/contracts/finance/andromeda-set-amount-splitter/examples/schema.rs +++ b/contracts/finance/andromeda-fixed-amount-splitter/examples/schema.rs @@ -1,4 +1,4 @@ -use andromeda_finance::splitter::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_finance::fixed_amount_splitter::{ExecuteMsg, InstantiateMsg, QueryMsg}; use cosmwasm_schema::write_api; fn main() { diff --git a/contracts/finance/andromeda-set-amount-splitter/src/contract.rs b/contracts/finance/andromeda-fixed-amount-splitter/src/contract.rs similarity index 99% rename from contracts/finance/andromeda-set-amount-splitter/src/contract.rs rename to contracts/finance/andromeda-fixed-amount-splitter/src/contract.rs index 7cff6d2e3..de1dfa65d 100644 --- a/contracts/finance/andromeda-set-amount-splitter/src/contract.rs +++ b/contracts/finance/andromeda-fixed-amount-splitter/src/contract.rs @@ -2,7 +2,7 @@ use std::collections::HashSet; use crate::state::SPLITTER; use andromeda_finance::{ - set_amount_splitter::{ + fixed_amount_splitter::{ validate_recipient_list, AddressAmount, Cw20HookMsg, ExecuteMsg, GetSplitterConfigResponse, InstantiateMsg, QueryMsg, Splitter, }, @@ -23,7 +23,7 @@ use cw20::{Cw20Coin, Cw20ReceiveMsg}; use cw_utils::nonpayable; // version info for migration info -const CONTRACT_NAME: &str = "crates.io:andromeda-set-amount-splitter"; +const CONTRACT_NAME: &str = "crates.io:andromeda-fixed-amount-splitter"; const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); // 1 day in seconds const ONE_DAY: u64 = 86_400; diff --git a/contracts/finance/andromeda-fixed-amount-splitter/src/interface.rs b/contracts/finance/andromeda-fixed-amount-splitter/src/interface.rs new file mode 100644 index 000000000..7377aa1fc --- /dev/null +++ b/contracts/finance/andromeda-fixed-amount-splitter/src/interface.rs @@ -0,0 +1,10 @@ +use andromeda_finance::fixed_amount_splitter::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "fixed-amount-splitter"; + +contract_interface!( + FixedAmountSplitterContract, + CONTRACT_ID, + "andromeda_fixed_amount_splitter.wasm" +); diff --git a/contracts/finance/andromeda-set-amount-splitter/src/lib.rs b/contracts/finance/andromeda-fixed-amount-splitter/src/lib.rs similarity index 80% rename from contracts/finance/andromeda-set-amount-splitter/src/lib.rs rename to contracts/finance/andromeda-fixed-amount-splitter/src/lib.rs index 5b3e5f3cc..e31610ac4 100644 --- a/contracts/finance/andromeda-set-amount-splitter/src/lib.rs +++ b/contracts/finance/andromeda-fixed-amount-splitter/src/lib.rs @@ -10,4 +10,4 @@ mod testing; #[cfg(not(target_arch = "wasm32"))] mod interface; #[cfg(not(target_arch = "wasm32"))] -pub use crate::interface::SetAmountSplitterContract; +pub use crate::interface::FixedAmountSplitterContract; diff --git a/contracts/finance/andromeda-set-amount-splitter/src/mock.rs b/contracts/finance/andromeda-fixed-amount-splitter/src/mock.rs similarity index 74% rename from contracts/finance/andromeda-set-amount-splitter/src/mock.rs rename to contracts/finance/andromeda-fixed-amount-splitter/src/mock.rs index 0114e8f29..7d1ca5cd5 100644 --- a/contracts/finance/andromeda-set-amount-splitter/src/mock.rs +++ b/contracts/finance/andromeda-fixed-amount-splitter/src/mock.rs @@ -1,7 +1,9 @@ #![cfg(all(not(target_arch = "wasm32"), feature = "testing"))] use crate::contract::{execute, instantiate, query, reply}; -use andromeda_finance::set_amount_splitter::{AddressAmount, ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_finance::fixed_amount_splitter::{ + AddressAmount, ExecuteMsg, InstantiateMsg, QueryMsg, +}; use andromeda_std::{amp::Recipient, common::expiration::Expiry}; use andromeda_testing::{ mock::MockApp, mock_ado, mock_contract::ExecuteResult, MockADO, MockContract, @@ -9,10 +11,10 @@ use andromeda_testing::{ use cosmwasm_std::{Addr, Coin, Empty}; use cw_multi_test::{Contract, ContractWrapper, Executor}; -pub struct MockSetAmountSplitter(Addr); -mock_ado!(MockSetAmountSplitter, ExecuteMsg, QueryMsg); +pub struct MockFixedAmountSplitter(Addr); +mock_ado!(MockFixedAmountSplitter, ExecuteMsg, QueryMsg); -impl MockSetAmountSplitter { +impl MockFixedAmountSplitter { #[allow(clippy::too_many_arguments)] pub fn instantiate( app: &mut MockApp, @@ -24,7 +26,7 @@ impl MockSetAmountSplitter { owner: Option, default_recipient: Option, ) -> Self { - let msg = mock_set_amount_splitter_instantiate_msg( + let msg = mock_fixed_amount_splitter_instantiate_msg( recipients, kernel_address, lock_time, @@ -43,7 +45,7 @@ impl MockSetAmountSplitter { funds: &[Coin], config: Option>, ) -> ExecuteResult { - let msg = mock_set_amount_splitter_send_msg(config); + let msg = mock_fixed_amount_splitter_send_msg(config); self.execute(app, &msg, sender, funds) } @@ -55,18 +57,18 @@ impl MockSetAmountSplitter { funds: &[Coin], recipients: Vec, ) -> ExecuteResult { - let msg = mock_set_amount_splitter_update_recipients_msg(recipients); + let msg = mock_fixed_amount_splitter_update_recipients_msg(recipients); self.execute(app, &msg, sender, funds) } } -pub fn mock_andromeda_set_amount_splitter() -> Box> { +pub fn mock_andromeda_fixed_amount_splitter() -> Box> { let contract = ContractWrapper::new_with_empty(execute, instantiate, query).with_reply(reply); Box::new(contract) } -pub fn mock_set_amount_splitter_instantiate_msg( +pub fn mock_fixed_amount_splitter_instantiate_msg( recipients: Vec, kernel_address: impl Into, lock_time: Option, @@ -82,11 +84,11 @@ pub fn mock_set_amount_splitter_instantiate_msg( } } -pub fn mock_set_amount_splitter_send_msg(config: Option>) -> ExecuteMsg { +pub fn mock_fixed_amount_splitter_send_msg(config: Option>) -> ExecuteMsg { ExecuteMsg::Send { config } } -pub fn mock_set_amount_splitter_update_recipients_msg( +pub fn mock_fixed_amount_splitter_update_recipients_msg( recipients: Vec, ) -> ExecuteMsg { ExecuteMsg::UpdateRecipients { recipients } diff --git a/contracts/finance/andromeda-fixed-amount-splitter/src/state.rs b/contracts/finance/andromeda-fixed-amount-splitter/src/state.rs new file mode 100644 index 000000000..80858ca36 --- /dev/null +++ b/contracts/finance/andromeda-fixed-amount-splitter/src/state.rs @@ -0,0 +1,4 @@ +use andromeda_finance::fixed_amount_splitter::Splitter; +use cw_storage_plus::Item; + +pub const SPLITTER: Item = Item::new("fixed-amount-splitter"); diff --git a/contracts/finance/andromeda-set-amount-splitter/src/testing/mock_querier.rs b/contracts/finance/andromeda-fixed-amount-splitter/src/testing/mock_querier.rs similarity index 100% rename from contracts/finance/andromeda-set-amount-splitter/src/testing/mock_querier.rs rename to contracts/finance/andromeda-fixed-amount-splitter/src/testing/mock_querier.rs diff --git a/contracts/finance/andromeda-set-amount-splitter/src/testing/mod.rs b/contracts/finance/andromeda-fixed-amount-splitter/src/testing/mod.rs similarity index 100% rename from contracts/finance/andromeda-set-amount-splitter/src/testing/mod.rs rename to contracts/finance/andromeda-fixed-amount-splitter/src/testing/mod.rs diff --git a/contracts/finance/andromeda-set-amount-splitter/src/testing/tests.rs b/contracts/finance/andromeda-fixed-amount-splitter/src/testing/tests.rs similarity index 99% rename from contracts/finance/andromeda-set-amount-splitter/src/testing/tests.rs rename to contracts/finance/andromeda-fixed-amount-splitter/src/testing/tests.rs index bdb3afe79..2b1f34ecb 100644 --- a/contracts/finance/andromeda-set-amount-splitter/src/testing/tests.rs +++ b/contracts/finance/andromeda-fixed-amount-splitter/src/testing/tests.rs @@ -21,7 +21,7 @@ use crate::{ state::SPLITTER, testing::mock_querier::mock_dependencies_custom, }; -use andromeda_finance::set_amount_splitter::{ +use andromeda_finance::fixed_amount_splitter::{ AddressAmount, ExecuteMsg, GetSplitterConfigResponse, InstantiateMsg, QueryMsg, Splitter, }; diff --git a/contracts/finance/andromeda-set-amount-splitter/src/interface.rs b/contracts/finance/andromeda-set-amount-splitter/src/interface.rs deleted file mode 100644 index a2a98b36a..000000000 --- a/contracts/finance/andromeda-set-amount-splitter/src/interface.rs +++ /dev/null @@ -1,10 +0,0 @@ -use andromeda_finance::set_amount_splitter::{ExecuteMsg, InstantiateMsg, QueryMsg}; -use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; - -pub const CONTRACT_ID: &str = "set-amount-splitter"; - -contract_interface!( - SetAmountSplitterContract, - CONTRACT_ID, - "andromeda_set_amount_splitter.wasm" -); diff --git a/contracts/finance/andromeda-set-amount-splitter/src/state.rs b/contracts/finance/andromeda-set-amount-splitter/src/state.rs deleted file mode 100644 index e6398d3c8..000000000 --- a/contracts/finance/andromeda-set-amount-splitter/src/state.rs +++ /dev/null @@ -1,4 +0,0 @@ -use andromeda_finance::set_amount_splitter::Splitter; -use cw_storage_plus::Item; - -pub const SPLITTER: Item = Item::new("set-amount-splitter"); diff --git a/packages/andromeda-finance/src/set_amount_splitter.rs b/packages/andromeda-finance/src/fixed_amount_splitter.rs similarity index 100% rename from packages/andromeda-finance/src/set_amount_splitter.rs rename to packages/andromeda-finance/src/fixed_amount_splitter.rs diff --git a/packages/andromeda-finance/src/lib.rs b/packages/andromeda-finance/src/lib.rs index dabe894a2..56d491298 100644 --- a/packages/andromeda-finance/src/lib.rs +++ b/packages/andromeda-finance/src/lib.rs @@ -1,7 +1,7 @@ pub mod conditional_splitter; pub mod cross_chain_swap; +pub mod fixed_amount_splitter; pub mod rate_limiting_withdrawals; -pub mod set_amount_splitter; pub mod splitter; pub mod timelock; pub mod validator_staking; diff --git a/packages/deploy/Cargo.toml b/packages/deploy/Cargo.toml index 6d66a2230..909574514 100644 --- a/packages/deploy/Cargo.toml +++ b/packages/deploy/Cargo.toml @@ -49,7 +49,7 @@ andromeda-vesting = { path = "../../contracts/finance/andromeda-vesting" } andromeda-timelock = { path = "../../contracts/finance/andromeda-timelock" } andromeda-conditional-splitter = { path = "../../contracts/finance/andromeda-conditional-splitter" } andromeda-rate-limiting-withdrawals = { path = "../../contracts/finance/andromeda-rate-limiting-withdrawals" } -andromeda-set-amount-splitter = { path = "../../contracts/finance/andromeda-set-amount-splitter" } +andromeda-fixed-amount-splitter = { path = "../../contracts/finance/andromeda-fixed-amount-splitter" } andromeda-weighted-distribution-splitter = { path = "../../contracts/finance/andromeda-weighted-distribution-splitter" } # Data Storage Contracts diff --git a/packages/deploy/src/contracts.rs b/packages/deploy/src/contracts.rs index fc723ef37..057f8320f 100644 --- a/packages/deploy/src/contracts.rs +++ b/packages/deploy/src/contracts.rs @@ -13,16 +13,17 @@ use andromeda_cw20_staking::CW20StakingContract; use andromeda_cw721::CW721Contract; use andromeda_distance::DistanceContract; use andromeda_economics::EconomicsContract; +use andromeda_fixed_amount_splitter::FixedAmountSplitterContract; use andromeda_graph::GraphContract; use andromeda_ibc_registry::IBCRegistryContract; use andromeda_kernel::KernelContract; use andromeda_lockdrop::LockdropContract; use andromeda_marketplace::MarketplaceContract; use andromeda_merkle_airdrop::MerkleAirdropContract; +use andromeda_point::PointContract; use andromeda_primitive::PrimitiveContract; use andromeda_rate_limiting_withdrawals::RateLimitingWithdrawalsContract; use andromeda_rates::RatesContract; -use andromeda_set_amount_splitter::SetAmountSplitterContract; use andromeda_shunting::ShuntingContract; use andromeda_splitter::SplitterContract; use andromeda_std::deploy::ADOMetadata; @@ -32,7 +33,6 @@ use andromeda_validator_staking::ValidatorStakingContract; use andromeda_vesting::VestingContract; use andromeda_vfs::VFSContract; use andromeda_weighted_distribution_splitter::WeightedDistributionSplitterContract; -use andromeda_point::PointContract; use cw_orch::prelude::*; use cw_orch_daemon::{DaemonBase, Wallet}; @@ -71,7 +71,7 @@ pub fn all_contracts() -> Vec { deployable!(StringStorageContract), deployable!(ConditionalSplitterContract), deployable!(RateLimitingWithdrawalsContract), - deployable!(SetAmountSplitterContract), + deployable!(FixedAmountSplitterContract), deployable!(WeightedDistributionSplitterContract), deployable!(Cw20ExchangeContract), deployable!(LockdropContract), diff --git a/tests-integration/Cargo.toml b/tests-integration/Cargo.toml index d81c29190..ba745c4f8 100644 --- a/tests-integration/Cargo.toml +++ b/tests-integration/Cargo.toml @@ -68,7 +68,7 @@ andromeda-finance = { workspace = true } andromeda-splitter = { path = "../contracts/finance/andromeda-splitter", features = [ "testing", ] } -andromeda-set-amount-splitter = { path = "../contracts/finance/andromeda-set-amount-splitter", features = [ +andromeda-fixed-amount-splitter = { path = "../contracts/finance/andromeda-fixed-amount-splitter", features = [ "testing", ] } andromeda-conditional-splitter = { path = "../contracts/finance/andromeda-conditional-splitter", features = [ @@ -177,7 +177,7 @@ rstest = { workspace = true } # name = "kernel" [[test]] -name = "set_amount_splitter" +name = "fixed_amount_splitter" [[test]] name = "cw20_staking" diff --git a/tests-integration/tests/set_amount_splitter.rs b/tests-integration/tests/fixed_amount_splitter.rs similarity index 88% rename from tests-integration/tests/set_amount_splitter.rs rename to tests-integration/tests/fixed_amount_splitter.rs index 80f222f72..54e908946 100644 --- a/tests-integration/tests/set_amount_splitter.rs +++ b/tests-integration/tests/fixed_amount_splitter.rs @@ -11,10 +11,10 @@ use andromeda_testing::{ use andromeda_std::amp::Recipient; use cosmwasm_std::{coin, coins, to_json_binary, Coin, Empty, Uint128}; -use andromeda_finance::set_amount_splitter::{AddressAmount, Cw20HookMsg}; -use andromeda_set_amount_splitter::mock::{ - mock_andromeda_set_amount_splitter, mock_set_amount_splitter_instantiate_msg, - MockSetAmountSplitter, +use andromeda_finance::fixed_amount_splitter::{AddressAmount, Cw20HookMsg}; +use andromeda_fixed_amount_splitter::mock::{ + mock_andromeda_fixed_amount_splitter, mock_fixed_amount_splitter_instantiate_msg, + MockFixedAmountSplitter, }; use cw20::Cw20Coin; use cw_multi_test::Contract; @@ -23,7 +23,7 @@ use rstest::{fixture, rstest}; struct TestCase { router: MockApp, andr: MockAndromeda, - splitter: MockSetAmountSplitter, + splitter: MockFixedAmountSplitter, cw20: MockCW20, } @@ -40,7 +40,10 @@ fn wallets() -> Vec<(&'static str, Vec)> { fn contracts() -> Vec<(&'static str, Box>)> { vec![ ("cw20", mock_andromeda_cw20()), - ("set-amount-splitter", mock_andromeda_set_amount_splitter()), + ( + "fixed-amount-splitter", + mock_andromeda_fixed_amount_splitter(), + ), ("app-contract", mock_andromeda_app()), ] } @@ -74,7 +77,7 @@ fn setup( coins: coins(100, "uandr"), }, ]; - let splitter_init_msg = mock_set_amount_splitter_instantiate_msg( + let splitter_init_msg = mock_fixed_amount_splitter_instantiate_msg( splitter_recipients, andr.kernel.addr().clone(), None, @@ -82,8 +85,8 @@ fn setup( None, ); let splitter_component = AppComponent::new( - "set-amount-splitter".to_string(), - "set-amount-splitter".to_string(), + "fixed-amount-splitter".to_string(), + "fixed-amount-splitter".to_string(), to_json_binary(&splitter_init_msg).unwrap(), ); @@ -127,7 +130,7 @@ fn setup( Some(owner.to_string()), ); - let splitter: MockSetAmountSplitter = + let splitter: MockFixedAmountSplitter = app.query_ado_by_component_name(&router, splitter_component.name); let cw20: MockCW20 = app.query_ado_by_component_name(&router, cw20_component.name); @@ -159,7 +162,7 @@ fn setup( } #[rstest] -fn test_successful_set_amount_splitter_native(setup: TestCase) { +fn test_successful_fixed_amount_splitter_native(setup: TestCase) { let TestCase { mut router, andr, @@ -192,7 +195,7 @@ fn test_successful_set_amount_splitter_native(setup: TestCase) { } #[rstest] -fn test_successful_set_amount_splitter_cw20_with_remainder(#[with(false)] setup: TestCase) { +fn test_successful_fixed_amount_splitter_cw20_with_remainder(#[with(false)] setup: TestCase) { let TestCase { mut router, andr, @@ -222,7 +225,7 @@ fn test_successful_set_amount_splitter_cw20_with_remainder(#[with(false)] setup: } #[rstest] -fn test_successful_set_amount_splitter_cw20_without_remainder(#[with(false)] setup: TestCase) { +fn test_successful_fixed_amount_splitter_cw20_without_remainder(#[with(false)] setup: TestCase) { let TestCase { mut router, andr, diff --git a/tests-integration/tests/mod.rs b/tests-integration/tests/mod.rs index 329bce17a..d1224d6b4 100644 --- a/tests-integration/tests/mod.rs +++ b/tests-integration/tests/mod.rs @@ -26,7 +26,7 @@ mod validator_staking; mod cw20_app; #[cfg(test)] -mod set_amount_splitter; +mod fixed_amount_splitter; #[cfg(test)] mod shunting; diff --git a/tests-integration/tests/splitter.rs b/tests-integration/tests/splitter.rs index 73ae7d711..5fb837995 100644 --- a/tests-integration/tests/splitter.rs +++ b/tests-integration/tests/splitter.rs @@ -148,7 +148,7 @@ fn setup( } #[rstest] -fn test_successful_set_amount_splitter_without_remainder_native(setup: TestCase) { +fn test_successful_fixed_amount_splitter_without_remainder_native(setup: TestCase) { let TestCase { mut router, andr, @@ -181,7 +181,7 @@ fn test_successful_set_amount_splitter_without_remainder_native(setup: TestCase) } #[rstest] -fn test_successful_set_amount_splitter_with_remainder_native(setup: TestCase) { +fn test_successful_fixed_amount_splitter_with_remainder_native(setup: TestCase) { let TestCase { mut router, andr, @@ -237,7 +237,7 @@ fn test_successful_set_amount_splitter_with_remainder_native(setup: TestCase) { } #[rstest] -fn test_successful_set_amount_splitter_cw20_without_remainder(setup: TestCase) { +fn test_successful_fixed_amount_splitter_cw20_without_remainder(setup: TestCase) { let TestCase { mut router, andr, @@ -267,7 +267,7 @@ fn test_successful_set_amount_splitter_cw20_without_remainder(setup: TestCase) { } #[rstest] -fn test_successful_set_amount_splitter_cw20_with_remainder(setup: TestCase) { +fn test_successful_fixed_amount_splitter_cw20_with_remainder(setup: TestCase) { let TestCase { mut router, andr,