From 464d53e00b45e097ce355aa649949d491ae1d5a6 Mon Sep 17 00:00:00 2001 From: Xavier Lau Date: Sat, 11 Jan 2025 15:56:32 +0800 Subject: [PATCH] Avoiding maintain different `run_to_block` --- substrate/frame/staking/src/mock.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/substrate/frame/staking/src/mock.rs b/substrate/frame/staking/src/mock.rs index a80c6598ede2..769b84826b41 100644 --- a/substrate/frame/staking/src/mock.rs +++ b/substrate/frame/staking/src/mock.rs @@ -545,7 +545,9 @@ impl ExtBuilder { if self.initialize_first_session { ext.execute_with(|| { - System::run_to_block::(1); + run_to_block(1); + + // Force reset the timestamp to the initial timestamp for easy testing. Timestamp::set_timestamp(INIT_TIMESTAMP); }); }