mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-10 00:38:07 +00:00
benchmarks: EnsureRankedMember must add ranked members (#13297)
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
committed by
GitHub
parent
4b2cc67fc6
commit
a5178eab9f
@@ -256,8 +256,7 @@ impl<T: Config<I>, I: 'static, const MIN_RANK: u16> EnsureOrigin<T::RuntimeOrigi
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
fn try_successful_origin() -> Result<T::RuntimeOrigin, ()> {
|
||||
let who = IndexToId::<T, I>::get(MIN_RANK, 0).ok_or(())?;
|
||||
Ok(frame_system::RawOrigin::Signed(who).into())
|
||||
EnsureRankedMember::<T, I, MIN_RANK>::try_successful_origin()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,8 +278,7 @@ impl<T: Config<I>, I: 'static, const MIN_RANK: u16> EnsureOrigin<T::RuntimeOrigi
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
fn try_successful_origin() -> Result<T::RuntimeOrigin, ()> {
|
||||
let who = IndexToId::<T, I>::get(MIN_RANK, 0).ok_or(())?;
|
||||
Ok(frame_system::RawOrigin::Signed(who).into())
|
||||
EnsureRankedMember::<T, I, MIN_RANK>::try_successful_origin()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,7 +300,9 @@ impl<T: Config<I>, I: 'static, const MIN_RANK: u16> EnsureOrigin<T::RuntimeOrigi
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
fn try_successful_origin() -> Result<T::RuntimeOrigin, ()> {
|
||||
let who = IndexToId::<T, I>::get(MIN_RANK, 0).ok_or(())?;
|
||||
let who = frame_benchmarking::account::<T::AccountId>("successful_origin", 0, 0);
|
||||
crate::Pallet::<T, I>::do_add_member_to_rank(who.clone(), MIN_RANK)
|
||||
.expect("Could not add members for benchmarks");
|
||||
Ok(frame_system::RawOrigin::Signed(who).into())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user