Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseAbram committed Aug 6, 2024
1 parent fc3b1ed commit 0942869
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pallets/staking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
pallet_parameters::GenesisConfig::<Test> {
request_limit: 5u32,
max_instructions_per_programs: 5u64,
total_signers: 2u8,
total_signers: 3u8,
threshold: 2u8,
_config: Default::default(),
}
Expand Down
11 changes: 6 additions & 5 deletions pallets/staking/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,12 @@ fn it_tests_new_session_handler() {

System::set_block_number(100);

pallet_parameters::SignersInfo::<Test>::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]);
Expand Down Expand Up @@ -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::<Test>::put(vec![5, 6]);

pallet_parameters::SignersInfo::<Test>::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]);
Expand Down

0 comments on commit 0942869

Please sign in to comment.