Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.

fix auth-slot-filter benchmarks #45

Merged
merged 2 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pallets/author-slot-filter/src/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@

#![cfg(feature = "runtime-benchmarks")]

use crate::num::NonZeroU32;
use crate::{Call, Config, Pallet};
use frame_benchmarking::{benchmarks, impl_benchmark_test_suite};
use frame_system::RawOrigin;
use sp_runtime::Percent;

benchmarks! {
set_eligible {
let percent = Percent::from_percent(34);
}: _(RawOrigin::Root, percent.clone())
let count = NonZeroU32::new_unchecked(34);
}: _(RawOrigin::Root, count.clone())
verify {
assert_eq!(Pallet::<T>::eligible_ratio(), percent);
assert_eq!(Pallet::<T>::eligible_count(), count);
}
}

Expand Down
2 changes: 1 addition & 1 deletion pallets/author-slot-filter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pub mod pallet {

#[pallet::storage]
#[pallet::getter(fn eligible_ratio)]
#[deprecated]
#[deprecated(note = "use `pallet::EligibleCount` instead")]
pub type EligibleRatio<T: Config> = StorageValue<_, Percent, ValueQuery, Half<T>>;

// Default value for the `EligibleRatio` is one half.
Expand Down