From 9a3dfc432bf588043ffe2ff7c66f30cf7b33c76e Mon Sep 17 00:00:00 2001 From: Roman Useinov Date: Wed, 21 Sep 2022 12:57:54 +0200 Subject: [PATCH] [Fix] Deposit weight hardcoded to pre-bench value (#1651) * [Fix] Deposit weight hardcoded to pre-bench value * lint --- parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs | 5 ++++- parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs | 5 ++++- parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs b/parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs index f1fe664953a..7972667cf06 100644 --- a/parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs +++ b/parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs @@ -117,7 +117,10 @@ impl XcmWeightInfo for StatemineXcmWeight { _max_assets: &u32, _dest: &MultiLocation, ) -> XCMWeight { - assets.weigh_multi_assets(XcmFungibleWeight::::deposit_asset()) + // Hardcoded till the XCM pallet is fixed + let hardcoded_weight = Weight::from_ref_time(1_000_000_000 as u64).ref_time(); + let weight = assets.weigh_multi_assets(XcmFungibleWeight::::deposit_asset()); + cmp::min(hardcoded_weight, weight) } fn deposit_reserve_asset( assets: &MultiAssetFilter, diff --git a/parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs b/parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs index 04db4216efc..1a0ffcdb229 100644 --- a/parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs +++ b/parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs @@ -117,7 +117,10 @@ impl XcmWeightInfo for StatemintXcmWeight { _max_assets: &u32, _dest: &MultiLocation, ) -> XCMWeight { - assets.weigh_multi_assets(XcmFungibleWeight::::deposit_asset()) + // Hardcoded till the XCM pallet is fixed + let hardcoded_weight = Weight::from_ref_time(1_000_000_000 as u64).ref_time(); + let weight = assets.weigh_multi_assets(XcmFungibleWeight::::deposit_asset()); + cmp::min(hardcoded_weight, weight) } fn deposit_reserve_asset( assets: &MultiAssetFilter, diff --git a/parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs b/parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs index 037e1d54459..c1b2f0513e4 100644 --- a/parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs +++ b/parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs @@ -117,7 +117,10 @@ impl XcmWeightInfo for WestmintXcmWeight { _max_assets: &u32, _dest: &MultiLocation, ) -> XCMWeight { - assets.weigh_multi_assets(XcmFungibleWeight::::deposit_asset()) + // Hardcoded till the XCM pallet is fixed + let hardcoded_weight = Weight::from_ref_time(1_000_000_000 as u64).ref_time(); + let weight = assets.weigh_multi_assets(XcmFungibleWeight::::deposit_asset()); + cmp::min(hardcoded_weight, weight) } fn deposit_reserve_asset( assets: &MultiAssetFilter,