Skip to content
Snippets Groups Projects
Commit a62d6247 authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

update distance setup handler

parent ca975dfd
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,7 @@ benchmarks_instance_pallet! {
Membership::<T, I>::take(idty);
let caller: T::AccountId = T::AccountIdOf::convert(idty).unwrap();
let caller_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into();
T::BenchmarkSetupHandler::force_status_ok(&idty, &caller);
T::BenchmarkSetupHandler::force_valid_distance_status(&idty);
}: _<T::RuntimeOrigin>(caller_origin)
verify {
assert_has_event::<T, I>(Event::<T, I>::MembershipAdded{member: idty, expire_on: BlockNumberFor::<T>::one() + T::MembershipPeriod::get()}.into());
......@@ -56,7 +56,7 @@ benchmarks_instance_pallet! {
let idty: T::IdtyId = 3.into();
let caller: T::AccountId = T::AccountIdOf::convert(idty).unwrap();
let caller_origin: <T as frame_system::Config>::RuntimeOrigin = RawOrigin::Signed(caller.clone()).into();
T::BenchmarkSetupHandler::force_status_ok(&idty, &caller);
T::BenchmarkSetupHandler::force_valid_distance_status(&idty);
}: _<T::RuntimeOrigin>(caller_origin)
verify {
assert_has_event::<T, I>(Event::<T, I>::MembershipAdded{member: idty, expire_on: BlockNumberFor::<T>::one() + T::MembershipPeriod::get()}.into());
......
......@@ -44,13 +44,13 @@ use std::collections::BTreeMap;
#[cfg(feature = "runtime-benchmarks")]
pub trait SetupBenchmark<IdtyId, AccountId> {
fn force_status_ok(idty_index: &IdtyId, account: &AccountId);
fn force_valid_distance_status(idty_index: &IdtyId);
fn add_cert(_issuer: &IdtyId, _receiver: &IdtyId);
}
#[cfg(feature = "runtime-benchmarks")]
impl<IdtyId, AccountId> SetupBenchmark<IdtyId, AccountId> for () {
fn force_status_ok(_idty_id: &IdtyId, _account: &AccountId) {}
fn force_valid_distance_status(_idty_id: &IdtyId) {}
fn add_cert(_issuer: &IdtyId, _receiver: &IdtyId) {}
}
......
......@@ -104,9 +104,8 @@ macro_rules! impl_benchmark_setup_handler {
T: pallet_certification::Config<frame_support::instances::Instance1>,
<T as pallet_certification::Config<frame_support::instances::Instance1>>::IdtyIndex: From<u32>,
{
fn force_status_ok(
fn force_valid_distance_status(
idty_id: &IdtyIndex,
account: &<T as frame_system::Config>::AccountId,
) -> () {
let _ = pallet_distance::Pallet::<T>::do_valid_distance_status(
*idty_id, None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment