diff --git a/contracts/alliance-lp-hub/src/contract.rs b/contracts/alliance-lp-hub/src/contract.rs index 58a7188..d7d6793 100644 --- a/contracts/alliance-lp-hub/src/contract.rs +++ b/contracts/alliance-lp-hub/src/contract.rs @@ -250,7 +250,7 @@ fn stake(deps: DepsMut, sender: Addr, received_asset: Asset) -> Result Result<_, ContractError> { Ok(b.unwrap_or_default() + received_asset.amount) }, )?; @@ -501,7 +501,7 @@ fn _claim_rewards( ( user.clone(), deposit_asset_key.clone(), - reward_asset_info_key.clone(), + reward_asset_info_key, ), ); @@ -509,7 +509,7 @@ fn _claim_rewards( if user_balance.is_zero() { return Ok(PendingRewards::new( deposit_asset.clone(), - reward_asset.clone(), + reward_asset, Uint128::zero(), )); } else { @@ -519,14 +519,14 @@ fn _claim_rewards( return Ok(PendingRewards::new( deposit_asset.clone(), - reward_asset.clone(), + reward_asset, rewards, )); } } Ok(PendingRewards::new( deposit_asset.clone(), - reward_asset.clone(), + reward_asset, Uint128::zero(), )) }) @@ -708,7 +708,7 @@ fn update_rewards(deps: DepsMut, env: Env, info: MessageInfo) -> Result Result let reward_asset_key = AssetInfoKey::from(reward_asset_info.clone()); let user_balance = *user_balances.get(&deposit_asset).unwrap(); - let key = ( - addr.clone(), - deposit_asset_key.clone(), - reward_asset_key.clone(), - ); + let key = (addr.clone(), deposit_asset_key, reward_asset_key); let user_reward_rate = USER_ASSET_REWARD_RATE .load(deps.storage, key.clone()) .unwrap_or_default(); diff --git a/contracts/alliance-lp-hub/src/tests/query_rewards.rs b/contracts/alliance-lp-hub/src/tests/query_rewards.rs index 8d210f7..dcc811e 100644 --- a/contracts/alliance-lp-hub/src/tests/query_rewards.rs +++ b/contracts/alliance-lp-hub/src/tests/query_rewards.rs @@ -45,7 +45,7 @@ fn test_query_pending_rewards() { .save(deps.storage.borrow_mut(), key, &Uint128::new(1)) .unwrap(); - let key = (addr_key.clone(), deposit_key.clone(), reward_key.clone()); + let key = (addr_key, deposit_key, reward_key); UNCLAIMED_REWARDS .save(deps.storage.borrow_mut(), key, &Uint128::new(1)) .unwrap(); @@ -107,7 +107,7 @@ fn test_query_all_pending_rewards() { .save(deps.storage.borrow_mut(), key, &Uint128::new(1)) .unwrap(); - let key = (addr_key.clone(), deposit_key.clone(), reward_key.clone()); + let key = (addr_key, deposit_key, reward_key); UNCLAIMED_REWARDS .save(deps.storage.borrow_mut(), key, &Uint128::new(1)) .unwrap(); diff --git a/contracts/alliance-lp-hub/src/tests/query_stake.rs b/contracts/alliance-lp-hub/src/tests/query_stake.rs index 0dcf846..66dd94e 100644 --- a/contracts/alliance-lp-hub/src/tests/query_stake.rs +++ b/contracts/alliance-lp-hub/src/tests/query_stake.rs @@ -28,12 +28,12 @@ fn test_query_address_staked_balance() { WHITELIST .save( deps.storage.borrow_mut(), - deposit_key2.clone(), + deposit_key2, &Decimal::one(), ) .unwrap(); - let key = (addr_key.clone(), deposit_key.clone()); + let key = (addr_key, deposit_key); USER_BALANCES .save(deps.storage.borrow_mut(), key, &Uint128::new(1)) .unwrap(); @@ -83,12 +83,12 @@ fn test_query_address_staked_balance_by_token() { WHITELIST .save( deps.storage.borrow_mut(), - deposit_key2.clone(), + deposit_key2, &Decimal::one(), ) .unwrap(); - let key = (addr_key.clone(), deposit_key.clone()); + let key = (addr_key, deposit_key); USER_BALANCES .save(deps.storage.borrow_mut(), key, &Uint128::new(1)) .unwrap();