Skip to content

Commit

Permalink
fix: removed clippy warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
nakul1010 committed Aug 13, 2023
1 parent b8de7f5 commit 20dbbd1
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 24 deletions.
4 changes: 2 additions & 2 deletions parachain/runtime/runtime-tests/src/parachain/issue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ mod request_issue_tests {

// give the vault a lot of griefing collateral, to check that this isn't available for backing new tokens
let vault_id = vault_id;
let mut vault_data = CoreVaultData::vault(vault_id.clone());
let vault_data = CoreVaultData::vault(vault_id.clone());
CoreVaultData::force_to(&vault_id, vault_data);

assert_noop!(
Expand Down Expand Up @@ -327,7 +327,7 @@ mod request_issue_tests {

// give the vault a lot of griefing collateral, to check that this isn't available for backing new tokens
let vault_id = vault_id;
let mut vault_data = CoreVaultData::vault(vault_id.clone());
let vault_data = CoreVaultData::vault(vault_id.clone());
CoreVaultData::force_to(&vault_id, vault_data);

assert_noop!(
Expand Down
7 changes: 0 additions & 7 deletions parachain/runtime/runtime-tests/src/parachain/nomination.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,13 +448,6 @@ fn integration_test_nominated_collateral_prevents_replace_requests() {
});
}

#[test]
fn integration_test_vaults_with_zero_nomination_cannot_request_replacement() {
test_with_nomination_enabled_and_vault_opted_in(|vault_id| {
let amount = DEFAULT_VAULT_ISSUED - DEFAULT_VAULT_TO_BE_REDEEMED - DEFAULT_VAULT_TO_BE_REPLACED;
});
}

#[test]
fn integration_test_nomination_increases_issuable_tokens() {
test_with_nomination_enabled_and_vault_opted_in(|vault_id| {
Expand Down
14 changes: 0 additions & 14 deletions parachain/runtime/runtime-tests/src/parachain/redeem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ fn test_with<R>(execute: impl Fn(VaultId) -> R) {
test_with(LendToken(1), Token(IBTC), None);
}

/// to-be-replaced & replace_collateral are decreased in request_redeem
fn consume_to_be_replaced(vault: &mut CoreVaultData, amount_btc: Amount<Runtime>) {}

mod spec_based_tests {
use primitives::VaultCurrencyPair;

Expand Down Expand Up @@ -105,7 +102,6 @@ mod spec_based_tests {
redeem.amount_btc() + redeem.transfer_fee_btc() + redeem.fee();
(*user.balances.get_mut(&vault_id.wrapped_currency()).unwrap()).locked +=
redeem.amount_btc() + redeem.transfer_fee_btc() + redeem.fee();
consume_to_be_replaced(vault, redeem.amount_btc());
})
);
});
Expand Down Expand Up @@ -1148,7 +1144,6 @@ fn integration_test_redeem_execute_succeeds() {
vault.issued -= redeem.amount_btc() + redeem.transfer_fee_btc();
(*user.balances.get_mut(&vault_id.wrapped_currency()).unwrap()).free -= issued_tokens;
*fee_pool.rewards_for(&vault_id) += redeem.fee();
consume_to_be_replaced(vault, redeem.amount_btc() + redeem.transfer_fee_btc());
})
);
});
Expand Down Expand Up @@ -1232,7 +1227,6 @@ fn integration_test_premium_redeem_wrapped_execute() {
// premium is moved from vault to user
vault.backing_collateral -= redeem.premium().unwrap();
(*user.balances.get_mut(&currency_id).unwrap()).free += redeem.premium().unwrap();
consume_to_be_replaced(vault, burned_amount);
})
);

Expand Down Expand Up @@ -1436,8 +1430,6 @@ fn integration_test_redeem_wrapped_cancel_reimburse_sufficient_collateral_for_wr
(*user.balances.get_mut(&vault_id.wrapped_currency()).unwrap()).free -= amount_btc;

*fee_pool.rewards_for(&vault_id) += redeem.fee();

consume_to_be_replaced(vault, redeem.amount_btc() + redeem.transfer_fee_btc());
})
);
});
Expand Down Expand Up @@ -1489,8 +1481,6 @@ fn integration_test_redeem_wrapped_cancel_reimburse_insufficient_collateral_for_
(*user.balances.get_mut(&vault_id.wrapped_currency()).unwrap()).free -= amount_btc;

*fee_pool.rewards_for(&vault_id) += redeem.fee();

consume_to_be_replaced(vault, redeem.amount_btc() + redeem.transfer_fee_btc());
})
);

Expand Down Expand Up @@ -1548,8 +1538,6 @@ fn integration_test_redeem_wrapped_cancel_no_reimburse() {
(*user.balances.get_mut(&currency_id).unwrap()).free += punishment_fee;

vault.backing_collateral -= punishment_fee;

consume_to_be_replaced(vault, redeem.amount_btc() + redeem.transfer_fee_btc());
})
);
});
Expand Down Expand Up @@ -1995,7 +1983,6 @@ mod self_redeem {
vault.issued -= consumed_issued_tokens;
(*vault.free_balance.get_mut(&vault_id.wrapped_currency()).unwrap()) -= issued_tokens;
*fee_pool.rewards_for(&vault_id) += fee;
consume_to_be_replaced(vault, consumed_issued_tokens);
})
);
});
Expand All @@ -2018,7 +2005,6 @@ mod self_redeem {
ParachainState::get_default(&vault_id).with_changes(|_, vault, _, _| {
vault.issued -= issued_tokens;
(*vault.free_balance.get_mut(&vault_id.wrapped_currency()).unwrap()) -= issued_tokens;
consume_to_be_replaced(vault, issued_tokens);
})
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ mod withdraw_collateral_test {
fn integration_test_vault_registry_undercollateralization_liquidation() {
test_with(|vault_id| {
let currency_id = vault_id.collateral_currency();
let vault_data = default_vault_state(&vault_id);
liquidate_vault(&vault_id);

assert_eq!(
Expand Down

0 comments on commit 20dbbd1

Please sign in to comment.