From d95c3ce06292240da46d613f828aa7ba9b161622 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 28 Nov 2024 11:11:19 +0100 Subject: [PATCH] migrate new benchmark --- .../src/generic/benchmarking.rs | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/polkadot/xcm/pallet-xcm-benchmarks/src/generic/benchmarking.rs b/polkadot/xcm/pallet-xcm-benchmarks/src/generic/benchmarking.rs index d3caf8817418..fdb0abdd2e36 100644 --- a/polkadot/xcm/pallet-xcm-benchmarks/src/generic/benchmarking.rs +++ b/polkadot/xcm/pallet-xcm-benchmarks/src/generic/benchmarking.rs @@ -293,22 +293,22 @@ mod benchmarks { Ok(()) } - execute_with_origin { -let mut executor = new_executor::(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::(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> {