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

[Fix] Hardcode teleport weight until XCM pallet is fixed #1641

Merged
merged 6 commits into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from 5 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
9 changes: 6 additions & 3 deletions parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ use crate::Runtime;
use frame_support::weights::Weight;
use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight;
use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric;
use sp_std::prelude::*;
use xcm::{
use sp_std::{cmp, prelude::*};
use xc::{
latest::{prelude::*, Weight as XCMWeight},
DoubleEncoded,
};
Expand Down Expand Up @@ -142,7 +142,10 @@ impl<Call> XcmWeightInfo<Call> for StatemineXcmWeight<Call> {
_dest: &MultiLocation,
_xcm: &Xcm<()>,
) -> XCMWeight {
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::initiate_teleport())
// Hardcoded till the XCM pallet is fixed
let hardcoded_weight = Weight::from_ref_time(200_000_000 as u64).ref_time();
let weight = assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::initiate_teleport());
cmp::min(hardcoded_weight, weight)
}
fn query_holding(
_query_id: &u64,
Expand Down
7 changes: 5 additions & 2 deletions parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::Runtime;
use frame_support::weights::Weight;
use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight;
use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric;
use sp_std::prelude::*;
use sp_std::{cmp, prelude::*};
use xcm::{
latest::{prelude::*, Weight as XCMWeight},
DoubleEncoded,
Expand Down Expand Up @@ -142,7 +142,10 @@ impl<Call> XcmWeightInfo<Call> for StatemintXcmWeight<Call> {
_dest: &MultiLocation,
_xcm: &Xcm<()>,
) -> XCMWeight {
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::initiate_teleport())
// Hardcoded till the XCM pallet is fixed
let hardcoded_weight = Weight::from_ref_time(200_000_000 as u64).ref_time();
let weight = assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::initiate_teleport());
cmp::min(hardcoded_weight, weight)
}
fn query_holding(
_query_id: &u64,
Expand Down
7 changes: 5 additions & 2 deletions parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::Runtime;
use frame_support::weights::Weight;
use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight;
use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric;
use sp_std::prelude::*;
use sp_std::{cmp, prelude::*};
use xcm::{
latest::{prelude::*, Weight as XCMWeight},
DoubleEncoded,
Expand Down Expand Up @@ -142,7 +142,10 @@ impl<Call> XcmWeightInfo<Call> for WestmintXcmWeight<Call> {
_dest: &MultiLocation,
_xcm: &Xcm<()>,
) -> XCMWeight {
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::initiate_teleport())
// Hardcoded till the XCM pallet is fixed
let hardcoded_weight = Weight::from_ref_time(200_000_000 as u64).ref_time();
let weight = assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::initiate_teleport());
cmp::min(hardcoded_weight, weight)
}
fn query_holding(
_query_id: &u64,
Expand Down