mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-16 15:31:10 +00:00
Add Storage Info to Various Pallets (#10810)
* atomic swap * bounties * bounties fmt * gilt * indices * nicks * randomness-collective-flip * recovery * reuse maxapprovals * Update tests.rs * Update frame/randomness-collective-flip/src/lib.rs Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * use the correct bound * complete recovery * use `bounded_vec` macro * Update tests.rs * transaction payment * uniques * mmr * example offchain worker * beefy-mmr * Update frame/recovery/src/lib.rs Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use BoundedVec instead of a type-parameterized BoundedString * cargo fmt * Update frame/atomic-swap/src/lib.rs * use config const * Update lib.rs * update mel_bound * fmt Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
//! Tests for the module.
|
||||
|
||||
use super::*;
|
||||
use frame_support::{assert_noop, assert_ok, traits::Currency};
|
||||
use frame_support::{assert_noop, assert_ok, bounded_vec, traits::Currency};
|
||||
use mock::{
|
||||
new_test_ext, run_to_block, Balances, BalancesCall, Call, Origin, Recovery, RecoveryCall, Test,
|
||||
};
|
||||
@@ -201,8 +201,12 @@ fn create_recovery_works() {
|
||||
// Base 10 + 1 per friends = 13 total reserved
|
||||
assert_eq!(Balances::reserved_balance(5), 13);
|
||||
// Recovery configuration is correctly stored
|
||||
let recovery_config =
|
||||
RecoveryConfig { delay_period, deposit: 13, friends: friends.clone(), threshold };
|
||||
let recovery_config = RecoveryConfig {
|
||||
delay_period,
|
||||
deposit: 13,
|
||||
friends: friends.try_into().unwrap(),
|
||||
threshold,
|
||||
};
|
||||
assert_eq!(Recovery::recovery_config(5), Some(recovery_config));
|
||||
});
|
||||
}
|
||||
@@ -254,7 +258,8 @@ fn initiate_recovery_works() {
|
||||
// Deposit is reserved
|
||||
assert_eq!(Balances::reserved_balance(1), 10);
|
||||
// Recovery status object is created correctly
|
||||
let recovery_status = ActiveRecovery { created: 0, deposit: 10, friends: vec![] };
|
||||
let recovery_status =
|
||||
ActiveRecovery { created: 0, deposit: 10, friends: Default::default() };
|
||||
assert_eq!(<ActiveRecoveries<Test>>::get(&5, &1), Some(recovery_status));
|
||||
// Multiple users can attempt to recover the same account
|
||||
assert_ok!(Recovery::initiate_recovery(Origin::signed(2), 5));
|
||||
@@ -314,7 +319,8 @@ fn vouch_recovery_works() {
|
||||
assert_ok!(Recovery::vouch_recovery(Origin::signed(4), 5, 1));
|
||||
assert_ok!(Recovery::vouch_recovery(Origin::signed(3), 5, 1));
|
||||
// Final recovery status object is updated correctly
|
||||
let recovery_status = ActiveRecovery { created: 0, deposit: 10, friends: vec![2, 3, 4] };
|
||||
let recovery_status =
|
||||
ActiveRecovery { created: 0, deposit: 10, friends: bounded_vec![2, 3, 4] };
|
||||
assert_eq!(<ActiveRecoveries<Test>>::get(&5, &1), Some(recovery_status));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user