You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In benchmark-tests and runs the block number is set implicitly to 1 after the setup if it was 0.
This is confusing since normally the user must set it manually in the TestExternalties.
Could be changed to either:
Never touch the block-number and let the user deal with it - same as in tests
Always set the block-number to one before the setup
Two benchmark tests to demonstrate the current behaviour:
block_jumps_to_one{// Starts at block 0.
assert_eq!(frame_system::Pallet::<T>::block_number(),0u32.into());}:{// Why does it jump to one?assert_eq!(frame_system::Pallet::<T>::block_number(),1u32.into());}block_does_not_jump_back{// Jump to block 2.frame_system::Pallet::<T>::set_block_number(2u32.into());}:{// Why does it NOT jump back to one?assert_eq!(frame_system::Pallet::<T>::block_number(),2u32.into());}
In benchmark-tests and runs the block number is set implicitly to
1
after the setup if it was0
.This is confusing since normally the user must set it manually in the
TestExternalties
.Could be changed to either:
Two benchmark tests to demonstrate the current behaviour:
Came up again here https://substrate.stackexchange.com/questions/5516
The text was updated successfully, but these errors were encountered: