From d3bfe0361e8066f9dcd25e06713726afe5babb46 Mon Sep 17 00:00:00 2001 From: Alessandro Siniscalchi Date: Wed, 9 Oct 2024 16:39:00 +0200 Subject: [PATCH] fix clippy --- xcm-simulator/src/parachain.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/xcm-simulator/src/parachain.rs b/xcm-simulator/src/parachain.rs index e7957e53..cc93399b 100644 --- a/xcm-simulator/src/parachain.rs +++ b/xcm-simulator/src/parachain.rs @@ -322,6 +322,15 @@ impl pallet_assets::Config for Runtime { type BenchmarkHelper = (); } +/// Simple conversion of `u32` into an `AssetId` for use in benchmarking. +pub struct XcmBenchmarkHelper; +#[cfg(feature = "runtime-benchmarks")] +impl pallet_assets::BenchmarkHelper for XcmBenchmarkHelper { + fn create_asset_id_parameter(id: u32) -> xcm::v3::Location { + xcm::v3::Location::new(1, xcm::v3::Junction::Parachain(id)) + } +} + /// Assets managed by some foreign location. Note: we do not declare a `ForeignAssetsCall` type, as /// this type is used in proxy definitions. We assume that a foreign location would not want to set /// an individual, local account as a proxy for the issuance of their assets. This issuance should @@ -352,7 +361,7 @@ impl pallet_assets::Config for Runtime { type AssetAccountDeposit = frame_support::traits::ConstU128<1_000>; type RemoveItemsLimit = frame_support::traits::ConstU32<1000>; #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = xcm_config::XcmBenchmarkHelper; + type BenchmarkHelper = XcmBenchmarkHelper; } impl parachain_info::Config for Runtime {}