Skip to content

Commit

Permalink
Fixed some CI clippy errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Aug 2, 2023
1 parent 233fba1 commit d54b5de
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions contracts/dao-dao-core/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,7 @@ fn test_admin_permissions() {
);

// DAO unpauses after 10 blocks
app.update_block(|mut block| block.height += 11);
app.update_block(|block| block.height += 11);

// Admin can nominate a new admin.
let res = app.execute_contract(
Expand Down Expand Up @@ -1414,7 +1414,7 @@ fn test_admin_nomination() {
);

// DAO unpauses after 10 blocks
app.update_block(|mut block| block.height += 11);
app.update_block(|block| block.height += 11);

// Remove the admin.
app.execute_contract(
Expand Down Expand Up @@ -2428,7 +2428,7 @@ fn test_pause() {

assert!(matches!(err, ContractError::Paused { .. }));

app.update_block(|mut block| block.height += 9);
app.update_block(|block| block.height += 9);

// Still not unpaused.
let err: ContractError = app
Expand All @@ -2454,7 +2454,7 @@ fn test_pause() {

assert!(matches!(err, ContractError::Paused { .. }));

app.update_block(|mut block| block.height += 1);
app.update_block(|block| block.height += 1);

let paused: PauseInfoResponse = app
.wrap()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ pub fn test_claim_lots_of_native_tokens() {
.unwrap();
}

app.update_block(|mut block| block.height += 11);
app.update_block(|block| block.height += 11);

app.execute_contract(
Addr::unchecked("bekauz"),
Expand Down Expand Up @@ -276,7 +276,7 @@ pub fn test_claim_lots_of_cw20s() {
})
.collect();

app.update_block(|mut block| block.height += 11);
app.update_block(|block| block.height += 11);

app.execute_contract(
Addr::unchecked("bekauz"),
Expand Down
18 changes: 9 additions & 9 deletions contracts/external/cw-fund-distributor/src/testing/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ pub fn test_claim_cw20() {
let balance = query_cw20_balance(&mut app, token_address.clone(), distributor_address.clone());

assert_eq!(balance.balance, amount);
app.update_block(|mut block| block.height += 11);
app.update_block(|block| block.height += 11);

// claim the tokens
// should result in an entitlement of (10/(10 + 20))%
Expand Down Expand Up @@ -654,7 +654,7 @@ pub fn test_claim_cw20_twice() {

assert_eq!(balance.balance, amount);

app.update_block(|mut block| block.height += 11);
app.update_block(|block| block.height += 11);

// claim the tokens twice
app.execute_contract(
Expand Down Expand Up @@ -767,7 +767,7 @@ pub fn test_claim_natives_twice() {
Addr::unchecked(CREATOR_ADDR),
);

app.update_block(|mut block| block.height += 11);
app.update_block(|block| block.height += 11);

// claim twice
app.execute_contract(
Expand Down Expand Up @@ -830,7 +830,7 @@ pub fn test_claim_natives() {
Addr::unchecked(CREATOR_ADDR),
);

app.update_block(|mut block| block.height += 11);
app.update_block(|block| block.height += 11);

app.execute_contract(
Addr::unchecked("bekauz"),
Expand Down Expand Up @@ -898,7 +898,7 @@ pub fn test_claim_all() {
);

// claiming period
app.update_block(|mut block| block.height += 11);
app.update_block(|block| block.height += 11);

app.execute_contract(
Addr::unchecked("bekauz"),
Expand Down Expand Up @@ -963,7 +963,7 @@ pub fn test_claim_natives_empty_list_of_denoms() {
Addr::unchecked(CREATOR_ADDR),
);

app.update_block(|mut block| block.height += 11);
app.update_block(|block| block.height += 11);

let err: ContractError = app
.execute_contract(
Expand Down Expand Up @@ -1013,7 +1013,7 @@ pub fn test_redistribute_unclaimed_funds() {
Addr::unchecked(CREATOR_ADDR),
);

app.update_block(|mut block| block.height += 11);
app.update_block(|block| block.height += 11);

// claim the initial allocation equal to 1/3rd of 500000
app.execute_contract(
Expand Down Expand Up @@ -1286,7 +1286,7 @@ pub fn test_fund_cw20_during_claiming_period() {
);

// skip into the claiming period
app.update_block(|mut block| block.height += 11);
app.update_block(|block| block.height += 11);

// attempt to fund the contract
let err: ContractError = app
Expand Down Expand Up @@ -1323,7 +1323,7 @@ pub fn test_fund_natives_during_claiming_period() {
mint_natives(&mut app, Addr::unchecked(CREATOR_ADDR), amount);

// skip into the claim period
app.update_block(|mut block| block.height += 11);
app.update_block(|block| block.height += 11);

// attempt to fund
let err: ContractError = app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ fn test_min_voting_period_no_early_pass() {
let proposal_response = query_proposal(&app, &proposal_module, proposal_id);
assert_eq!(proposal_response.proposal.status, Status::Open);

app.update_block(|mut block| block.height += 10);
app.update_block(|block| block.height += 10);
let proposal_response = query_proposal(&app, &proposal_module, proposal_id);
assert_eq!(proposal_response.proposal.status, Status::Passed);
}
Expand Down
14 changes: 7 additions & 7 deletions contracts/staking/cw20-stake-reward-distributor/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ fn test_distribute() {
app.execute_contract(Addr::unchecked(OWNER), cw20_addr.clone(), &msg, &[])
.unwrap();

app.update_block(|mut block| block.height += 10);
app.update_block(|block| block.height += 10);
app.execute_contract(
Addr::unchecked(OWNER),
distributor_addr.clone(),
Expand All @@ -262,7 +262,7 @@ fn test_distribute() {
assert_eq!(distributor_info.balance, Uint128::new(990));
assert_eq!(distributor_info.last_payment_block, app.block_info().height);

app.update_block(|mut block| block.height += 500);
app.update_block(|block| block.height += 500);
app.execute_contract(
Addr::unchecked(OWNER),
distributor_addr.clone(),
Expand All @@ -278,7 +278,7 @@ fn test_distribute() {
assert_eq!(distributor_info.balance, Uint128::new(490));
assert_eq!(distributor_info.last_payment_block, app.block_info().height);

app.update_block(|mut block| block.height += 1000);
app.update_block(|block| block.height += 1000);
app.execute_contract(
Addr::unchecked(OWNER),
distributor_addr.clone(),
Expand All @@ -296,7 +296,7 @@ fn test_distribute() {
let last_payment_block = distributor_info.last_payment_block;

// Pays out nothing
app.update_block(|mut block| block.height += 1100);
app.update_block(|block| block.height += 1100);
let err: ContractError = app
.execute_contract(
Addr::unchecked(OWNER),
Expand All @@ -318,7 +318,7 @@ fn test_distribute() {
assert_eq!(distributor_info.last_payment_block, last_payment_block);

// go to a block before the last payment
app.update_block(|mut block| block.height -= 2000);
app.update_block(|block| block.height -= 2000);
let err: ContractError = app
.execute_contract(
Addr::unchecked(OWNER),
Expand Down Expand Up @@ -458,7 +458,7 @@ fn test_withdraw() {
app.execute_contract(Addr::unchecked(OWNER), cw20_addr.clone(), &msg, &[])
.unwrap();

app.update_block(|mut block| block.height += 10);
app.update_block(|block| block.height += 10);
app.execute_contract(
Addr::unchecked(OWNER),
distributor_addr.clone(),
Expand Down Expand Up @@ -541,7 +541,7 @@ fn test_dao_deploy() {
app.execute_contract(Addr::unchecked(OWNER), cw20_addr.clone(), &msg, &[])
.unwrap();

app.update_block(|mut block| block.height += 10);
app.update_block(|block| block.height += 10);
app.execute_contract(
Addr::unchecked(OWNER),
distributor_addr.clone(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ fn test_update_config() -> anyhow::Result<()> {
);

let info = app.block_info();
app.update_block(|mut block| {
app.update_block(|block| {
block.height += 3;
block.time = match Duration::Time(1).after(&info) {
cw_utils::Expiration::AtTime(timestamp) => timestamp,
Expand Down

0 comments on commit d54b5de

Please sign in to comment.