test: benchmark for vault liquidation
@@ -46,6 +46,19 @@ benchmarks! {
VaultRegistry::<T>::insert_vault(&origin, vault);
}: _(RawOrigin::Signed(origin), BtcPublicKey::default())
+ liquidate_undercollateralized_vaults {
+ let u in 0 .. 100;
+
+ for i in 0..u {
+ let mut vault = Vault::default();
+ let origin: T::AccountId = account("Origin", i, 0);
+ vault.id = origin.clone();
+ vault.wallet = Wallet::new(BtcPublicKey::default());
+ VaultRegistry::<T>::insert_vault(&origin, vault);
+ }
+ }: {
+ VaultRegistry::<T>::liquidate_undercollateralized_vaults()
+ }
}
#[cfg(test)]
@@ -66,6 +79,7 @@ mod tests {
assert_ok!(test_benchmark_lock_additional_collateral::<Test>());
assert_ok!(test_benchmark_withdraw_collateral::<Test>());
assert_ok!(test_benchmark_update_public_key::<Test>());
+ assert_ok!(test_benchmark_liquidate_undercollateralized_vaults::<Test>());
});
}
}
