Skip to content

Commit

Permalink
Fix more linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
shanev committed Aug 19, 2023
1 parent 4da9bf9 commit 9ada038
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 33 deletions.
2 changes: 1 addition & 1 deletion test-suite/src/base_minter/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ fn update_start_trading_time() {
&ExecuteMsg::UpdateStartTradingTime(Some(default_start_trading_time)),
&[],
);
println!("res is {:?}", res);
println!("res is {res:?}");
assert!(res.is_ok());

// confirm trading start time
Expand Down
11 changes: 1 addition & 10 deletions test-suite/src/common_setup/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,22 +326,13 @@ pub fn base_minter_with_specified_sg721(
}
}

#[derive(Default)]
pub struct OpenEditionMinterCustomParams<'a> {
pub denom: Option<&'a str>,
pub mint_fee_bps: Option<u64>,
pub airdrop_mint_price_amount: Option<Uint128>,
}

impl<'a> Default for OpenEditionMinterCustomParams<'a> {
fn default() -> Self {
OpenEditionMinterCustomParams {
denom: None,
mint_fee_bps: None,
airdrop_mint_price_amount: None,
}
}
}

// Custom params set to a high level function to ease the tests
#[allow(clippy::too_many_arguments)]
pub fn open_edition_minter_custom_template(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub fn send_funds_to_address(app: &mut StargazeApp, target_address_str: &str, am
amount: coins(amount, NATIVE_DENOM),
}
}))
.map_err(|err| println!("{:?}", err))
.map_err(|err| println!("{err:?}"))
.ok();
}

Expand All @@ -43,7 +43,7 @@ pub fn execute_mint_fail_not_on_whitelist(app: &mut StargazeApp, minter_addr: Ad
&coins(MINT_PRICE, NATIVE_DENOM),
);

let expected_error = format!("address not on whitelist: {}", STARGAZE_WALLET_01);
let expected_error = format!("address not on whitelist: {STARGAZE_WALLET_01}");
assert_eq!(res.unwrap_err().root_cause().to_string(), expected_error);
}

Expand Down
4 changes: 2 additions & 2 deletions test-suite/src/sg_eth_airdrop/setup/configure_mock_minter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ use crate::sg_eth_airdrop::setup::mock_whitelist_contract::mock_whitelist;
fn configure_mock_minter(app: &mut StargazeApp, creator: Addr) {
let minter_code_id = app.store_code(mock_minter());

println!("minter_code_id: {}", minter_code_id);
println!("minter_code_id: {minter_code_id}");
let creation_fee = coins(CREATION_FEE, NATIVE_DENOM);

let factory_code_id = app.store_code(contract_vending_factory());
println!("factory_code_id: {}", factory_code_id);
println!("factory_code_id: {factory_code_id}");

let mut params = mock_params(None);
params.code_id = minter_code_id;
Expand Down
2 changes: 1 addition & 1 deletion test-suite/src/sg_eth_airdrop/setup/execute_msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub fn instantiate_contract(params: InstantiateParams) -> Result<cosmwasm_std::A
amount: coins(params.funds_amount, NATIVE_DENOM),
}
}))
.map_err(|err| println!("{:?}", err))
.map_err(|err| println!("{err:?}"))
.ok();

let sg_eth_id = params.app.store_code(contract_eth_airdrop());
Expand Down
2 changes: 1 addition & 1 deletion test-suite/src/sg_eth_airdrop/setup/setup_signatures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn get_wallet_and_sig(
.unwrap()
.to_string();
let eth_address = wallet.address();
let eth_addr_str = format!("{:?}", eth_address);
let eth_addr_str = format!("{eth_address:?}");
(wallet, eth_sig_str, eth_address, eth_addr_str)
}

Expand Down
22 changes: 7 additions & 15 deletions test-suite/src/sg_eth_airdrop/tests/test_claim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ fn test_invalid_eth_sig_claim() {
stargaze_wallet_01,
airdrop_contract,
);
assert_eq!(res, format!("Address {} is not eligible", eth_addr_str));
assert_eq!(res, format!("Address {eth_addr_str} is not eligible"));
}

#[test]
Expand Down Expand Up @@ -276,10 +276,7 @@ fn test_can_not_claim_twice() {
stargaze_wallet_01,
airdrop_contract,
);
let expected_error = format!(
"Address {} has already claimed all available mints",
eth_addr_str
);
let expected_error = format!("Address {eth_addr_str} has already claimed all available mints");
assert_eq!(res, expected_error);
}

Expand Down Expand Up @@ -390,10 +387,7 @@ fn test_claim_twice_receive_funds_once() {
stargaze_wallet_01.clone(),
airdrop_contract,
);
let expected_error = format!(
"Address {} has already claimed all available mints",
eth_addr_str
);
let expected_error = format!("Address {eth_addr_str} has already claimed all available mints");
assert_eq!(res, expected_error);
let balances = app.wrap().query_all_balances(stargaze_wallet_01).unwrap();
let expected_balance = [Coin {
Expand Down Expand Up @@ -445,7 +439,7 @@ fn test_ineligible_does_not_receive_funds() {
stargaze_wallet_02.clone(),
airdrop_contract,
);
let expected_error = format!("Address {} is not eligible", eth_addr_str_2);
let expected_error = format!("Address {eth_addr_str_2} is not eligible");
assert_eq!(res, expected_error);
let balances = app.wrap().query_all_balances(stargaze_wallet_02).unwrap();
let expected_balance = [];
Expand All @@ -463,7 +457,7 @@ fn test_one_eth_claim_two_stargaze_addresses_invalid() {
.unwrap()
.to_string();
let eth_address = wallet_1.address();
let eth_addr_str_1 = format!("{:?}", eth_address);
let eth_addr_str_1 = format!("{eth_address:?}");

let mut app = custom_mock_app();
configure_mock_minter_with_mock_whitelist(&mut app);
Expand Down Expand Up @@ -517,10 +511,8 @@ fn test_one_eth_claim_two_stargaze_addresses_invalid() {
eth_address: eth_addr_str_1.clone(),
eth_sig: eth_sig_str_2,
};
let expected_error = format!(
"Address {} has already claimed all available mints",
eth_addr_str_1
);
let expected_error =
format!("Address {eth_addr_str_1} has already claimed all available mints");
let res_2 = execute_contract_error_with_msg(
claim_message,
&mut app,
Expand Down
2 changes: 1 addition & 1 deletion test-suite/src/splits/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ mod tests {
amount: more_funds.clone(),
}
}))
.map_err(|err| println!("{:?}", err))
.map_err(|err| println!("{err:?}"))
.ok();

// confirm new balance matches
Expand Down

0 comments on commit 9ada038

Please sign in to comment.