Skip to content

Commit

Permalink
chore: fix clippy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kerber0x committed Jul 10, 2024
1 parent 16f022b commit 1659ce6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion contracts/alliance-hub/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ fn receive_cw20(
) -> Result<Response, ContractError> {
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 {});
Expand Down
2 changes: 1 addition & 1 deletion contracts/alliance-hub/src/tests/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions contracts/alliance-hub/src/tests/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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<PendingRewardsRes> {
from_json(
&query(
query(
deps,
mock_env(),
QueryMsg::AllPendingRewards(AllPendingRewardsQuery {
Expand All @@ -184,11 +184,11 @@ pub fn query_all_rewards(deps: Deps, user: &str) -> Vec<PendingRewardsRes> {
}

pub fn query_all_staked_balances(deps: Deps) -> Vec<StakedBalanceRes> {
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<AssetDistribution> {
from_json(&query(deps, mock_env(), QueryMsg::RewardDistribution {}).unwrap()).unwrap()
from_json(query(deps, mock_env(), QueryMsg::RewardDistribution {}).unwrap()).unwrap()
}

#[inline]
Expand Down
8 changes: 4 additions & 4 deletions contracts/alliance-hub/src/tests/instantiate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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"));
Expand Down Expand Up @@ -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"));
Expand Down

0 comments on commit 1659ce6

Please sign in to comment.