From 0fbcbbd90b1192118f9a2c06df231adce013ca8d Mon Sep 17 00:00:00 2001 From: Squirrel Date: Wed, 21 Sep 2022 12:43:23 +0100 Subject: [PATCH] [Fix] Deposit weight hardcoded to pre-bench value (#1651) (#1656) * [Fix] Deposit weight hardcoded to pre-bench value * lint Co-authored-by: Roman Useinov --- 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 f1fe664953..7972667cf0 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 04db4216ef..1a0ffcdb22 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 037e1d5445..c1b2f0513e 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,