pub(crate) fn run_to_block(n: BlockNumber) {
	Staking::on_finalize(System::block_number());
	for b in (System::block_number() + 1)..=n {
		System::set_block_number(b);
		Session::on_initialize(b);
		<Staking as Hooks<u64>>::on_initialize(b);
		Timestamp::set_timestamp(System::block_number() * BLOCK_TIME + INIT_TIMESTAMP);
		if b != n {
			Staking::on_finalize(System::block_number());
		}
	}
}
/// Progress to the given block, triggering session and era changes as we progress.
///
/// This will finalize the previous block, initialize up to the given block, essentially simulating
/// a block import/propose process where we first initialize the block, then execute some stuff (not
/// in the function), and then finalize the block.
Progress to the given block, triggering session and era changes as we progress.
This will finalize the previous block, initialize up to the given block, essentially simulating
a block import/propose process where we first initialize the block, then execute some stuff (not
in the function), and then finalize the block.
Progress to the given block triggering session and era changes as we progress . This will finalize the previous block initialize up to the given block essentially simulating a block import / propose process where we first initialize the block then execute some stuff ( not in the function ) and then finalize the block .
pub(crate) fn run_to_block(n: BlockNumber) {
	Staking::on_finalize(System::block_number());
	for b in (System::block_number() + 1)..=n {
		System::set_block_number(b);
		Session::on_initialize(b);
		<Staking as Hooks<u64>>::on_initialize(b);
		Timestamp::set_timestamp(System::block_number() * BLOCK_TIME + INIT_TIMESTAMP);
		if b != n {
			Staking::on_finalize(System::block_number());
		}
	}
}
pub ( crate ) fn run_to_block ( n : BlockNumber ) { Staking :: on_finalize ( System :: block_number ( ) ) ; for b in ( System :: block_number ( ) + 1 ) ..= n { System :: set_block_number ( b ) ; Session :: on_initialize ( b ) ; < Staking as Hooks < u64 > > :: on_initialize ( b ) ; Timestamp :: set_timestamp ( System :: block_number ( ) * BLOCK_TIME + INIT_TIMESTAMP ) ; if b != n { Staking :: on_finalize ( System :: block_number ( ) ) ; } } }
Progress to the given block, triggering session and era changes as we progress.
Progress to the given block triggering session and era changes as we progress .
n
BlockNumber
n
BlockNumber