From 1659ce6cbbd2b71499b2639da9b5c5be66de3da1 Mon Sep 17 00:00:00 2001 From: Kerber0x Date: Wed, 10 Jul 2024 11:07:56 +0100 Subject: [PATCH] chore: fix clippy issues --- contracts/alliance-hub/src/contract.rs | 2 +- contracts/alliance-hub/src/tests/assets.rs | 2 +- contracts/alliance-hub/src/tests/helpers.rs | 8 ++++---- contracts/alliance-hub/src/tests/instantiate.rs | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/contracts/alliance-hub/src/contract.rs b/contracts/alliance-hub/src/contract.rs index 82fd642..5760e3b 100644 --- a/contracts/alliance-hub/src/contract.rs +++ b/contracts/alliance-hub/src/contract.rs @@ -198,7 +198,7 @@ fn receive_cw20( ) -> Result { let sender = deps.api.addr_validate(&cw20_msg.sender)?; - match from_json(&cw20_msg.msg)? { + match from_json(cw20_msg.msg)? { Cw20HookMsg::Stake {} => { if cw20_msg.amount.is_zero() { return Err(ContractError::AmountCannotBeZero {}); diff --git a/contracts/alliance-hub/src/tests/assets.rs b/contracts/alliance-hub/src/tests/assets.rs index 4cd717b..ef32525 100644 --- a/contracts/alliance-hub/src/tests/assets.rs +++ b/contracts/alliance-hub/src/tests/assets.rs @@ -71,7 +71,7 @@ fn test_whitelist_assets() { assert_eq!(chain_id, "chain-1".to_string()); let res: WhitelistedAssetsResponse = - from_json(&query(deps.as_ref(), mock_env(), QueryMsg::WhitelistedAssets {}).unwrap()) + from_json(query(deps.as_ref(), mock_env(), QueryMsg::WhitelistedAssets {}).unwrap()) .unwrap(); assert_eq!( res, diff --git a/contracts/alliance-hub/src/tests/helpers.rs b/contracts/alliance-hub/src/tests/helpers.rs index dc52443..74e9e7c 100644 --- a/contracts/alliance-hub/src/tests/helpers.rs +++ b/contracts/alliance-hub/src/tests/helpers.rs @@ -156,7 +156,7 @@ pub fn claim_rewards(deps: DepsMut, user: &str, denom: &str) -> Response { pub fn query_rewards(deps: Deps, user: &str, denom: &str) -> PendingRewardsRes { from_json( - &query( + query( deps, mock_env(), QueryMsg::PendingRewards(AssetQuery { @@ -171,7 +171,7 @@ pub fn query_rewards(deps: Deps, user: &str, denom: &str) -> PendingRewardsRes { pub fn query_all_rewards(deps: Deps, user: &str) -> Vec { from_json( - &query( + query( deps, mock_env(), QueryMsg::AllPendingRewards(AllPendingRewardsQuery { @@ -184,11 +184,11 @@ pub fn query_all_rewards(deps: Deps, user: &str) -> Vec { } pub fn query_all_staked_balances(deps: Deps) -> Vec { - from_json(&query(deps, mock_env(), QueryMsg::TotalStakedBalances {}).unwrap()).unwrap() + from_json(query(deps, mock_env(), QueryMsg::TotalStakedBalances {}).unwrap()).unwrap() } pub fn query_asset_reward_distribution(deps: Deps) -> Vec { - from_json(&query(deps, mock_env(), QueryMsg::RewardDistribution {}).unwrap()).unwrap() + from_json(query(deps, mock_env(), QueryMsg::RewardDistribution {}).unwrap()).unwrap() } #[inline] diff --git a/contracts/alliance-hub/src/tests/instantiate.rs b/contracts/alliance-hub/src/tests/instantiate.rs index 7f4c799..543bb7c 100644 --- a/contracts/alliance-hub/src/tests/instantiate.rs +++ b/contracts/alliance-hub/src/tests/instantiate.rs @@ -34,7 +34,7 @@ fn test_setup_contract() { // alliance_token_denom and alliance_token_supply // will be populated on reply. let query_config = query(deps.as_ref(), mock_env(), QueryMsg::Config {}).unwrap(); - let config: Config = from_json(&query_config).unwrap(); + let config: Config = from_json(query_config).unwrap(); assert_eq!( config, Config { @@ -106,7 +106,7 @@ fn test_reply_create_token() { ); let query_config = query(deps.as_ref(), mock_env(), QueryMsg::Config {}).unwrap(); - let config: Config = from_json(&query_config).unwrap(); + let config: Config = from_json(query_config).unwrap(); assert_eq!( config, Config { @@ -138,7 +138,7 @@ fn test_update_config() { take_rate_taker, default_yearly_take_rate, .. - } = from_json(&query_config).unwrap(); + } = from_json(query_config).unwrap(); assert_eq!(governance, Addr::unchecked("gov")); assert_eq!(controller, Addr::unchecked("controller")); @@ -204,7 +204,7 @@ fn test_update_config() { take_rate_taker, default_yearly_take_rate, .. - } = from_json(&query_config).unwrap(); + } = from_json(query_config).unwrap(); assert_eq!(governance, Addr::unchecked("new_gov")); assert_eq!(controller, Addr::unchecked("new_controller"));