Use WeightToFee when calculating cost of each weight unit in XCM trader (#1055)

* Use WeightToFee when calculating cost of each weight unit in XCM trader

* Set the OnUnbalanced type parameter for XCM Traders
This commit is contained in:
Keith Yeung
2022-03-08 01:10:41 -08:00
committed by GitHub
parent f0c2a9a047
commit 66d0e26d00
5 changed files with 25 additions and 17 deletions
@@ -14,13 +14,13 @@
// limitations under the License.
use super::{
AccountId, Balance, Balances, Call, Event, Origin, ParachainInfo, ParachainSystem, PolkadotXcm,
Runtime, XcmpQueue,
AccountId, Balances, Call, Event, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime,
WeightToFee, XcmpQueue,
};
use frame_support::{
match_types, parameter_types,
traits::{EnsureOneOf, Everything, Nothing},
weights::{IdentityFee, Weight},
weights::Weight,
};
use frame_system::EnsureRoot;
use pallet_xcm::{EnsureXcm, IsMajorityOfBody, XcmPassthrough};
@@ -139,7 +139,7 @@ impl xcm_executor::Config for XcmConfig {
type LocationInverter = LocationInverter<Ancestry>;
type Barrier = Barrier;
type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
type Trader = UsingComponents<IdentityFee<Balance>, RelayLocation, AccountId, Balances, ()>;
type Trader = UsingComponents<WeightToFee, RelayLocation, AccountId, Balances, ()>;
type ResponseHandler = PolkadotXcm;
type AssetTrap = PolkadotXcm;
type AssetClaims = PolkadotXcm;