Skip to content

Commit

Permalink
migrate new benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
clangenb committed Nov 28, 2024
1 parent 49a0e84 commit d95c3ce
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions polkadot/xcm/pallet-xcm-benchmarks/src/generic/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,22 +293,22 @@ mod benchmarks {
Ok(())
}

execute_with_origin {
let mut executor = new_executor::<T>(Default::default());
let who: Junctions = Junctions::from([AccountId32 { id: [0u8; 32], network: None }]);
let instruction = Instruction::ExecuteWithOrigin { descendant_origin: Some(who.clone()), xcm: Xcm(vec![]) };
let xcm = Xcm(vec![instruction]);
}: {
executor.bench_process(xcm)?;
} verify {
assert_eq!(
executor.origin(),
&Some(Location {
parents: 0,
interior: Here,
}),
);
}
#[benchmark]
fn execute_with_origin() -> Result<(), BenchmarkError> {
let mut executor = new_executor::<T>(Default::default());
let who: Junctions = Junctions::from([AccountId32 { id: [0u8; 32], network: None }]);
let instruction = Instruction::ExecuteWithOrigin {
descendant_origin: Some(who.clone()),
xcm: Xcm(vec![]),
};
let xcm = Xcm(vec![instruction]);

#[block]
{
executor.bench_process(xcm)?;
}
assert_eq!(executor.origin(), &Some(Location { parents: 0, interior: Here }),);
}

#[benchmark]
fn clear_origin() -> Result<(), BenchmarkError> {
Expand Down

0 comments on commit d95c3ce

Please sign in to comment.