From 2f29f652fef01529c00902e41f6bcd96f5611464 Mon Sep 17 00:00:00 2001 From: kaimen-sano Date: Sun, 7 Jan 2024 13:44:53 +1300 Subject: [PATCH] chore: satisfy more clippy lints in test code --- .../fee_collector/src/tests/integration.rs | 78 +++++++------- .../incentive/src/tests/helpers.rs | 2 +- .../incentive/src/tests/integration.rs | 100 +++++++++--------- 3 files changed, 88 insertions(+), 92 deletions(-) diff --git a/contracts/liquidity_hub/fee_collector/src/tests/integration.rs b/contracts/liquidity_hub/fee_collector/src/tests/integration.rs index 31345e9f..694ea6b5 100644 --- a/contracts/liquidity_hub/fee_collector/src/tests/integration.rs +++ b/contracts/liquidity_hub/fee_collector/src/tests/integration.rs @@ -3219,7 +3219,7 @@ fn collect_and_distribute_fees_successfully() { let fee_distributor_current_epoch_query: EpochResponse = app .wrap() .query_wasm_smart( - fee_distributor_address.clone(), + fee_distributor_address, &white_whale::fee_distributor::QueryMsg::CurrentEpoch {}, ) .unwrap(); @@ -6066,8 +6066,8 @@ fn decrease_grace_period_fee_distributor() { fee_distributor_id, creator.clone().sender, &white_whale::fee_distributor::InstantiateMsg { - bonding_contract_addr: whale_lair_address.clone().to_string(), - fee_collector_addr: fee_collector_address.clone().to_string(), + bonding_contract_addr: whale_lair_address.to_string(), + fee_collector_addr: fee_collector_address.to_string(), grace_period: Uint64::new(2), epoch_config: EpochConfig { duration: Uint64::new(86_400_000_000_000u64), // a day @@ -6086,7 +6086,7 @@ fn decrease_grace_period_fee_distributor() { // add pool router address to the fee collector to be able to aggregate fees app.execute_contract( creator.sender.clone(), - fee_collector_address.clone(), + fee_collector_address, &UpdateConfig { owner: None, pool_router: Some(pool_router_address.to_string()), @@ -6323,8 +6323,8 @@ fn decrease_grace_period_fee_distributor() { // try updating the grace_period on the config to 1, cannot be decreased let err = app .execute_contract( - creator.sender.clone(), - fee_distributor_address.clone(), + creator.sender, + fee_distributor_address, &white_whale::fee_distributor::ExecuteMsg::UpdateConfig { owner: None, bonding_contract_addr: None, @@ -6425,7 +6425,7 @@ fn users_cannot_claim_rewards_from_past_epochs() { vault_factory_id, creator.clone().sender, &vault_network::vault_factory::InstantiateMsg { - owner: creator.clone().sender.to_string(), + owner: creator.sender.to_string(), vault_id, token_id, fee_collector_addr: fee_collector_address.to_string(), @@ -6463,8 +6463,8 @@ fn users_cannot_claim_rewards_from_past_epochs() { fee_distributor_id, creator.clone().sender, &white_whale::fee_distributor::InstantiateMsg { - bonding_contract_addr: whale_lair_address.clone().to_string(), - fee_collector_addr: fee_collector_address.clone().to_string(), + bonding_contract_addr: whale_lair_address.to_string(), + fee_collector_addr: fee_collector_address.to_string(), grace_period: Uint64::new(3u64), epoch_config: EpochConfig { duration: Uint64::new(86_400_000_000_000u64), // a day @@ -6496,7 +6496,7 @@ fn users_cannot_claim_rewards_from_past_epochs() { // add pool router address to the fee collector to be able to aggregate fees app.execute_contract( creator.sender.clone(), - fee_collector_address.clone(), + fee_collector_address, &UpdateConfig { owner: None, pool_router: Some(pool_router_address.to_string()), @@ -6778,8 +6778,8 @@ fn users_cannot_claim_rewards_from_past_epochs() { // bond with the other account at epoch 2. He shouldn't have anything claimable app.execute_contract( - Addr::unchecked("other").clone(), - whale_lair_address.clone(), + Addr::unchecked("other"), + whale_lair_address, &white_whale::whale_lair::ExecuteMsg::Bond { asset: Asset { info: AssetInfo::NativeToken { @@ -6875,9 +6875,9 @@ fn users_cannot_claim_rewards_from_past_epochs() { let claimable_epochs_res: ClaimableEpochsResponse = app .wrap() .query_wasm_smart( - fee_distributor_address.clone(), + fee_distributor_address, &white_whale::fee_distributor::QueryMsg::Claimable { - address: creator.sender.clone().to_string(), + address: creator.sender.to_string(), }, ) .unwrap(); @@ -6967,7 +6967,7 @@ fn user_can_claim_even_when_his_weight_increases_for_past_epochs() { vault_factory_id, creator.clone().sender, &vault_network::vault_factory::InstantiateMsg { - owner: creator.clone().sender.to_string(), + owner: creator.sender.to_string(), vault_id, token_id, fee_collector_addr: fee_collector_address.to_string(), @@ -7005,8 +7005,8 @@ fn user_can_claim_even_when_his_weight_increases_for_past_epochs() { fee_distributor_id, creator.clone().sender, &white_whale::fee_distributor::InstantiateMsg { - bonding_contract_addr: whale_lair_address.clone().to_string(), - fee_collector_addr: fee_collector_address.clone().to_string(), + bonding_contract_addr: whale_lair_address.to_string(), + fee_collector_addr: fee_collector_address.to_string(), grace_period: Uint64::new(3u64), epoch_config: EpochConfig { duration: Uint64::new(86_400_000_000_000u64), // a day @@ -7038,7 +7038,7 @@ fn user_can_claim_even_when_his_weight_increases_for_past_epochs() { // add pool router address to the fee collector to be able to aggregate fees app.execute_contract( creator.sender.clone(), - fee_collector_address.clone(), + fee_collector_address, &UpdateConfig { owner: None, pool_router: Some(pool_router_address.to_string()), @@ -7213,7 +7213,7 @@ fn user_can_claim_even_when_his_weight_increases_for_past_epochs() { .unwrap(); app.execute_contract( - Addr::unchecked("other").clone(), + Addr::unchecked("other"), whale_lair_address.clone(), &white_whale::whale_lair::ExecuteMsg::Bond { asset: Asset { @@ -7420,7 +7420,7 @@ fn user_can_claim_even_when_his_weight_increases_for_past_epochs() { // let's unbond everything with creator" app.execute_contract( creator.sender.clone(), - whale_lair_address.clone(), + whale_lair_address, &white_whale::whale_lair::ExecuteMsg::Unbond { asset: Asset { info: AssetInfo::NativeToken { @@ -7463,7 +7463,7 @@ fn user_can_claim_even_when_his_weight_increases_for_past_epochs() { // Create new epoch, which triggers fee collection, aggregation and distribution app.execute_contract( - creator.sender.clone(), + creator.sender, fee_distributor_address.clone(), &NewEpoch {}, &[], @@ -7512,7 +7512,7 @@ fn user_can_claim_even_when_his_weight_increases_for_past_epochs() { .unwrap(); app.execute_contract( Addr::unchecked("creator"), - fee_distributor_address.clone(), + fee_distributor_address, &white_whale::fee_distributor::ExecuteMsg::Claim {}, &[], ) @@ -7601,7 +7601,7 @@ fn user_weight_accounts_for_unbondings() { vault_factory_id, creator.clone().sender, &vault_network::vault_factory::InstantiateMsg { - owner: creator.clone().sender.to_string(), + owner: creator.sender.to_string(), vault_id, token_id, fee_collector_addr: fee_collector_address.to_string(), @@ -7639,8 +7639,8 @@ fn user_weight_accounts_for_unbondings() { fee_distributor_id, creator.clone().sender, &white_whale::fee_distributor::InstantiateMsg { - bonding_contract_addr: whale_lair_address.clone().to_string(), - fee_collector_addr: fee_collector_address.clone().to_string(), + bonding_contract_addr: whale_lair_address.to_string(), + fee_collector_addr: fee_collector_address.to_string(), grace_period: Uint64::new(3u64), epoch_config: EpochConfig { duration: Uint64::new(86_400_000_000_000u64), // a day @@ -7672,7 +7672,7 @@ fn user_weight_accounts_for_unbondings() { // add pool router address to the fee collector to be able to aggregate fees app.execute_contract( creator.sender.clone(), - fee_collector_address.clone(), + fee_collector_address, &UpdateConfig { owner: None, pool_router: Some(pool_router_address.to_string()), @@ -7867,7 +7867,7 @@ fn user_weight_accounts_for_unbondings() { .unwrap(); app.execute_contract( - Addr::unchecked("other").clone(), + Addr::unchecked("other"), whale_lair_address.clone(), &white_whale::whale_lair::ExecuteMsg::Bond { asset: Asset { @@ -8245,7 +8245,7 @@ fn user_weight_accounts_for_unbondings() { //now unbond partially, check if weight is computed correctly app.execute_contract( creator.sender.clone(), - whale_lair_address.clone(), + whale_lair_address, &white_whale::whale_lair::ExecuteMsg::Unbond { asset: Asset { info: AssetInfo::NativeToken { @@ -8292,7 +8292,7 @@ fn user_weight_accounts_for_unbondings() { // Create new epoch, which triggers fee collection, aggregation and distribution app.execute_contract( - creator.sender.clone(), + creator.sender, fee_distributor_address.clone(), &NewEpoch {}, &[], @@ -8323,7 +8323,7 @@ fn user_weight_accounts_for_unbondings() { let epoch_res: EpochResponse = app .wrap() .query_wasm_smart( - fee_distributor_address.clone(), + fee_distributor_address, &white_whale::fee_distributor::QueryMsg::Epoch { id: Uint64::new(4u64), }, @@ -8433,7 +8433,7 @@ fn users_can_claim_even_when_global_index_was_taken_after_epoch_was_created() { vault_factory_id, creator.clone().sender, &vault_network::vault_factory::InstantiateMsg { - owner: creator.clone().sender.to_string(), + owner: creator.sender.to_string(), vault_id, token_id, fee_collector_addr: fee_collector_address.to_string(), @@ -8471,8 +8471,8 @@ fn users_can_claim_even_when_global_index_was_taken_after_epoch_was_created() { fee_distributor_id, creator.clone().sender, &white_whale::fee_distributor::InstantiateMsg { - bonding_contract_addr: whale_lair_address.clone().to_string(), - fee_collector_addr: fee_collector_address.clone().to_string(), + bonding_contract_addr: whale_lair_address.to_string(), + fee_collector_addr: fee_collector_address.to_string(), grace_period: Uint64::new(3u64), epoch_config: EpochConfig { duration: Uint64::new(86_400_000_000_000u64), // a day @@ -8504,7 +8504,7 @@ fn users_can_claim_even_when_global_index_was_taken_after_epoch_was_created() { // add pool router address to the fee collector to be able to aggregate fees app.execute_contract( creator.sender.clone(), - fee_collector_address.clone(), + fee_collector_address, &UpdateConfig { owner: None, pool_router: Some(pool_router_address.to_string()), @@ -8779,7 +8779,7 @@ fn users_can_claim_even_when_global_index_was_taken_after_epoch_was_created() { // should error because of the restriction we added on bonding/unbonding let err = app .execute_contract( - Addr::unchecked("other").clone(), + Addr::unchecked("other"), whale_lair_address.clone(), &white_whale::whale_lair::ExecuteMsg::Bond { asset: Asset { @@ -8803,7 +8803,7 @@ fn users_can_claim_even_when_global_index_was_taken_after_epoch_was_created() { // Create new epoch, which triggers fee collection, aggregation and distribution app.execute_contract( - creator.sender.clone(), + creator.sender, fee_distributor_address.clone(), &NewEpoch {}, &[], @@ -8814,7 +8814,7 @@ fn users_can_claim_even_when_global_index_was_taken_after_epoch_was_created() { let new_epoch_res: EpochResponse = app .wrap() .query_wasm_smart( - fee_distributor_address.clone(), + fee_distributor_address, &white_whale::fee_distributor::QueryMsg::CurrentEpoch {}, ) .unwrap(); @@ -8830,8 +8830,8 @@ fn users_can_claim_even_when_global_index_was_taken_after_epoch_was_created() { // bond now with other app.execute_contract( - Addr::unchecked("other").clone(), - whale_lair_address.clone(), + Addr::unchecked("other"), + whale_lair_address, &white_whale::whale_lair::ExecuteMsg::Bond { asset: Asset { info: AssetInfo::NativeToken { diff --git a/contracts/liquidity_hub/pool-network/incentive/src/tests/helpers.rs b/contracts/liquidity_hub/pool-network/incentive/src/tests/helpers.rs index b6ef9f2c..e12403b1 100644 --- a/contracts/liquidity_hub/pool-network/incentive/src/tests/helpers.rs +++ b/contracts/liquidity_hub/pool-network/incentive/src/tests/helpers.rs @@ -186,7 +186,7 @@ fn get_filtered_flow_cases() { assert_eq!(filtered_flow.emitted_tokens.len(), 20usize); assert_eq!(filtered_flow.asset_history.len(), 20usize); - let filtered_flow = get_filtered_flow(flow.clone(), None, Some(50u64)).unwrap(); + let filtered_flow = get_filtered_flow(flow, None, Some(50u64)).unwrap(); assert!(filtered_flow.asset_history.get(&1).is_some()); assert_eq!(filtered_flow.emitted_tokens.len(), 50usize); assert_eq!(filtered_flow.asset_history.len(), 50usize); diff --git a/contracts/liquidity_hub/pool-network/incentive/src/tests/integration.rs b/contracts/liquidity_hub/pool-network/incentive/src/tests/integration.rs index 8735b6c8..d557302c 100644 --- a/contracts/liquidity_hub/pool-network/incentive/src/tests/integration.rs +++ b/contracts/liquidity_hub/pool-network/incentive/src/tests/integration.rs @@ -107,7 +107,7 @@ fn create_incentive_cw20_lp_with_duplicate() { assert!(incentive.is_some()); }) // this should error cuz the incentive for that lp was already created - .create_incentive(creator.clone(), lp_asset_1.clone(), |result| { + .create_incentive(creator.clone(), lp_asset_1, |result| { let err = result .unwrap_err() .downcast::() @@ -120,7 +120,7 @@ fn create_incentive_cw20_lp_with_duplicate() { ), } }) - .create_incentive(creator.clone(), lp_asset_2, |result| { + .create_incentive(creator, lp_asset_2, |result| { result.unwrap(); }) .query_incentives(None, None, |result| { @@ -200,7 +200,7 @@ fn create_incentive_native_lp_with_duplicate() { assert!(incentive.is_some()); }) // this should error cuz the incentive for that lp was already created - .create_incentive(creator.clone(), lp_asset_1.clone(), |result| { + .create_incentive(creator.clone(), lp_asset_1, |result| { let err = result .unwrap_err() .downcast::() @@ -213,7 +213,7 @@ fn create_incentive_native_lp_with_duplicate() { ), } }) - .create_incentive(creator.clone(), lp_asset_2, |result| { + .create_incentive(creator, lp_asset_2, |result| { result.unwrap(); }) .query_incentives(None, None, |result| { @@ -267,7 +267,7 @@ fn try_open_more_flows_than_allowed() { .create_incentive(alice.clone(), lp_address_1.clone(), |result| { result.unwrap(); }) - .query_incentive(lp_address_1.clone(), |result| { + .query_incentive(lp_address_1, |result| { let incentive = result.unwrap(); assert!(incentive.is_some()); *incentive_addr.borrow_mut() = incentive.unwrap(); @@ -306,7 +306,7 @@ fn try_open_more_flows_than_allowed() { } let incentive_flows = RefCell::new(vec![]); - suite.query_flows(incentive_addr.clone().into_inner(), None, None, |result| { + suite.query_flows(incentive_addr.into_inner(), None, None, |result| { let flows = result.unwrap(); *incentive_flows.borrow_mut() = flows.clone(); @@ -374,7 +374,7 @@ fn try_open_flows_with_wrong_epochs() { .create_incentive(alice.clone(), lp_address_1.clone(), |result| { result.unwrap(); }) - .query_incentive(lp_address_1.clone(), |result| { + .query_incentive(lp_address_1, |result| { let incentive = result.unwrap(); assert!(incentive.is_some()); *incentive_addr.borrow_mut() = incentive.unwrap(); @@ -453,7 +453,7 @@ fn try_open_flows_with_wrong_epochs() { Some( current_epoch.clone().into_inner() + max_flow_epoch_buffer.clone().into_inner() + 1, ), - Some(current_epoch.clone().into_inner() + 100), + Some(current_epoch.into_inner() + 100), Some(Curve::Linear), Asset { info: AssetInfo::NativeToken { @@ -473,8 +473,8 @@ fn try_open_flows_with_wrong_epochs() { }, ) .open_incentive_flow( - alice.clone(), - incentive_addr.clone().into_inner(), + alice, + incentive_addr.into_inner(), None, Some(future_epoch), Some(Curve::Linear), @@ -510,10 +510,10 @@ fn open_flow_with_fee_native_token_and_flow_same_native_token() { let incentive_addr = RefCell::new(Addr::unchecked("")); suite - .create_incentive(alice.clone(), lp_address_1.clone(), |result| { + .create_incentive(alice, lp_address_1.clone(), |result| { result.unwrap(); }) - .query_incentive(lp_address_1.clone(), |result| { + .query_incentive(lp_address_1, |result| { let incentive = result.unwrap(); assert!(incentive.is_some()); *incentive_addr.borrow_mut() = incentive.unwrap(); @@ -625,7 +625,7 @@ fn open_flow_with_fee_native_token_and_flow_same_native_token() { carol.clone(), incentive_addr.clone().into_inner(), None, - Some(current_epoch.clone().into_inner() + 9), + Some(current_epoch.into_inner() + 9), Some(Curve::Linear), Asset { info: AssetInfo::NativeToken { @@ -691,7 +691,7 @@ fn open_flow_with_fee_native_token_and_flow_same_native_token() { }, ) .query_flow( - incentive_addr.clone().into_inner(), + incentive_addr.into_inner(), FlowIdentifier::Id(5u64), |result| { // this should not work as there is no flow with id 5 @@ -721,10 +721,10 @@ fn open_flow_with_fee_native_token_and_flow_different_native_token() { let incentive_addr = RefCell::new(Addr::unchecked("")); suite - .create_incentive(alice.clone(), lp_address_1.clone(), |result| { + .create_incentive(alice, lp_address_1.clone(), |result| { result.unwrap(); }) - .query_incentive(lp_address_1.clone(), |result| { + .query_incentive(lp_address_1, |result| { let incentive = result.unwrap(); assert!(incentive.is_some()); *incentive_addr.borrow_mut() = incentive.unwrap(); @@ -952,7 +952,7 @@ fn open_flow_with_fee_native_token_and_flow_different_native_token() { // create another incentive overpaying the fee, and check if the excees went back to carol .open_incentive_flow( carol.clone(), - incentive_addr.clone().into_inner(), + incentive_addr.into_inner(), None, Some(current_epoch.clone().into_inner() + 9), Some(Curve::Linear), @@ -1013,10 +1013,10 @@ fn open_flow_with_fee_native_token_and_flow_cw20_token() { let incentive_addr = RefCell::new(Addr::unchecked("")); suite - .create_incentive(alice.clone(), lp_address_1.clone(), |result| { + .create_incentive(alice, lp_address_1.clone(), |result| { result.unwrap(); }) - .query_incentive(lp_address_1.clone(), |result| { + .query_incentive(lp_address_1, |result| { let incentive = result.unwrap(); assert!(incentive.is_some()); *incentive_addr.borrow_mut() = incentive.unwrap(); @@ -1075,7 +1075,7 @@ fn open_flow_with_fee_native_token_and_flow_cw20_token() { ) .increase_allowance( carol.clone(), - cw20_incentive_address.clone(), + cw20_incentive_address, Uint128::new(1_000u128), incentive_addr.clone().into_inner(), ) @@ -1136,7 +1136,7 @@ fn open_flow_with_fee_native_token_and_flow_cw20_token() { }, ) .query_flow( - incentive_addr.clone().into_inner(), + incentive_addr.into_inner(), FlowIdentifier::Id(1u64), |result| { let flow_response = result.unwrap(); @@ -1186,10 +1186,10 @@ fn open_flow_with_fee_cw20_token_and_flow_same_cw20_token() { let incentive_addr = RefCell::new(Addr::unchecked("")); suite - .create_incentive(alice.clone(), lp_address_last.clone(), |result| { + .create_incentive(alice, lp_address_last.clone(), |result| { result.unwrap(); }) - .query_incentive(lp_address_last.clone(), |result| { + .query_incentive(lp_address_last, |result| { let incentive = result.unwrap(); assert!(incentive.is_some()); @@ -1279,7 +1279,7 @@ fn open_flow_with_fee_cw20_token_and_flow_same_cw20_token() { ) .increase_allowance( carol.clone(), - cw20_asset_addr.clone(), + cw20_asset_addr, Uint128::new(2_000u128), incentive_addr.clone().into_inner(), ) @@ -1322,7 +1322,7 @@ fn open_flow_with_fee_cw20_token_and_flow_same_cw20_token() { }, ) .query_flow( - incentive_addr.clone().into_inner(), + incentive_addr.into_inner(), FlowIdentifier::Id(1u64), |result| { let flow_response = result.unwrap(); @@ -1374,7 +1374,7 @@ fn open_flow_with_fee_cw20_token_and_flow_different_cw20_token() { let incentive_addr = RefCell::new(Addr::unchecked("")); suite - .create_incentive(alice.clone(), cw20_fee_asset.clone(), |result| { + .create_incentive(alice, cw20_fee_asset.clone(), |result| { result.unwrap(); }) .query_incentive(cw20_fee_asset.clone(), |result| { @@ -1466,7 +1466,7 @@ fn open_flow_with_fee_cw20_token_and_flow_different_cw20_token() { // increase allowance for the fee asset .increase_allowance( carol.clone(), - cw20_fee_asset_addr.clone(), + cw20_fee_asset_addr, Uint128::new(1_000u128), incentive_addr.clone().into_inner(), ) @@ -1495,7 +1495,7 @@ fn open_flow_with_fee_cw20_token_and_flow_different_cw20_token() { // increase allowance for the flow asset .increase_allowance( carol.clone(), - cw20_asset_addr.clone(), + cw20_asset_addr, Uint128::new(1_000u128), incentive_addr.clone().into_inner(), ) @@ -1546,7 +1546,7 @@ fn open_flow_with_fee_cw20_token_and_flow_different_cw20_token() { ) .query_funds( fee_collector_addr.clone().into_inner(), - cw20_fee_asset.clone(), + cw20_fee_asset, |funds| { // cw20_fee_asset funds on the fee collector assert_eq!(funds, Uint128::new(1_000u128)); @@ -1578,7 +1578,7 @@ fn open_flow_with_fee_cw20_token_and_flow_different_cw20_token() { }, ) .query_flow( - incentive_addr.clone().into_inner(), + incentive_addr.into_inner(), FlowIdentifier::Id(5u64), |result| { // this should not work as there is no flow with id 5 @@ -1609,7 +1609,7 @@ fn open_flow_with_fee_cw20_token_and_flow_native_token() { let incentive_addr = RefCell::new(Addr::unchecked("")); suite - .create_incentive(alice.clone(), cw20_fee_asset.clone(), |result| { + .create_incentive(alice, cw20_fee_asset.clone(), |result| { result.unwrap(); }) .query_incentive(cw20_fee_asset.clone(), |result| { @@ -1707,7 +1707,7 @@ fn open_flow_with_fee_cw20_token_and_flow_native_token() { // incerase allowance for the fee asset, enough to cover the fee .increase_allowance( carol.clone(), - cw20_fee_asset_addr.clone(), + cw20_fee_asset_addr, Uint128::new(1u128), incentive_addr.clone().into_inner(), ) @@ -1811,7 +1811,7 @@ fn open_flow_with_fee_cw20_token_and_flow_native_token() { ) .query_funds( fee_collector_addr.clone().into_inner(), - cw20_fee_asset.clone(), + cw20_fee_asset, |funds| { // cw20_fee_asset funds on the fee collector assert_eq!(funds, Uint128::new(1_000u128)); @@ -1845,7 +1845,7 @@ fn open_flow_with_fee_cw20_token_and_flow_native_token() { }, ) .query_flow( - incentive_addr.clone().into_inner(), + incentive_addr.into_inner(), FlowIdentifier::Id(5u64), |result| { // this should not work as there is no flow with id 5 @@ -1878,7 +1878,7 @@ fn close_native_token_flows() { .create_incentive(alice.clone(), lp_address_1.clone(), |result| { result.unwrap(); }) - .query_incentive(lp_address_1.clone(), |result| { + .query_incentive(lp_address_1, |result| { let incentive = result.unwrap(); assert!(incentive.is_some()); *incentive_addr.borrow_mut() = incentive.unwrap(); @@ -2100,7 +2100,7 @@ fn close_native_token_flows() { }) // try closing a flow that doesn't exist .close_incentive_flow( - bob.clone(), + bob, incentive_addr.clone().into_inner(), FlowIdentifier::Id(3u64), |result| { @@ -2132,7 +2132,7 @@ fn close_native_token_flows() { result.unwrap(); }, ) - .query_flows(incentive_addr.clone().into_inner(), None, None, |result| { + .query_flows(incentive_addr.into_inner(), None, None, |result| { let flows = result.unwrap(); assert_eq!(flows.len(), 1usize); @@ -2187,7 +2187,7 @@ fn close_cw20_token_flows() { .create_incentive(alice.clone(), lp_address_1.clone(), |result| { result.unwrap(); }) - .query_incentive(lp_address_1.clone(), |result| { + .query_incentive(lp_address_1, |result| { let incentive = result.unwrap(); assert!(incentive.is_some()); *incentive_addr.borrow_mut() = incentive.unwrap(); @@ -2386,7 +2386,7 @@ fn close_cw20_token_flows() { }) // try closing a flow that doesn't exist .close_incentive_flow( - bob.clone(), + bob, incentive_addr.clone().into_inner(), FlowIdentifier::Id(3u64), |result| { @@ -2402,7 +2402,7 @@ fn close_cw20_token_flows() { ) .increase_allowance( alice.clone(), - cw20_asset_addr.clone(), + cw20_asset_addr, Uint128::new(5_000u128), incentive_addr.clone().into_inner(), ) @@ -2422,7 +2422,7 @@ fn close_cw20_token_flows() { result.unwrap(); }, ) - .query_flows(incentive_addr.clone().into_inner(), None, None, |result| { + .query_flows(incentive_addr.into_inner(), None, None, |result| { let flows = result.unwrap(); assert_eq!(flows.len(), 1usize); @@ -2682,10 +2682,10 @@ fn open_flow_positions_and_claim_native_token_incentive() { println!("CURRENT_EPOCH -> {:?}", current_epoch); suite .open_incentive_flow( - alice.clone(), + alice, incentive_addr.clone().into_inner(), None, - Some(current_epoch.clone().into_inner() + 10), + Some(current_epoch.into_inner() + 10), Some(Curve::Linear), Asset { info: AssetInfo::NativeToken { @@ -2857,15 +2857,11 @@ fn open_flow_positions_and_claim_native_token_incentive() { ); }, ) - .query_rewards( - incentive_addr.clone().into_inner(), - carol.clone(), - |result| { - // There's nothing left to claim - let result = result.unwrap(); - assert!(result.rewards.is_empty()); - }, - ); + .query_rewards(incentive_addr.into_inner(), carol, |result| { + // There's nothing left to claim + let result = result.unwrap(); + assert!(result.rewards.is_empty()); + }); } #[test]