Skip to content

Commit

Permalink
fix: test case
Browse files Browse the repository at this point in the history
  • Loading branch information
nakul1010 committed Dec 13, 2023
1 parent c3edd9a commit e03b3df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/redeem/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ where
#[method(name = "redeem_getVaultRedeemRequests")]
fn get_vault_redeem_requests(&self, vault_id: AccountId, at: Option<BlockHash>) -> RpcResult<Vec<H256>>;

#[method(name = "redeem_getPremiumRedeemVaults", aliases = ["redeem_getPremiumRedeemVaults"])]
#[method(name = "redeem_getPremiumRedeemVaults", aliases = ["vaultRegistry_getPremiumRedeemVaults"])]
fn get_premium_redeem_vaults(&self, at: Option<BlockHash>) -> RpcResult<Vec<(VaultId, BalanceWrapper<Balance>)>>;
}

Expand Down
11 changes: 6 additions & 5 deletions crates/vault-registry/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,7 @@ mod get_vaults_below_premium_collaterlization_tests {
VaultRegistry::_set_premium_redeem_threshold(DEFAULT_CURRENCY_PAIR, FixedU128::one());
ext::fee::premium_redeem_reward_rate::<Test>.mock_safe(move || MockResult::Return(1.into()));
ext::oracle::get_price::<Test>.mock_safe(move |_| MockResult::Return(Ok(1.into())));
ext::fee::get_redeem_fee_value::<Test>.mock_safe(move || MockResult::Return(FixedU128::from_float(0.005)));

test()
})
Expand All @@ -1019,7 +1020,7 @@ mod get_vaults_below_premium_collaterlization_tests {
add_vault(vault_id(4), 50, 100);

assert_err!(
VaultRegistry::get_premium_redeem_vaults(400_u32),
VaultRegistry::get_premium_redeem_vaults(0_u32),
TestError::NoVaultUnderThePremiumRedeemThreshold
);
})
Expand All @@ -1044,8 +1045,8 @@ mod get_vaults_below_premium_collaterlization_tests {
VaultRegistry::_set_secure_collateral_threshold(DEFAULT_CURRENCY_PAIR, secure);

assert_eq!(
VaultRegistry::get_premium_redeem_vaults(400_u32),
Ok(vec![(id2, wrapped(452)), (id1, wrapped(451))])
VaultRegistry::get_premium_redeem_vaults(0_u32),
Ok(vec![(id2, wrapped(52)), (id1, wrapped(51))])
);
})
}
Expand Down Expand Up @@ -1078,8 +1079,8 @@ mod get_vaults_below_premium_collaterlization_tests {
VaultRegistry::_set_secure_collateral_threshold(DEFAULT_CURRENCY_PAIR, secure);

assert_eq!(
VaultRegistry::get_premium_redeem_vaults(400_u32),
Ok(vec!((id2, wrapped(451))))
VaultRegistry::get_premium_redeem_vaults(0_u32),
Ok(vec!((id2, wrapped(51))))
);
})
}
Expand Down

0 comments on commit e03b3df

Please sign in to comment.