Skip to content

Commit

Permalink
chore: rename ElectoralSystemStatus -> ElectionPalletStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
kylezs committed Oct 30, 2024
1 parent 7c403b5 commit 92ab020
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions state-chain/pallets/cf-elections/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ mod benchmarks {

T::EpochInfo::add_authority_info_for_epoch(epoch, vec![validator_id.clone()]);

Status::<T, I>::put(ElectoralSystemStatus::Running);
Status::<T, I>::put(ElectionPalletStatus::Running);

#[extrinsic_call]
stop_ignoring_my_votes(RawOrigin::Signed(caller));
Expand All @@ -141,7 +141,7 @@ mod benchmarks {

T::EpochInfo::add_authority_info_for_epoch(epoch, vec![validator_id.clone()]);

Status::<T, I>::put(ElectoralSystemStatus::Running);
Status::<T, I>::put(ElectionPalletStatus::Running);

assert!(
!ContributingAuthorities::<T, I>::contains_key(validator_id.clone()),
Expand Down Expand Up @@ -274,7 +274,7 @@ mod benchmarks {
assert!(ElectoralUnsynchronisedState::<T, I>::get().is_some());
assert!(ElectoralUnsynchronisedSettings::<T, I>::get().is_some());
assert!(ElectoralSettings::<T, I>::get(NextElectionIdentifier::<T, I>::get()).is_some());
assert_eq!(Status::<T, I>::get(), Some(ElectoralSystemStatus::Running));
assert_eq!(Status::<T, I>::get(), Some(ElectionPalletStatus::Running));
}

#[benchmark]
Expand Down Expand Up @@ -403,7 +403,7 @@ mod benchmarks {
// Ensure elections are paused
assert_eq!(
Status::<T, I>::get(),
Some(ElectoralSystemStatus::Paused { detected_corrupt_storage: false })
Some(ElectionPalletStatus::Paused { detected_corrupt_storage: false })
);
}

Expand All @@ -416,7 +416,7 @@ mod benchmarks {
.dispatch_bypass_filter(T::EnsureGovernance::try_successful_origin().unwrap()));
assert_eq!(
Status::<T, I>::get(),
Some(ElectoralSystemStatus::Paused { detected_corrupt_storage: false })
Some(ElectionPalletStatus::Paused { detected_corrupt_storage: false })
);
assert_ok!(Call::<T, I>::clear_all_votes {
limit: 100u32,
Expand All @@ -434,7 +434,7 @@ mod benchmarks {
}

// Ensure elections are unpaused
assert_eq!(Status::<T, I>::get(), Some(ElectoralSystemStatus::Running));
assert_eq!(Status::<T, I>::get(), Some(ElectionPalletStatus::Running));
}

#[benchmark]
Expand All @@ -444,7 +444,7 @@ mod benchmarks {
// Pause the election, and set corrupt storage to `true`
assert_ok!(Call::<T, I>::pause_elections {}
.dispatch_bypass_filter(T::EnsureGovernance::try_successful_origin().unwrap()));
Status::<T, I>::put(ElectoralSystemStatus::Paused { detected_corrupt_storage: true });
Status::<T, I>::put(ElectionPalletStatus::Paused { detected_corrupt_storage: true });

let call = Call::<T, I>::validate_storage {};

Expand All @@ -457,7 +457,7 @@ mod benchmarks {

assert_eq!(
Status::<T, I>::get(),
Some(ElectoralSystemStatus::Paused { detected_corrupt_storage: false })
Some(ElectionPalletStatus::Paused { detected_corrupt_storage: false })
);
}

Expand Down
2 changes: 1 addition & 1 deletion state-chain/pallets/cf-elections/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl ElectoralSystemTestExt for TestRunner<TestContext> {
.expect("New election should have an identifier.")
.unique_monotonic();

assert_eq!(Status::<Test, Instance1>::get(), Some(ElectoralSystemStatus::Running));
assert_eq!(Status::<Test, Instance1>::get(), Some(ElectionPalletStatus::Running));

Pallet::<Test, Instance1>::with_electoral_access(|electoral_access| {
electoral_access
Expand Down

0 comments on commit 92ab020

Please sign in to comment.