Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Added origin to config for universal_origin benchmark #6986

Merged
merged 1 commit into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2093,7 +2093,7 @@ sp_api::impl_runtime_apis! {
Err(BenchmarkError::Skip)
}

fn universal_alias() -> Result<Junction, BenchmarkError> {
fn universal_alias() -> Result<(MultiLocation, Junction), BenchmarkError> {
// The XCM executor of Kusama doesn't have a configured `UniversalAliases`
Err(BenchmarkError::Skip)
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2095,7 +2095,7 @@ sp_api::impl_runtime_apis! {
Err(BenchmarkError::Skip)
}

fn universal_alias() -> Result<Junction, BenchmarkError> {
fn universal_alias() -> Result<(MultiLocation, Junction), BenchmarkError> {
// The XCM executor of Rococo doesn't have a configured `UniversalAliases`
Err(BenchmarkError::Skip)
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,7 @@ sp_api::impl_runtime_apis! {
Err(BenchmarkError::Skip)
}

fn universal_alias() -> Result<Junction, BenchmarkError> {
fn universal_alias() -> Result<(MultiLocation, Junction), BenchmarkError> {
// The XCM executor of Westend doesn't have a configured `UniversalAliases`
Err(BenchmarkError::Skip)
}
Expand Down
4 changes: 2 additions & 2 deletions xcm/pallet-xcm-benchmarks/src/generic/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
4 changes: 2 additions & 2 deletions xcm/pallet-xcm-benchmarks/src/generic/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions xcm/pallet-xcm-benchmarks/src/generic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down