Skip to content

Commit

Permalink
fix: add missing assert statement
Browse files Browse the repository at this point in the history
  • Loading branch information
nakul1010 committed Dec 11, 2023
1 parent be533c3 commit bb88f6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions crates/redeem/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ use vault_registry::{
// Pallets
use crate::Pallet as Redeem;
use btc_relay::Pallet as BtcRelay;
use oracle::Pallet as Oracle;
use oracle::{OracleKey, Pallet as Oracle};
use security::Pallet as Security;
use vault_registry::Pallet as VaultRegistry;
use oracle::OracleKey;
use sp_runtime::FixedPointNumber;
use vault_registry::Pallet as VaultRegistry;
type UnsignedFixedPoint<T> = <T as currency::Config>::UnsignedFixedPoint;

fn collateral<T: crate::Config>(amount: u32) -> Amount<T> {
Expand Down
6 changes: 3 additions & 3 deletions parachain/runtime/runtime-tests/src/parachain/redeem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,11 @@ mod premium_redeem_tests {
let redeem_1 = RedeemPallet::get_open_redeem_request_from_id(&redeem_id_1).unwrap();
// recv premium should be equal to max premium
assert_eq!(redeem_1.premium, max_premium_for_vault.amount());
assert!(redeem_1.premium > 0);
assert!(!redeem_1.premium.is_zero());

// max premium for vault should be zero
let max_premium_for_vault = VaultRegistryPallet::get_vault_max_premium_redeem(&vault_id).unwrap();
assert_eq!(max_premium_for_vault.amount(), 0);
assert!(max_premium_for_vault.amount().is_zero());

// redeeming the max premium amount put backs vault above premium threshold
// vault should be below secure threshold, while above global secure & premium threshold
Expand All @@ -245,7 +245,7 @@ mod premium_redeem_tests {
let redeem_id_2 = setup_redeem(vault_id.wrapped(800_00), USER, &vault_id);
let redeem_2 = RedeemPallet::get_open_redeem_request_from_id(&redeem_id_2).unwrap();
// no premium is given out for new redeems
assert_eq!(redeem_2.premium, 0);
assert!(redeem_2.premium.is_zero());
});
}
#[test]
Expand Down

0 comments on commit bb88f6b

Please sign in to comment.