From 63dfac6390ac70a740b68d43e2ba934e0dbc095f Mon Sep 17 00:00:00 2001 From: wc117 Date: Fri, 27 Sep 2024 02:19:09 +0800 Subject: [PATCH 1/3] update rust version --- .github/workflows/Basic.yml | 4 ++-- .github/workflows/codecov.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Basic.yml b/.github/workflows/Basic.yml index 9c3351e..a94640f 100644 --- a/.github/workflows/Basic.yml +++ b/.github/workflows/Basic.yml @@ -16,7 +16,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.70.0 + toolchain: stable target: wasm32-unknown-unknown override: true @@ -39,7 +39,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.70.0 + toolchain: stable override: true components: rustfmt, clippy diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index e1734e3..4271ca5 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -19,7 +19,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.70.0 + toolchain: stable target: wasm32-unknown-unknown override: true From ed7c9a925a4fe2da65fecdb497950ba0c1a6c701 Mon Sep 17 00:00:00 2001 From: wc117 Date: Fri, 27 Sep 2024 02:56:52 +0800 Subject: [PATCH 2/3] lit fix --- contracts/pair/src/testing.rs | 10 +++++----- .../pair_lsd/src/multitest/target_rate.rs | 4 +--- contracts/pair_lsd/src/testing.rs | 10 +++++----- contracts/stake/src/multitest/distribution.rs | 18 +++++++++--------- .../stake/src/multitest/staking_rewards.rs | 12 ++++++------ 5 files changed, 26 insertions(+), 28 deletions(-) diff --git a/contracts/pair/src/testing.rs b/contracts/pair/src/testing.rs index a9380b4..440de8c 100644 --- a/contracts/pair/src/testing.rs +++ b/contracts/pair/src/testing.rs @@ -198,7 +198,7 @@ fn provide_liquidity() { }], ); let res = execute(deps.as_mut(), env.clone(), info, msg).unwrap(); - let transfer_from_msg = res.messages.get(0).expect("no message"); + let transfer_from_msg = res.messages.first().expect("no message"); let mint_min_liquidity_msg = res.messages.get(1).expect("no message"); let mint_receiver_msg = res.messages.get(2).expect("no message"); assert_eq!( @@ -310,7 +310,7 @@ fn provide_liquidity() { // Only accept 100, then 50 share will be generated with 100 * (100 / 200) let res: Response = execute(deps.as_mut(), env, info, msg).unwrap(); - let transfer_from_msg = res.messages.get(0).expect("no message"); + let transfer_from_msg = res.messages.first().expect("no message"); let mint_msg = res.messages.get(1).expect("no message"); assert_eq!( transfer_from_msg, @@ -658,7 +658,7 @@ fn withdraw_liquidity() { let res = execute(deps.as_mut(), env, info, msg).unwrap(); let log_withdrawn_share = res.attributes.get(2).expect("no log"); let log_refund_assets = res.attributes.get(3).expect("no log"); - let msg_refund_0 = res.messages.get(0).expect("no message"); + let msg_refund_0 = res.messages.first().expect("no message"); let msg_refund_1 = res.messages.get(1).expect("no message"); let msg_burn_liquidity = res.messages.get(2).expect("no message"); assert_eq!( @@ -959,7 +959,7 @@ fn try_native_to_token() { ); let res = execute(deps.as_mut(), env, info, msg).unwrap(); - let msg_transfer = res.messages.get(0).expect("no message"); + let msg_transfer = res.messages.first().expect("no message"); // Current price is 1.5, so expected return without spread is 1000 // 952380952 = 20000000000 - (30000000000 * 20000000000) / (30000000000 + 1500000000) @@ -1190,7 +1190,7 @@ fn try_token_to_native() { let info = mock_info("asset0000", &[]); let res = execute(deps.as_mut(), env, info, msg).unwrap(); - let msg_transfer = res.messages.get(0).expect("no message"); + let msg_transfer = res.messages.first().expect("no message"); // Current price is 1.5, so expected return without spread is 1000 // 952380952,3809524 = 20000000000 - (30000000000 * 20000000000) / (30000000000 + 1500000000) diff --git a/contracts/pair_lsd/src/multitest/target_rate.rs b/contracts/pair_lsd/src/multitest/target_rate.rs index d520412..d8a1d84 100644 --- a/contracts/pair_lsd/src/multitest/target_rate.rs +++ b/contracts/pair_lsd/src/multitest/target_rate.rs @@ -330,7 +330,7 @@ fn provide_liquidity_changing_rate() { #[test] fn changing_target_rate() { - let target_rate = Decimal::from_str("1.5").unwrap(); + let mut target_rate = Decimal::from_str("1.5").unwrap(); let mut suite = SuiteBuilder::new() .with_funds("sender", &[coin(1_000_000_000_000_000_000_000, "juno")]) .with_funds( @@ -370,7 +370,6 @@ fn changing_target_rate() { let max_target_rate = Decimal::from_str("1.6").unwrap(); let target_rate_step = Decimal::from_str("0.01").unwrap(); - let mut target_rate = target_rate; while target_rate < max_target_rate { // change target rate and wait for cache to expire target_rate += target_rate_step; @@ -409,7 +408,6 @@ fn changing_target_rate() { let min_target_rate = Decimal::from_str("1.4").unwrap(); let target_rate_step = Decimal::from_str("0.1").unwrap(); - let mut target_rate = target_rate; while target_rate > min_target_rate { // change target rate and wait for cache to expire target_rate -= target_rate_step; diff --git a/contracts/pair_lsd/src/testing.rs b/contracts/pair_lsd/src/testing.rs index 051e6db..9129af5 100644 --- a/contracts/pair_lsd/src/testing.rs +++ b/contracts/pair_lsd/src/testing.rs @@ -577,7 +577,7 @@ fn provide_liquidity() { }], ); let res = execute(deps.as_mut(), env.clone(), info, msg).unwrap(); - let transfer_from_msg = res.messages.get(0).expect("no message"); + let transfer_from_msg = res.messages.first().expect("no message"); let mint_min_liquidity_msg = res.messages.get(1).expect("no message"); let mint_receiver_msg = res.messages.get(2).expect("no message"); @@ -690,7 +690,7 @@ fn provide_liquidity() { ); let res: Response = execute(deps.as_mut(), env, info, msg).unwrap(); - let transfer_from_msg = res.messages.get(0).expect("no message"); + let transfer_from_msg = res.messages.first().expect("no message"); let mint_msg = res.messages.get(1).expect("no message"); assert_eq!( transfer_from_msg, @@ -945,7 +945,7 @@ fn withdraw_liquidity() { let res = execute(deps.as_mut(), env, info, msg).unwrap(); let log_withdrawn_share = res.attributes.get(2).expect("no log"); let log_refund_assets = res.attributes.get(3).expect("no log"); - let msg_refund_0 = res.messages.get(0).expect("no message"); + let msg_refund_0 = res.messages.first().expect("no message"); let msg_refund_1 = res.messages.get(1).expect("no message"); let msg_burn_liquidity = res.messages.get(2).expect("no message"); assert_eq!( @@ -1257,7 +1257,7 @@ mod disabled { ); let res = execute(deps.as_mut(), env.clone(), info, msg).unwrap(); - let msg_transfer = res.messages.get(0).expect("no message"); + let msg_transfer = res.messages.first().expect("no message"); let model: StableSwapModel = StableSwapModel::new( 100, @@ -1422,7 +1422,7 @@ mod disabled { let info = mock_info("asset0000", &[]); let res = execute(deps.as_mut(), env.clone(), info, msg).unwrap(); - let msg_transfer = res.messages.get(0).expect("no message"); + let msg_transfer = res.messages.first().expect("no message"); let model: StableSwapModel = StableSwapModel::new( 100, diff --git a/contracts/stake/src/multitest/distribution.rs b/contracts/stake/src/multitest/distribution.rs index 650a7f3..b3bd969 100644 --- a/contracts/stake/src/multitest/distribution.rs +++ b/contracts/stake/src/multitest/distribution.rs @@ -19,7 +19,7 @@ fn multiple_distribution_flows() { "member3".to_owned(), "member4".to_owned(), ]; - let bonds = vec![5_000u128, 10_000u128, 25_000u128]; + let bonds = [5_000u128, 10_000u128, 25_000u128]; let delegated: u128 = bonds.iter().sum(); let unbonding_period = 1000u64; @@ -203,7 +203,7 @@ fn mass_bond_with_multiple_distribution_flows() { ]; // this guy hodls the funds to mass bond to others let richie = "richie rich"; - let bonds = vec![5_000u128, 10_000u128, 25_000u128]; + let bonds = [5_000u128, 10_000u128, 25_000u128]; let delegated: u128 = bonds.iter().sum(); let unbonding_period = 1000u64; @@ -382,7 +382,7 @@ fn can_fund_an_inprogress_reward_period_with_more_funds_and_a_curve() { "member3".to_owned(), "member4".to_owned(), ]; - let bonds = vec![5_000u128, 10_000u128, 25_000u128]; + let bonds = [5_000u128, 10_000u128, 25_000u128]; let delegated: u128 = bonds.iter().sum(); let unbonding_period = 1000u64; @@ -521,7 +521,7 @@ fn partial_payouts_by_rate() { "member3".to_owned(), "member4".to_owned(), ]; - let bonds = vec![5_000u128, 10_000u128, 25_000u128]; + let bonds = [5_000u128, 10_000u128, 25_000u128]; let delegated: u128 = bonds.iter().sum(); let unbonding_period = 1000u64; @@ -691,7 +691,7 @@ fn divisible_amount_distributed_with_rate() { "member3".to_owned(), "member4".to_owned(), ]; - let bonds = vec![5_000u128, 10_000u128, 25_000u128]; + let bonds = [5_000u128, 10_000u128, 25_000u128]; let delegated: u128 = bonds.iter().sum(); let unbonding_period = 1000u64; @@ -1138,7 +1138,7 @@ fn apr_cw20() { #[test] fn simple_apr_simulation() { let distributor = "distributor"; - let members = vec!["member1", "member2"]; + let members = ["member1", "member2"]; let unbonding_periods = vec![1, 2, 3]; let stakes = [100_000_000u128, 200_000_000u128]; let rewards = 250_000_000u128; @@ -1218,7 +1218,7 @@ fn divisible_amount_distributed() { "member3".to_owned(), "member4".to_owned(), ]; - let bonds = vec![5_000u128, 10_000u128, 25_000u128]; + let bonds = [5_000u128, 10_000u128, 25_000u128]; let delegated: u128 = bonds.iter().sum(); let unbonding_period = 1000u64; @@ -1319,7 +1319,7 @@ fn divisible_amount_distributed_twice() { "member4".to_owned(), ]; - let bonds = vec![5_000u128, 10_000u128, 25_000u128]; + let bonds = [5_000u128, 10_000u128, 25_000u128]; let delegated: u128 = bonds.iter().sum(); let unbonding_period = 1000u64; @@ -1398,7 +1398,7 @@ fn divisible_amount_distributed_twice_accumulated() { "member4".to_owned(), ]; - let bonds = vec![5_000u128, 10_000u128, 25_000u128]; + let bonds = [5_000u128, 10_000u128, 25_000u128]; let unbonding_period = 1000u64; let mut suite = SuiteBuilder::new() diff --git a/contracts/stake/src/multitest/staking_rewards.rs b/contracts/stake/src/multitest/staking_rewards.rs index 4237910..15d94ac 100644 --- a/contracts/stake/src/multitest/staking_rewards.rs +++ b/contracts/stake/src/multitest/staking_rewards.rs @@ -72,7 +72,7 @@ fn one_user_multiple_unbonding_periods() { .with_initial_balances(vec![(user, 100_000)]) .build(); - let bonds = vec![20_000u128, 30_000u128, 10_000u128]; + let bonds = [20_000u128, 30_000u128, 10_000u128]; let delegated: u128 = bonds.iter().sum(); suite.delegate(user, bonds[0], unbonding_period1).unwrap(); @@ -160,7 +160,7 @@ fn one_user_multiple_periods_rebond_then_bond() { ) .unwrap(); - let bonds = vec![20_000u128, 30_000u128, 10_000u128]; + let bonds = [20_000u128, 30_000u128, 10_000u128]; let delegated: u128 = bonds.iter().sum(); suite.delegate(user, bonds[0], unbonding_period1).unwrap(); @@ -318,7 +318,7 @@ fn one_user_multiple_periods_rebond_fail() { .with_initial_balances(vec![(user, 100_000)]) .build(); - let bonds = vec![20_000u128, 30_000u128, 10_000u128]; + let bonds = [20_000u128, 30_000u128, 10_000u128]; let delegated: u128 = bonds.iter().sum(); suite.delegate(user, bonds[0], unbonding_period1).unwrap(); @@ -368,7 +368,7 @@ fn multiple_users_multiple_unbonding_periods() { let unbonding_period2 = 4000u64; let unbonding_period3 = 8000u64; - let bonds = vec![20_000u128, 30_000u128, 10_000u128, 16_000u128, 6_000u128]; + let bonds = [20_000u128, 30_000u128, 10_000u128, 16_000u128, 6_000u128]; let delegated: u128 = bonds.iter().sum(); let members = ["user1", "user2", "user3"]; @@ -446,7 +446,7 @@ fn one_user_rebond_decrease() { .with_initial_balances(vec![(user, 100_000)]) .build(); - let bonds = vec![20_000u128, 30_000u128, 10_000u128]; + let bonds = [20_000u128, 30_000u128, 10_000u128]; let delegated: u128 = bonds.iter().sum(); suite.delegate(user, bonds[0], unbonding_period1).unwrap(); @@ -593,7 +593,7 @@ fn one_user_rebond_decrease_then_rebond_again() { .with_initial_balances(vec![(user, 100_000)]) .build(); - let bonds = vec![20_000u128, 30_000u128, 10_000u128]; + let bonds = [20_000u128, 30_000u128, 10_000u128]; let delegated: u128 = bonds.iter().sum(); suite.delegate(user, bonds[0], unbonding_period1).unwrap(); From af4621514054af3b5d270b998974156c93920e07 Mon Sep 17 00:00:00 2001 From: wc117 Date: Fri, 27 Sep 2024 04:00:37 +0800 Subject: [PATCH 3/3] lint fix --- contracts/factory/src/contract.rs | 6 ++-- contracts/factory/tests/factory_helper.rs | 6 +--- .../gauge-adapter/src/multitest/suite.rs | 2 -- contracts/lp-converter/src/multitest/suite.rs | 4 --- contracts/multi-hop/src/contract.rs | 4 +-- contracts/multi-hop/src/msg.rs | 2 +- contracts/pair/src/contract.rs | 18 +++++----- contracts/pair_lsd/Cargo.toml | 1 + contracts/pair_lsd/src/contract.rs | 18 +++++----- contracts/stake/src/multitest/distribution.rs | 36 +++++++++---------- contracts/stake/src/multitest/suite.rs | 2 -- 11 files changed, 44 insertions(+), 55 deletions(-) diff --git a/contracts/factory/src/contract.rs b/contracts/factory/src/contract.rs index 690f916..cad967b 100644 --- a/contracts/factory/src/contract.rs +++ b/contracts/factory/src/contract.rs @@ -656,7 +656,7 @@ pub mod reply { /// Removes an existing pair from the factory. /// /// * **asset_infos** is a vector with assets for which we deregister the pair. -/// The LP Staking Contract will also be deregistered and does not need to be provided. +/// The LP Staking Contract will also be deregistered and does not need to be provided. /// /// ## Executor /// Only the owner can execute this. @@ -716,7 +716,7 @@ pub fn deregister_pool_and_staking( /// * **QueryMsg::Pair { asset_infos }** Returns a [`PairInfo`] object with information about a specific Palomadex pair. /// /// * **QueryMsg::Pairs { start_after, limit }** Returns an array that contains items of type [`PairInfo`]. -/// This returns information about multiple Palomadex pairs +/// This returns information about multiple Palomadex pairs /// /// * **QueryMsg::FeeInfo { pair_type }** Returns the fee structure (total and protocol fees) for a specific pair type. /// @@ -791,7 +791,7 @@ pub fn query_pair(deps: Deps, asset_infos: Vec) -> StdResult Asset { #[derive(Debug)] pub struct SuiteBuilder { pub unbonding_periods: Vec, - pub admin: Option, pub native_balances: Vec<(Addr, Coin)>, pub no_converter: bool, } @@ -115,7 +114,6 @@ impl SuiteBuilder { pub fn new() -> Self { Self { unbonding_periods: vec![7 * DAY, 14 * DAY], - admin: None, native_balances: vec![], no_converter: false, } @@ -347,7 +345,6 @@ impl SuiteBuilder { Suite { app, - converter, factory, native_pair, native_staking, @@ -362,7 +359,6 @@ impl SuiteBuilder { pub struct Suite { pub app: App, - pub converter: Addr, factory: Addr, pub native_pair: Addr, native_staking: Addr, diff --git a/contracts/multi-hop/src/contract.rs b/contracts/multi-hop/src/contract.rs index aa67341..2322ee1 100644 --- a/contracts/multi-hop/src/contract.rs +++ b/contracts/multi-hop/src/contract.rs @@ -394,7 +394,7 @@ mod query { /// * **offer_amount** amount of offer assets being swapped. /// /// * **operations** is a vector that contains objects of type [`SwapOperation`]. - /// These are all the swap operations for which we perform a simulation. + /// These are all the swap operations for which we perform a simulation. pub fn simulate_swap_operations( deps: Deps, offer_amount: Uint128, @@ -487,7 +487,7 @@ mod query { /// * **ask_amount** amount of offer assets being swapped. /// /// * **operations** is a vector that contains objects of type [`SwapOperation`]. - /// These are all the swap operations for which we perform a simulation. + /// These are all the swap operations for which we perform a simulation. pub fn simulate_reverse_swap_operations( deps: Deps, ask_amount: Uint128, diff --git a/contracts/multi-hop/src/msg.rs b/contracts/multi-hop/src/msg.rs index e0e3283..7e3d79d 100644 --- a/contracts/multi-hop/src/msg.rs +++ b/contracts/multi-hop/src/msg.rs @@ -91,7 +91,7 @@ pub enum Cw20HookMsg { operations: Vec, /// The minimum amount of tokens to get from a swap minimum_receive: Option, - /// + /// The recipient of the ask tokens receiver: Option, /// Max spread max_spread: Option, diff --git a/contracts/pair/src/contract.rs b/contracts/pair/src/contract.rs index 268b767..e603b1d 100644 --- a/contracts/pair/src/contract.rs +++ b/contracts/pair/src/contract.rs @@ -93,7 +93,7 @@ pub fn reply(deps: DepsMut, _env: Env, msg: Reply) -> Result Result<(), ContractError> { /// /// ## Variants /// * **ExecuteMsg::UpdateConfig { params: Binary }** Updates the contract configuration with the specified -/// input parameters. +/// input parameters. /// /// * **ExecuteMsg::Receive(msg)** Receives a message of type [`Cw20ReceiveMsg`] and processes -/// it depending on the received template. +/// it depending on the received template. /// /// * **ExecuteMsg::ProvideLiquidity { /// assets, @@ -1067,21 +1067,21 @@ pub fn calculate_protocol_fee( /// * **QueryMsg::Pair {}** Returns information about the pair in an object of type [`PairInfo`]. /// /// * **QueryMsg::Pool {}** Returns information about the amount of assets in the pair contract as -/// well as the amount of LP tokens issued using an object of type [`PoolResponse`]. +/// well as the amount of LP tokens issued using an object of type [`PoolResponse`]. /// /// * **QueryMsg::Share { amount }** Returns the amount of assets that could be withdrawn from the pool -/// using a specific amount of LP tokens. The result is returned in a vector that contains objects of type [`Asset`]. +/// using a specific amount of LP tokens. The result is returned in a vector that contains objects of type [`Asset`]. /// /// * **QueryMsg::Simulation { offer_asset }** Returns the result of a swap simulation using a [`SimulationResponse`] object. /// /// * **QueryMsg::ReverseSimulation { ask_asset }** Returns the result of a reverse swap simulation using -/// a [`ReverseSimulationResponse`] object. +/// a [`ReverseSimulationResponse`] object. /// /// * **QueryMsg::CumulativePrices {}** Returns information about cumulative prices for the assets in the -/// pool using a [`CumulativePricesResponse`] object. +/// pool using a [`CumulativePricesResponse`] object. /// /// * **QueryMsg::HistoricalPrices { duration }** Returns historical price information for the assets in the -/// pool using a [`HistoricalPricesResponse`] object. +/// pool using a [`HistoricalPricesResponse`] object. /// /// * **QueryMsg::Config {}** Returns the configuration for the pair contract using a [`ConfigResponse`] object. #[cfg_attr(not(feature = "library"), entry_point)] @@ -1260,10 +1260,10 @@ pub fn query_simulation( /// Returns information about a reverse swap simulation in a [`ReverseSimulationResponse`] object. /// /// * **ask_asset** is the asset to swap to as well as the desired amount of ask -/// assets to receive from the swap. +/// assets to receive from the swap. /// /// * **offer_asset_info** is optional field which specifies the asset to swap from. -/// May be omitted only in case the pool length is 2. +/// May be omitted only in case the pool length is 2. pub fn query_reverse_simulation( deps: Deps, env: Env, diff --git a/contracts/stake/src/multitest/distribution.rs b/contracts/stake/src/multitest/distribution.rs index b3bd969..69ae4b8 100644 --- a/contracts/stake/src/multitest/distribution.rs +++ b/contracts/stake/src/multitest/distribution.rs @@ -13,7 +13,7 @@ use crate::{ #[test] fn multiple_distribution_flows() { - let members = vec![ + let members = [ "member1".to_owned(), "member2".to_owned(), "member3".to_owned(), @@ -195,7 +195,7 @@ fn multiple_distribution_flows() { // it is consistent with the users staking individually #[test] fn mass_bond_with_multiple_distribution_flows() { - let members = vec![ + let members = [ "member1".to_owned(), "member2".to_owned(), "member3".to_owned(), @@ -376,7 +376,7 @@ fn mass_bond_with_multiple_distribution_flows() { #[test] fn can_fund_an_inprogress_reward_period_with_more_funds_and_a_curve() { - let members = vec![ + let members = [ "member1".to_owned(), "member2".to_owned(), "member3".to_owned(), @@ -515,7 +515,7 @@ fn can_fund_an_inprogress_reward_period_with_more_funds_and_a_curve() { #[test] fn partial_payouts_by_rate() { - let members = vec![ + let members = [ "member1".to_owned(), "member2".to_owned(), "member3".to_owned(), @@ -685,7 +685,7 @@ fn partial_payouts_by_rate() { #[test] fn divisible_amount_distributed_with_rate() { - let members = vec![ + let members = [ "member1".to_owned(), "member2".to_owned(), "member3".to_owned(), @@ -1212,7 +1212,7 @@ fn simple_apr_simulation() { #[test] fn divisible_amount_distributed() { - let members = vec![ + let members = [ "member1".to_owned(), "member2".to_owned(), "member3".to_owned(), @@ -1312,7 +1312,7 @@ fn divisible_amount_distributed() { #[test] fn divisible_amount_distributed_twice() { - let members = vec![ + let members = [ "member1".to_owned(), "member2".to_owned(), "member3".to_owned(), @@ -1391,7 +1391,7 @@ fn divisible_amount_distributed_twice() { #[test] fn divisible_amount_distributed_twice_accumulated() { - let members = vec![ + let members = [ "member1".to_owned(), "member2".to_owned(), "member3".to_owned(), @@ -1461,7 +1461,7 @@ fn divisible_amount_distributed_twice_accumulated() { #[test] fn points_changed_after_distribution() { - let members = vec![ + let members = [ "member0".to_owned(), "member1".to_owned(), "member2".to_owned(), @@ -1570,7 +1570,7 @@ fn points_changed_after_distribution() { #[test] fn points_changed_after_distribution_accumulated() { - let members = vec![ + let members = [ "member1".to_owned(), "member2".to_owned(), "member3".to_owned(), @@ -1634,7 +1634,7 @@ fn points_changed_after_distribution_accumulated() { #[test] fn distribution_with_leftover() { - let members = vec![ + let members = [ "member1".to_owned(), "member2".to_owned(), "member3".to_owned(), @@ -1705,7 +1705,7 @@ fn distribution_with_leftover() { #[test] fn distribution_with_leftover_accumulated() { - let members = vec![ + let members = [ "member1".to_owned(), "member2".to_owned(), "member3".to_owned(), @@ -1768,7 +1768,7 @@ fn distribution_with_leftover_accumulated() { #[test] fn redirecting_withdrawn_funds() { - let members = vec![ + let members = [ "member1".to_owned(), "member2".to_owned(), "member3".to_owned(), @@ -1823,7 +1823,7 @@ fn redirecting_withdrawn_funds() { #[test] fn cannot_withdraw_others_funds() { - let members = vec![ + let members = [ "member1".to_owned(), "member2".to_owned(), "member3".to_owned(), @@ -1897,7 +1897,7 @@ fn cannot_withdraw_others_funds() { #[test] fn funds_withdrawal_delegation() { - let members = vec![ + let members = [ "member1".to_owned(), "member2".to_owned(), "member3".to_owned(), @@ -1979,7 +1979,7 @@ fn querying_unknown_address() { #[test] fn rebond_works() { - let members = vec!["member0".to_owned(), "member1".to_owned()]; + let members = ["member0".to_owned(), "member1".to_owned()]; let executor = "executor"; let unbonding_period = 1000u64; @@ -2088,7 +2088,7 @@ fn rebond_works() { fn rebond_multiple_works() { // This is just a version of `rebond_works` with multiple distributions in order to have // a more complex case with withdrawals and rebonding in-between distributing funds. - let members = vec!["member0".to_owned(), "member1".to_owned()]; + let members = ["member0".to_owned(), "member1".to_owned()]; let executor = "executor"; let unbonding_period = 1000u64; @@ -2276,7 +2276,7 @@ fn multiple_rewards() { // One of them is a native token, one a cw20 token. // We add distributions for both, then delegate and distribute, then check that it was done correctly. - let members = vec!["member0".to_owned(), "member1".to_owned()]; + let members = ["member0".to_owned(), "member1".to_owned()]; let executor = "executor"; let unbonding_period = 1000u64; diff --git a/contracts/stake/src/multitest/suite.rs b/contracts/stake/src/multitest/suite.rs index c63a0e6..9f52a2f 100644 --- a/contracts/stake/src/multitest/suite.rs +++ b/contracts/stake/src/multitest/suite.rs @@ -58,7 +58,6 @@ pub(super) fn native_token(denom: String, amount: u128) -> AssetValidated { #[derive(Debug)] pub struct SuiteBuilder { - pub cw20_contract: String, pub tokens_per_power: Uint128, pub min_bond: Uint128, pub unbonding_periods: Vec, @@ -71,7 +70,6 @@ pub struct SuiteBuilder { impl SuiteBuilder { pub fn new() -> Self { Self { - cw20_contract: "".to_owned(), tokens_per_power: Uint128::new(1000), min_bond: Uint128::new(5000), unbonding_periods: vec![SEVEN_DAYS],