Added origin to config for universal_origin benchmark (#6986)

This commit is contained in:
Branislav Kontur
2023-04-04 09:34:56 +02:00
committed by GitHub
parent 3ab60efc26
commit 3f67c93dd1
6 changed files with 9 additions and 9 deletions
@@ -482,9 +482,9 @@ benchmarks! {
}
universal_origin {
let alias = T::universal_alias().map_err(|_| BenchmarkError::Skip)?;
let (origin, alias) = T::universal_alias().map_err(|_| BenchmarkError::Skip)?;
let mut executor = new_executor::<T>(Here.into_location());
let mut executor = new_executor::<T>(origin);
let instruction = Instruction::UniversalOrigin(alias.clone());
let xcm = Xcm(vec![instruction]);
@@ -163,8 +163,8 @@ impl generic::Config for Test {
Ok(Default::default())
}
fn universal_alias() -> Result<Junction, BenchmarkError> {
Ok(GlobalConsensus(ByGenesis([0; 32])))
fn universal_alias() -> Result<(MultiLocation, Junction), BenchmarkError> {
Ok((Here.into(), GlobalConsensus(ByGenesis([0; 32]))))
}
fn transact_origin_and_runtime_call(
@@ -52,10 +52,10 @@ pub mod pallet {
/// If set to `Err`, benchmarks which rely on an `exchange_asset` will be skipped.
fn worst_case_asset_exchange() -> Result<(MultiAssets, MultiAssets), BenchmarkError>;
/// A `Junction` that is one of the `UniversalAliases` configured by the XCM executor.
/// A `(MultiLocation, Junction)` that is one of the `UniversalAliases` configured by the XCM executor.
///
/// If set to `Err`, benchmarks which rely on a universal alias will be skipped.
fn universal_alias() -> Result<Junction, BenchmarkError>;
fn universal_alias() -> Result<(MultiLocation, Junction), BenchmarkError>;
/// The `MultiLocation` and `RuntimeCall` used for successful transaction XCMs.
///