Skip to content

Commit 5ac5af0

Browse files
Add expensive scenario for asset exchange
1 parent 35e6bef commit 5ac5af0

File tree

1 file changed

+15
-1
lines changed
  • cumulus/parachains/runtimes/assets/asset-hub-westend/src

1 file changed

+15
-1
lines changed

cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs

+15-1
Original file line numberDiff line numberDiff line change
@@ -2162,7 +2162,21 @@ impl_runtime_apis! {
21622162
}
21632163

21642164
fn worst_case_asset_exchange() -> Result<(XcmAssets, XcmAssets), BenchmarkError> {
2165-
Err(BenchmarkError::Skip)
2165+
use xcm_executor::traits::Convert;
2166+
2167+
// Simulate the maximum possible assets for 'give' and 'receive'
2168+
let mut give_assets = MultiAssets::new();
2169+
let mut receive_assets = MultiAssets::new();
2170+
2171+
// Loop large asset types for maximum complexity
2172+
let max_assets = 1_000;
2173+
for i in 0..max_assets {
2174+
let asset_id = AssetId::Concrete(Location::new(1, [Parachain(2000 + i)]));
2175+
give_assets.push((asset_id.clone(), 1_000_000 * UNITS).into());
2176+
receive_assets.push((asset_id, 500_000 * UNITS).into());
2177+
}
2178+
2179+
Ok((give_assets.into(), receive_assets.into()))
21662180
}
21672181

21682182
fn universal_alias() -> Result<(Location, Junction), BenchmarkError> {

0 commit comments

Comments
 (0)