Skip to content

Commit

Permalink
chore: clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
joemonem committed May 7, 2024
1 parent 20b7636 commit be7280e
Show file tree
Hide file tree
Showing 26 changed files with 47 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::state::{ACCOUNTS, ALLOWED_COIN};
use andromeda_finance::rate_limiting_withdrawals::{
AccountDetails, CoinAllowance, ExecuteMsg, InstantiateMsg, MinimumFrequency, QueryMsg,
};
use andromeda_std::ado_base::ownership::OwnershipMessage;

use andromeda_std::ado_base::{InstantiateMsg as BaseInstantiateMsg, MigrateMsg};
use andromeda_std::ado_contract::ADOContract;
use andromeda_std::common::actions::call_action;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ use andromeda_std::testing::mock_querier::MockAndromedaQuerier;
use cosmwasm_std::testing::mock_info;
use cosmwasm_std::{
from_json,
testing::{mock_env, MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR},
to_json_binary, Binary, Coin, ContractResult, OwnedDeps, Querier, QuerierResult, QueryRequest,
testing::{mock_env, MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR}, Coin, OwnedDeps, Querier, QuerierResult, QueryRequest,
SystemError, SystemResult, WasmQuery,
};
use cosmwasm_std::{BankMsg, CosmosMsg, QuerierWrapper, Response, SubMsg, Uint128};
use cosmwasm_std::{QuerierWrapper};

pub use andromeda_std::testing::mock_querier::{
MOCK_ADDRESS_LIST_CONTRACT, MOCK_KERNEL_CONTRACT, MOCK_RATES_CONTRACT,
MOCK_KERNEL_CONTRACT,
};

// pub const MOCK_TAX_RECIPIENT: &str = "tax_recipient";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use andromeda_std::{ado_base::modules::Module, common::Milliseconds, error::ContractError};
use andromeda_std::{common::Milliseconds, error::ContractError};
use cosmwasm_std::{
coin,
testing::{mock_env, mock_info},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ use andromeda_std::testing::mock_querier::MockAndromedaQuerier;
use cosmwasm_std::testing::mock_info;
use cosmwasm_std::{
from_json,
testing::{mock_env, MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR},
to_json_binary, Binary, Coin, ContractResult, OwnedDeps, Querier, QuerierResult, QueryRequest,
testing::{mock_env, MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR}, Coin, OwnedDeps, Querier, QuerierResult, QueryRequest,
SystemError, SystemResult, WasmQuery,
};
use cosmwasm_std::{BankMsg, CosmosMsg, QuerierWrapper, Response, SubMsg, Uint128};
use cosmwasm_std::{QuerierWrapper};

pub use andromeda_std::testing::mock_querier::{
MOCK_ADDRESS_LIST_CONTRACT, MOCK_KERNEL_CONTRACT, MOCK_RATES_CONTRACT,
MOCK_KERNEL_CONTRACT,
};

/// Alternative to `cosmwasm_std::testing::mock_dependencies` that allows us to respond to custom queries.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use cosmwasm_std::{
testing::{mock_env, MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR},
Coin, OwnedDeps, Querier, QuerierResult, QueryRequest, SystemError, SystemResult, WasmQuery,
};
use cosmwasm_std::{BankMsg, CosmosMsg, QuerierWrapper, Response, SubMsg, Uint128};
use cosmwasm_std::{QuerierWrapper};


pub use andromeda_std::testing::mock_querier::{MOCK_ADDRESS_LIST_CONTRACT, MOCK_RATES_CONTRACT};

pub const MOCK_TAX_RECIPIENT: &str = "tax_recipient";
pub const MOCK_ROYALTY_RECIPIENT: &str = "royalty_recipient";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ use andromeda_std::testing::mock_querier::MockAndromedaQuerier;
use cosmwasm_std::testing::mock_info;
use cosmwasm_std::{
from_json,
testing::{mock_env, MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR},
to_json_binary, Binary, Coin, ContractResult, OwnedDeps, Querier, QuerierResult, QueryRequest,
testing::{mock_env, MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR}, Coin, OwnedDeps, Querier, QuerierResult, QueryRequest,
SystemError, SystemResult, WasmQuery,
};
use cosmwasm_std::{BankMsg, CosmosMsg, QuerierWrapper, Response, SubMsg, Uint128};
use cosmwasm_std::{QuerierWrapper};

pub use andromeda_std::testing::mock_querier::{
MOCK_ADDRESS_LIST_CONTRACT, MOCK_KERNEL_CONTRACT, MOCK_RATES_CONTRACT,
MOCK_KERNEL_CONTRACT,
};

/// Alternative to `cosmwasm_std::testing::mock_dependencies` that allows us to respond to custom queries.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{ops::Mul, str::FromStr};

use andromeda_std::{
ado_base::{ownership::OwnershipMessage, InstantiateMsg as BaseInstantiateMsg, MigrateMsg},
ado_base::{InstantiateMsg as BaseInstantiateMsg, MigrateMsg},
ado_contract::ADOContract,
common::{actions::call_action, context::ExecuteContext, encode_binary, Milliseconds},
error::ContractError,
Expand Down Expand Up @@ -123,7 +123,7 @@ pub fn execute(
}

pub fn handle_execute(mut ctx: ExecuteContext, msg: ExecuteMsg) -> Result<Response, ContractError> {
let contract = ADOContract::default();
let _contract = ADOContract::default();
let action_response = call_action(
&mut ctx.deps,
&ctx.info,
Expand Down
4 changes: 2 additions & 2 deletions contracts/fungible-tokens/andromeda-cw20/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use andromeda_fungible_tokens::cw20::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_std::{
ado_base::{
ownership::OwnershipMessage, AndromedaMsg, AndromedaQuery,
AndromedaMsg, AndromedaQuery,
InstantiateMsg as BaseInstantiateMsg, MigrateMsg,
},
ado_contract::ADOContract,
Expand Down Expand Up @@ -76,7 +76,7 @@ pub fn execute(
pub fn handle_execute(mut ctx: ExecuteContext, msg: ExecuteMsg) -> Result<Response, ContractError> {
let action = get_action_name(CONTRACT_NAME, msg.as_ref());

let contract = ADOContract::default();
let _contract = ADOContract::default();
let action_response = call_action(
&mut ctx.deps,
&ctx.info,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ use andromeda_fungible_tokens::cw20::QueryMsg as Cw20Query;
use andromeda_std::ado_base::InstantiateMsg;
use andromeda_std::ado_contract::ADOContract;
use andromeda_std::testing::mock_querier::MockAndromedaQuerier;
pub use andromeda_std::testing::mock_querier::MOCK_ADDRESS_LIST_CONTRACT;

use andromeda_std::testing::mock_querier::MOCK_KERNEL_CONTRACT;
use cosmwasm_std::testing::{mock_env, mock_info, MockApi, MockQuerier, MockStorage};
use cosmwasm_std::{
from_json, to_json_binary, BankMsg, Binary, Coin, ContractResult, CosmosMsg, OwnedDeps,
Querier, QuerierResult, QuerierWrapper, QueryRequest, Response, SubMsg, SystemError,
SystemResult, Uint128, WasmQuery,
from_json, to_json_binary, Binary, Coin, ContractResult, OwnedDeps,
Querier, QuerierResult, QuerierWrapper, QueryRequest, SystemError,
SystemResult, WasmQuery,
};

pub const MOCK_CW20_CONTRACT: &str = "mock_cw20_contract";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use andromeda_std::ado_base::rates::{LocalRate, LocalRateType, LocalRateValue, P
use andromeda_std::ado_contract::ADOContract;
use andromeda_std::amp::{AndrAddr, Recipient};
use andromeda_std::common::context::ExecuteContext;
use andromeda_std::testing::mock_querier::MOCK_ADDRESS_LIST_CONTRACT;

use andromeda_std::{error::ContractError, testing::mock_querier::MOCK_KERNEL_CONTRACT};
use andromeda_testing::economics_msg::generate_economics_message;
use cosmwasm_std::{attr, Decimal, Event};
Expand Down
4 changes: 2 additions & 2 deletions contracts/fungible-tokens/andromeda-lockdrop/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use andromeda_fungible_tokens::lockdrop::{
UserInfoResponse,
};
use andromeda_std::{
ado_base::{ownership::OwnershipMessage, InstantiateMsg as BaseInstantiateMsg, MigrateMsg},
ado_base::{InstantiateMsg as BaseInstantiateMsg, MigrateMsg},
ado_contract::ADOContract,
common::{
actions::call_action, context::ExecuteContext, encode_binary,
Expand Down Expand Up @@ -105,7 +105,7 @@ pub fn execute(
}

pub fn handle_execute(mut ctx: ExecuteContext, msg: ExecuteMsg) -> Result<Response, ContractError> {
let contract = ADOContract::default();
let _contract = ADOContract::default();
let action_response = call_action(
&mut ctx.deps,
&ctx.info,
Expand Down
1 change: 0 additions & 1 deletion contracts/fungible-tokens/andromeda-lockdrop/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use crate::contract::{execute, instantiate, query};
use andromeda_fungible_tokens::lockdrop::{Cw20HookMsg, ExecuteMsg, InstantiateMsg};
use andromeda_std::{
ado_base::modules::Module,
amp::AndrAddr,
common::{expiration::Expiry, MillisecondsDuration},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use cosmwasm_std::{
testing::{mock_env, MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR},
Coin, OwnedDeps, Querier, QuerierResult, QueryRequest, SystemError, SystemResult, WasmQuery,
};
use cosmwasm_std::{BankMsg, CosmosMsg, QuerierWrapper, Response, SubMsg, Uint128};
use cosmwasm_std::{QuerierWrapper};

pub const MOCK_TOKEN_CONTRACT: &str = "token_contract";
pub const MOCK_TAX_RECIPIENT: &str = "tax_recipient";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use cosmwasm_std::{
testing::{mock_env, MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR},
Coin, OwnedDeps, Querier, QuerierResult, QueryRequest, SystemError, SystemResult, WasmQuery,
};
use cosmwasm_std::{QuerierWrapper, Response};
use cosmwasm_std::{QuerierWrapper};

pub use andromeda_std::testing::mock_querier::MOCK_KERNEL_CONTRACT;

Expand Down
4 changes: 2 additions & 2 deletions contracts/modules/andromeda-rates/src/testing/mock_querier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use cosmwasm_std::{
testing::{mock_env, MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR},
Coin, OwnedDeps, Querier, QuerierResult, QueryRequest, SystemError, SystemResult, WasmQuery,
};
use cosmwasm_std::{BankMsg, CosmosMsg, QuerierWrapper, Response, SubMsg, Uint128};
use cosmwasm_std::{QuerierWrapper};

pub use andromeda_std::testing::mock_querier::{MOCK_KERNEL_CONTRACT, MOCK_RATES_CONTRACT};
pub use andromeda_std::testing::mock_querier::{MOCK_KERNEL_CONTRACT};
pub const MOCK_TAX_RECIPIENT: &str = "tax_recipient";
pub const MOCK_ROYALTY_RECIPIENT: &str = "royalty_recipient";
pub const MOCK_OWNER: &str = "owner";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use andromeda_std::{
denom::{Asset, SEND_CW20_ACTION},
encode_binary,
expiration::{expiration_from_milliseconds, get_and_validate_start_time, Expiry},
rates::get_tax_amount,
Funds, Milliseconds, OrderBy,
},
error::ContractError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ use andromeda_std::testing::mock_querier::MockAndromedaQuerier;
use cosmwasm_schema::cw_serde;

pub use andromeda_std::testing::mock_querier::{
MOCK_ADDRESS_LIST_CONTRACT, MOCK_KERNEL_CONTRACT, MOCK_RATES_CONTRACT,
MOCK_KERNEL_CONTRACT,
};
use cosmwasm_std::testing::mock_info;
use cosmwasm_std::{coin, BankMsg, BankQuery, CosmosMsg, QuerierWrapper, Response, SubMsg};
use cosmwasm_std::{coin, BankQuery, QuerierWrapper};
use cosmwasm_std::{
from_json,
testing::{mock_env, MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fn init(deps: DepsMut) -> Response {
instantiate(deps, mock_env(), info, msg).unwrap()
}

fn init_cw20(deps: DepsMut, modules: Option<Vec<Module>>) -> Response {
fn init_cw20(deps: DepsMut, _modules: Option<Vec<Module>>) -> Response {
let msg = InstantiateMsg {
owner: None,
kernel_address: MOCK_KERNEL_CONTRACT.to_string(),
Expand Down Expand Up @@ -572,7 +572,7 @@ fn execute_place_bid_multiple_bids() {
#[test]
fn execute_place_bid_auction_cancelled() {
let mut deps = mock_dependencies_custom(&[]);
let mut env = mock_env();
let env = mock_env();
let _res = init(deps.as_mut());

start_auction(deps.as_mut(), None, None);
Expand Down Expand Up @@ -1615,7 +1615,7 @@ fn execute_cancel_with_bids_cw20() {
#[test]
fn execute_cancel_not_token_owner() {
let mut deps = mock_dependencies_custom(&[]);
let mut env = mock_env();
let env = mock_env();
let _res = init(deps.as_mut());

start_auction(deps.as_mut(), None, None);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use andromeda_non_fungible_tokens::{
cw721::{ExecuteMsg as Cw721ExecuteMsg, MintMsg, QueryMsg as Cw721QueryMsg},
};
use andromeda_std::{
ado_base::ownership::OwnershipMessage,
amp::{messages::AMPPkt, recipient::Recipient, AndrAddr},
common::{
actions::call_action,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use andromeda_non_fungible_tokens::{
cw721::TokenExtension,
};
use andromeda_std::{
ado_base::modules::Module,
amp::{AndrAddr, Recipient},
common::expiration::Expiry,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
use crate::testing::mock_querier::MOCK_TAX_RECIPIENT;

use crate::{
contract::{execute, instantiate, query, MAX_MINT_LIMIT},
state::{
Purchase, AVAILABLE_TOKENS, NUMBER_OF_TOKENS_AVAILABLE, PURCHASES, SALE_CONDUCTED, STATE,
},
testing::mock_querier::{
mock_dependencies_custom, MOCK_APP_CONTRACT, MOCK_CONDITIONS_MET_CONTRACT,
MOCK_CONDITIONS_NOT_MET_CONTRACT, MOCK_ROYALTY_RECIPIENT, MOCK_TOKENS_FOR_SALE,
mock_dependencies_custom, MOCK_APP_CONTRACT, MOCK_ROYALTY_RECIPIENT, MOCK_TOKENS_FOR_SALE,
MOCK_TOKEN_CONTRACT,
},
};

use andromeda_non_fungible_tokens::{
crowdfund::{
Config, CrowdfundMintMsg, ExecuteMsg, InstantiateMsg, IsTokenAvailableResponse, QueryMsg,
CrowdfundMintMsg, ExecuteMsg, InstantiateMsg, IsTokenAvailableResponse, QueryMsg,
State,
},
cw721::{ExecuteMsg as Cw721ExecuteMsg, TokenExtension},
Expand All @@ -30,11 +29,10 @@ use andromeda_std::{
error::ContractError,
};
use andromeda_testing::economics_msg::generate_economics_message;
use cosmwasm_std::StdError;

use cosmwasm_std::{
coin, coins, from_json,
testing::{mock_env, mock_info},
Addr, BankMsg, Coin, CosmosMsg, Decimal, DepsMut, Response, SubMsg, Uint128, WasmMsg,
testing::{mock_env, mock_info}, BankMsg, Coin, CosmosMsg, Decimal, DepsMut, Response, SubMsg, Uint128, WasmMsg,
};
use cw_utils::Expiration;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ fn handle_execute(mut ctx: ExecuteContext, msg: ExecuteMsg) -> Result<Response,
ctx.info.sender.clone()
};

let fee_msg = ADOContract::default().pay_fee(
let _fee_msg = ADOContract::default().pay_fee(
ctx.deps.storage,
&ctx.deps.querier,
msg.as_ref().to_string(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
use andromeda_app::app::QueryMsg as AppQueryMsg;
use andromeda_std::ado_contract::ADOContract;
use andromeda_std::common::Funds;

use andromeda_std::testing::mock_querier::MockAndromedaQuerier;
pub use andromeda_std::testing::mock_querier::{MOCK_APP_CONTRACT, MOCK_KERNEL_CONTRACT};
use cosmwasm_schema::cw_serde;
use cosmwasm_std::{
coin, from_json,
testing::{mock_env, mock_info, MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR},
to_json_binary, BankMsg, BankQuery, Binary, Coin, ContractResult, CosmosMsg, OwnedDeps,
Querier, QuerierResult, QuerierWrapper, QueryRequest, Response, SubMsg, SystemError,
SystemResult, Uint128, WasmQuery,
to_json_binary, BankQuery, Binary, Coin, ContractResult, OwnedDeps,
Querier, QuerierResult, QuerierWrapper, QueryRequest, SystemError,
SystemResult, WasmQuery,
};
use cw721::{Cw721QueryMsg, OwnerOfResponse};

Expand Down
4 changes: 2 additions & 2 deletions packages/std/src/ado_base/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ pub mod withdraw;
use crate::amp::{messages::AMPPkt, AndrAddr};
use cosmwasm_schema::{cw_serde, QueryResponses};
use cosmwasm_std::Addr;
use cosmwasm_std::Binary;
use cosmwasm_std::Uint64;



use self::ownership::OwnershipMessage;
use self::permissioning::PermissioningMessage;
Expand Down
2 changes: 1 addition & 1 deletion packages/std/src/common/rates.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use cosmwasm_std::{from_json, BankMsg, CosmosMsg, SubMsg, Uint128, WasmMsg};
use cw20::Cw20ExecuteMsg;

use crate::error::ContractError;


/// Gets the amount of tax paid by iterating over the `msgs` and comparing it to the
/// difference between the base amount and the amount left over after royalties.
Expand Down
2 changes: 1 addition & 1 deletion tests-integration/tests/marketplace_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ fn test_marketplace_app_cw20_unrestricted() {
),
)
.unwrap();
let local_rate2 = LocalRate {
let _local_rate2 = LocalRate {
rate_type: LocalRateType::Additive,
recipients: vec![Recipient::from_string(rates_receiver.to_string())],
// This is the cw20's address
Expand Down

0 comments on commit be7280e

Please sign in to comment.