diff --git a/parachain/runtime/runtime-tests/src/parachain/issue.rs b/parachain/runtime/runtime-tests/src/parachain/issue.rs index f39486cee1..f08afa49af 100644 --- a/parachain/runtime/runtime-tests/src/parachain/issue.rs +++ b/parachain/runtime/runtime-tests/src/parachain/issue.rs @@ -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!( @@ -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!( diff --git a/parachain/runtime/runtime-tests/src/parachain/nomination.rs b/parachain/runtime/runtime-tests/src/parachain/nomination.rs index 18afc3f0d0..a93f3808b3 100644 --- a/parachain/runtime/runtime-tests/src/parachain/nomination.rs +++ b/parachain/runtime/runtime-tests/src/parachain/nomination.rs @@ -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| { diff --git a/parachain/runtime/runtime-tests/src/parachain/redeem.rs b/parachain/runtime/runtime-tests/src/parachain/redeem.rs index 3b500cf374..76f227de2e 100644 --- a/parachain/runtime/runtime-tests/src/parachain/redeem.rs +++ b/parachain/runtime/runtime-tests/src/parachain/redeem.rs @@ -44,9 +44,6 @@ fn test_with(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) {} - mod spec_based_tests { use primitives::VaultCurrencyPair; @@ -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()); }) ); }); @@ -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()); }) ); }); @@ -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(¤cy_id).unwrap()).free += redeem.premium().unwrap(); - consume_to_be_replaced(vault, burned_amount); }) ); @@ -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()); }) ); }); @@ -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()); }) ); @@ -1548,8 +1538,6 @@ fn integration_test_redeem_wrapped_cancel_no_reimburse() { (*user.balances.get_mut(¤cy_id).unwrap()).free += punishment_fee; vault.backing_collateral -= punishment_fee; - - consume_to_be_replaced(vault, redeem.amount_btc() + redeem.transfer_fee_btc()); }) ); }); @@ -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); }) ); }); @@ -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); }) ); }); diff --git a/parachain/runtime/runtime-tests/src/parachain/vault_registry.rs b/parachain/runtime/runtime-tests/src/parachain/vault_registry.rs index f68c7274ec..3ca02d6e76 100644 --- a/parachain/runtime/runtime-tests/src/parachain/vault_registry.rs +++ b/parachain/runtime/runtime-tests/src/parachain/vault_registry.rs @@ -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!(