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

Commit

Permalink
fix auth-slot-filter benchmarks (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbaztec authored Apr 7, 2022
1 parent 30e587e commit df9d214
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit df9d214

Please sign in to comment.