Skip to content

Commit e4d0387

Browse files
committed
improve the test a bit
1 parent c3d8618 commit e4d0387

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

polkadot/runtime/westend/src/tests.rs

+17-4
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,14 @@ mod remote_tests {
263263
transport,
264264
state_snapshot: maybe_state_snapshot.clone(),
265265
child_trie: false,
266-
pallets: vec!["Staking".into(), "System".into(), "Balances".into()],
266+
pallets: vec![
267+
"Staking".into(),
268+
"System".into(),
269+
"Balances".into(),
270+
"NominationPools".into(),
271+
"DelegatedStaking".into(),
272+
"VoterList".into(),
273+
],
267274
..Default::default()
268275
};
269276
let mut ext = Builder::<Block>::default()
@@ -288,7 +295,9 @@ mod remote_tests {
288295
let mut err = 0;
289296
let mut no_migration_needed = 0;
290297
let mut force_withdraw_acc = 0;
291-
// iterate over all pools
298+
let mut force_withdraw_count = 0;
299+
let mut max_force_withdraw = 0;
300+
// iterate over all stakers
292301
pallet_staking::Ledger::<Runtime>::iter().for_each(|(ctrl, ledger)| {
293302
match pallet_staking::Pallet::<Runtime>::migrate_currency(
294303
RuntimeOrigin::signed(alice.clone()).into(),
@@ -300,7 +309,9 @@ mod remote_tests {
300309
let force_withdraw = ledger.total - updated_ledger.total;
301310
if force_withdraw > 0 {
302311
force_withdraw_acc += force_withdraw;
303-
log::info!(target: "remote_test", "Force withdraw from stash {:?}: value {:?}", ledger.stash, force_withdraw);
312+
force_withdraw_count += 1;
313+
max_force_withdraw = max_force_withdraw.max(force_withdraw);
314+
log::debug!(target: "remote_test", "Force withdraw from stash {:?}: value {:?}", ledger.stash, force_withdraw);
304315
}
305316
success += 1;
306317
},
@@ -317,10 +328,12 @@ mod remote_tests {
317328

318329
log::info!(
319330
target: "remote_test",
320-
"Migration stats: success: {}, err: {}, total force withdrawn stake: {}, no_migration_needed: {}",
331+
"Migration stats: success: {}, err: {}, total force withdrawn stake: {}, count {}, maximum amount {}, no_migration_needed: {}",
321332
success,
322333
err,
323334
force_withdraw_acc,
335+
force_withdraw_count,
336+
max_force_withdraw,
324337
no_migration_needed
325338
);
326339
});

0 commit comments

Comments
 (0)