diff --git a/pallets/staking/src/mock.rs b/pallets/staking/src/mock.rs index ad0c09569..372866da4 100644 --- a/pallets/staking/src/mock.rs +++ b/pallets/staking/src/mock.rs @@ -409,7 +409,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities { pallet_parameters::GenesisConfig:: { request_limit: 5u32, max_instructions_per_programs: 5u64, - total_signers: 2u8, + total_signers: 3u8, threshold: 2u8, _config: Default::default(), } diff --git a/pallets/staking/src/tests.rs b/pallets/staking/src/tests.rs index 9eb108635..a6639b9f5 100644 --- a/pallets/staking/src/tests.rs +++ b/pallets/staking/src/tests.rs @@ -345,6 +345,12 @@ fn it_tests_new_session_handler() { System::set_block_number(100); + pallet_parameters::SignersInfo::::put(SignersSize { + total_signers: 2, + threshold: 2, + last_session_change: 0, + }); + assert_ok!(Staking::new_session_handler(&[1, 2, 3])); // takes signers original (5,6) pops off first 5, adds (fake randomness in mock so adds 1) assert_eq!(Staking::next_signers().unwrap().next_signers, vec![6, 1]); @@ -392,11 +398,6 @@ fn it_tests_new_session_handler_signer_size_changes() { // Start with current validators as 5 and 6 based off the Mock `GenesisConfig`. Signers::::put(vec![5, 6]); - pallet_parameters::SignersInfo::::put(SignersSize { - total_signers: 3, - threshold: 2, - last_session_change: 0, - }); assert_ok!(Staking::new_session_handler(&[6, 5, 3, 4])); // Signer size increased is reflected as 5 is not removed from vec assert_eq!(Staking::next_signers().unwrap().next_signers, vec![5, 6, 3]);