Skip to content

Commit

Permalink
benchmarking
Browse files Browse the repository at this point in the history
  • Loading branch information
cuteolaf committed Aug 8, 2024
1 parent 9407345 commit de5c060
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pallets/regions/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,24 @@ mod benchmarks {
Ok(())
}

#[benchmark]
fn drop_region() -> Result<(), BenchmarkError> {
let caller: T::AccountId = whitelisted_caller();
let region_id = RegionId { begin: 1, core: 72, mask: CoreMask::complete() };
let record: RegionRecordOf<Test> = RegionRecord { end: 2, owner: 1, paid: None };

assert_ok!(crate::Pallet::<T>::mint_into(&region_id.into(), &caller));
assert_ok!(crate::Pallet::request_region_record(RawOrigin::None, region_id));
assert_ok!(crate::Pallet::set_record(region_id, record));

#[extrinsic_call]
_(RawOrigin::Signed(caller.clone()), region_id);

assert_last_event::<T>(Event::RegionDropped { region_id, who: caller }.into());

Ok(())
}

#[benchmark]
fn on_accept() -> Result<(), BenchmarkError> {
let module = IsmpModuleCallback::<T>::default();
Expand Down

0 comments on commit de5c060

Please sign in to comment.