mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 00:41:03 +00:00
Migrate fee payment from Currency to fungible (#2292)
Part of https://github.com/paritytech/polkadot-sdk/issues/226 Related https://github.com/paritytech/polkadot-sdk/issues/1833 - Deprecate `CurrencyAdapter` and introduce `FungibleAdapter` - Deprecate `ToStakingPot` and replace usage with `ResolveTo` - Required creating a new `StakingPotAccountId` struct that implements `TypedGet` for the staking pot account ID - Update parachain common utils `DealWithFees`, `ToAuthor` and `AssetsToBlockAuthor` implementations to use `fungible` - Update runtime XCM Weight Traders to use `ResolveTo` instead of `ToStakingPot` - Update runtime Transaction Payment pallets to use `FungibleAdapter` instead of `CurrencyAdapter` - [x] Blocked by https://github.com/paritytech/polkadot-sdk/pull/1296, needs the `Unbalanced::decrease_balance` fix
This commit is contained in:
@@ -81,6 +81,8 @@
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
use core::marker::PhantomData;
|
||||
use frame_support::traits::TypedGet;
|
||||
pub use pallet::*;
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -981,3 +983,15 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// [`TypedGet`] implementaion to get the AccountId of the StakingPot.
|
||||
pub struct StakingPotAccountId<R>(PhantomData<R>);
|
||||
impl<R> TypedGet for StakingPotAccountId<R>
|
||||
where
|
||||
R: crate::Config,
|
||||
{
|
||||
type Type = <R as frame_system::Config>::AccountId;
|
||||
fn get() -> Self::Type {
|
||||
<crate::Pallet<R>>::account_id()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,10 +17,11 @@
|
||||
//! Taken from polkadot/runtime/common (at a21cd64) and adapted for parachains.
|
||||
|
||||
use frame_support::traits::{
|
||||
fungibles::{self, Balanced, Credit},
|
||||
Contains, ContainsPair, Currency, Get, Imbalance, OnUnbalanced, OriginTrait,
|
||||
fungible, fungibles, tokens::imbalance::ResolveTo, Contains, ContainsPair, Currency, Defensive,
|
||||
Get, Imbalance, OnUnbalanced, OriginTrait,
|
||||
};
|
||||
use pallet_asset_tx_payment::HandleCredit;
|
||||
use pallet_collator_selection::StakingPotAccountId;
|
||||
use sp_runtime::traits::Zero;
|
||||
use sp_std::{marker::PhantomData, prelude::*};
|
||||
use xcm::latest::{
|
||||
@@ -29,16 +30,20 @@ use xcm::latest::{
|
||||
};
|
||||
use xcm_executor::traits::ConvertLocation;
|
||||
|
||||
/// Type alias to conveniently refer to `frame_system`'s `Config::AccountId`.
|
||||
pub type AccountIdOf<T> = <T as frame_system::Config>::AccountId;
|
||||
|
||||
/// Type alias to conveniently refer to the `Currency::NegativeImbalance` associated type.
|
||||
pub type NegativeImbalance<T> = <pallet_balances::Pallet<T> as Currency<
|
||||
<T as frame_system::Config>::AccountId,
|
||||
>>::NegativeImbalance;
|
||||
|
||||
/// Type alias to conveniently refer to `frame_system`'s `Config::AccountId`.
|
||||
pub type AccountIdOf<R> = <R as frame_system::Config>::AccountId;
|
||||
|
||||
/// Implementation of `OnUnbalanced` that deposits the fees into a staking pot for later payout.
|
||||
#[deprecated(
|
||||
note = "ToStakingPot is deprecated and will be removed after March 2024. Please use frame_support::traits::tokens::imbalance::ResolveTo instead."
|
||||
)]
|
||||
pub struct ToStakingPot<R>(PhantomData<R>);
|
||||
#[allow(deprecated)]
|
||||
impl<R> OnUnbalanced<NegativeImbalance<R>> for ToStakingPot<R>
|
||||
where
|
||||
R: pallet_balances::Config + pallet_collator_selection::Config,
|
||||
@@ -47,25 +52,30 @@ where
|
||||
{
|
||||
fn on_nonzero_unbalanced(amount: NegativeImbalance<R>) {
|
||||
let staking_pot = <pallet_collator_selection::Pallet<R>>::account_id();
|
||||
// In case of error: Will drop the result triggering the `OnDrop` of the imbalance.
|
||||
<pallet_balances::Pallet<R>>::resolve_creating(&staking_pot, amount);
|
||||
}
|
||||
}
|
||||
|
||||
/// Implementation of `OnUnbalanced` that deals with the fees by combining tip and fee and passing
|
||||
/// the result on to `ToStakingPot`.
|
||||
/// Fungible implementation of `OnUnbalanced` that deals with the fees by combining tip and fee and
|
||||
/// passing the result on to `ToStakingPot`.
|
||||
pub struct DealWithFees<R>(PhantomData<R>);
|
||||
impl<R> OnUnbalanced<NegativeImbalance<R>> for DealWithFees<R>
|
||||
impl<R> OnUnbalanced<fungible::Credit<R::AccountId, pallet_balances::Pallet<R>>> for DealWithFees<R>
|
||||
where
|
||||
R: pallet_balances::Config + pallet_collator_selection::Config,
|
||||
AccountIdOf<R>: From<polkadot_primitives::AccountId> + Into<polkadot_primitives::AccountId>,
|
||||
<R as frame_system::Config>::RuntimeEvent: From<pallet_balances::Event<R>>,
|
||||
{
|
||||
fn on_unbalanceds<B>(mut fees_then_tips: impl Iterator<Item = NegativeImbalance<R>>) {
|
||||
fn on_unbalanceds<B>(
|
||||
mut fees_then_tips: impl Iterator<
|
||||
Item = fungible::Credit<R::AccountId, pallet_balances::Pallet<R>>,
|
||||
>,
|
||||
) {
|
||||
if let Some(mut fees) = fees_then_tips.next() {
|
||||
if let Some(tips) = fees_then_tips.next() {
|
||||
tips.merge_into(&mut fees);
|
||||
}
|
||||
<ToStakingPot<R> as OnUnbalanced<_>>::on_unbalanced(fees);
|
||||
ResolveTo::<StakingPotAccountId<R>, pallet_balances::Pallet<R>>::on_unbalanced(fees)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -79,10 +89,11 @@ where
|
||||
R: pallet_authorship::Config + pallet_assets::Config<I>,
|
||||
AccountIdOf<R>: From<polkadot_primitives::AccountId> + Into<polkadot_primitives::AccountId>,
|
||||
{
|
||||
fn handle_credit(credit: Credit<AccountIdOf<R>, pallet_assets::Pallet<R, I>>) {
|
||||
fn handle_credit(credit: fungibles::Credit<AccountIdOf<R>, pallet_assets::Pallet<R, I>>) {
|
||||
use frame_support::traits::fungibles::Balanced;
|
||||
if let Some(author) = pallet_authorship::Pallet::<R>::author() {
|
||||
// In case of error: Will drop the result triggering the `OnDrop` of the imbalance.
|
||||
let _ = pallet_assets::Pallet::<R, I>::resolve(&author, credit);
|
||||
let _ = pallet_assets::Pallet::<R, I>::resolve(&author, credit).defensive();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -313,8 +324,14 @@ mod tests {
|
||||
#[test]
|
||||
fn test_fees_and_tip_split() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let fee = Balances::issue(10);
|
||||
let tip = Balances::issue(20);
|
||||
let fee =
|
||||
<pallet_balances::Pallet<Test> as frame_support::traits::fungible::Balanced<
|
||||
AccountId,
|
||||
>>::issue(10);
|
||||
let tip =
|
||||
<pallet_balances::Pallet<Test> as frame_support::traits::fungible::Balanced<
|
||||
AccountId,
|
||||
>>::issue(20);
|
||||
|
||||
assert_eq!(Balances::free_balance(TEST_ACCOUNT), 0);
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ parameter_types! {
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type OnChargeTransaction =
|
||||
pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees<Runtime>>;
|
||||
pallet_transaction_payment::FungibleAdapter<Balances, DealWithFees<Runtime>>;
|
||||
type WeightToFee = WeightToFee;
|
||||
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
|
||||
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
|
||||
|
||||
@@ -27,14 +27,13 @@ use assets_common::{
|
||||
use frame_support::{
|
||||
parameter_types,
|
||||
traits::{
|
||||
tokens::imbalance::ResolveAssetTo, ConstU32, Contains, Equals, Everything, Nothing,
|
||||
PalletInfoAccess,
|
||||
tokens::imbalance::{ResolveAssetTo, ResolveTo},
|
||||
ConstU32, Contains, Equals, Everything, Nothing, PalletInfoAccess,
|
||||
},
|
||||
};
|
||||
use frame_system::EnsureRoot;
|
||||
use pallet_xcm::XcmPassthrough;
|
||||
use parachains_common::{
|
||||
impls::ToStakingPot,
|
||||
xcm_config::{
|
||||
AllSiblingSystemParachains, AssetFeeAsExistentialDepositMultiplier,
|
||||
ConcreteAssetFromSystem, ParentRelayOrSiblingParachains, RelayOrOtherSystemParachains,
|
||||
@@ -569,7 +568,13 @@ impl xcm_executor::Config for XcmConfig {
|
||||
MaxInstructions,
|
||||
>;
|
||||
type Trader = (
|
||||
UsingComponents<WeightToFee, TokenLocation, AccountId, Balances, ToStakingPot<Runtime>>,
|
||||
UsingComponents<
|
||||
WeightToFee,
|
||||
TokenLocation,
|
||||
AccountId,
|
||||
Balances,
|
||||
ResolveTo<StakingPot, Balances>,
|
||||
>,
|
||||
cumulus_primitives_utility::SwapFirstAssetTrader<
|
||||
TokenLocationV3,
|
||||
crate::AssetConversion,
|
||||
|
||||
@@ -210,7 +210,7 @@ parameter_types! {
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type OnChargeTransaction =
|
||||
pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees<Runtime>>;
|
||||
pallet_transaction_payment::FungibleAdapter<Balances, DealWithFees<Runtime>>;
|
||||
type WeightToFee = WeightToFee;
|
||||
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
|
||||
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
|
||||
|
||||
@@ -27,14 +27,13 @@ use assets_common::{
|
||||
use frame_support::{
|
||||
parameter_types,
|
||||
traits::{
|
||||
tokens::imbalance::ResolveAssetTo, ConstU32, Contains, Equals, Everything, Nothing,
|
||||
PalletInfoAccess,
|
||||
tokens::imbalance::{ResolveAssetTo, ResolveTo},
|
||||
ConstU32, Contains, Equals, Everything, Nothing, PalletInfoAccess,
|
||||
},
|
||||
};
|
||||
use frame_system::EnsureRoot;
|
||||
use pallet_xcm::XcmPassthrough;
|
||||
use parachains_common::{
|
||||
impls::ToStakingPot,
|
||||
xcm_config::{
|
||||
AllSiblingSystemParachains, AssetFeeAsExistentialDepositMultiplier,
|
||||
ConcreteAssetFromSystem, RelayOrOtherSystemParachains,
|
||||
@@ -591,7 +590,13 @@ impl xcm_executor::Config for XcmConfig {
|
||||
MaxInstructions,
|
||||
>;
|
||||
type Trader = (
|
||||
UsingComponents<WeightToFee, WestendLocation, AccountId, Balances, ToStakingPot<Runtime>>,
|
||||
UsingComponents<
|
||||
WeightToFee,
|
||||
WestendLocation,
|
||||
AccountId,
|
||||
Balances,
|
||||
ResolveTo<StakingPot, Balances>,
|
||||
>,
|
||||
cumulus_primitives_utility::SwapFirstAssetTrader<
|
||||
WestendLocationV3,
|
||||
crate::AssetConversion,
|
||||
|
||||
@@ -317,7 +317,7 @@ parameter_types! {
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type OnChargeTransaction =
|
||||
pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees<Runtime>>;
|
||||
pallet_transaction_payment::FungibleAdapter<Balances, DealWithFees<Runtime>>;
|
||||
type OperationalFeeMultiplier = ConstU8<5>;
|
||||
type WeightToFee = WeightToFee;
|
||||
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
|
||||
|
||||
@@ -33,13 +33,13 @@ use bp_relayers::{PayRewardFromAccount, RewardsAccountOwner, RewardsAccountParam
|
||||
use bp_runtime::ChainId;
|
||||
use frame_support::{
|
||||
parameter_types,
|
||||
traits::{ConstU32, Contains, Equals, Everything, Nothing},
|
||||
traits::{tokens::imbalance::ResolveTo, ConstU32, Contains, Equals, Everything, Nothing},
|
||||
StoragePrefixedMap,
|
||||
};
|
||||
use frame_system::EnsureRoot;
|
||||
use pallet_collator_selection::StakingPotAccountId;
|
||||
use pallet_xcm::XcmPassthrough;
|
||||
use parachains_common::{
|
||||
impls::ToStakingPot,
|
||||
xcm_config::{
|
||||
AllSiblingSystemParachains, ConcreteAssetFromSystem, ParentRelayOrSiblingParachains,
|
||||
RelayOrOtherSystemParachains,
|
||||
@@ -295,8 +295,13 @@ impl xcm_executor::Config for XcmConfig {
|
||||
RuntimeCall,
|
||||
MaxInstructions,
|
||||
>;
|
||||
type Trader =
|
||||
UsingComponents<WeightToFee, TokenLocation, AccountId, Balances, ToStakingPot<Runtime>>;
|
||||
type Trader = UsingComponents<
|
||||
WeightToFee,
|
||||
TokenLocation,
|
||||
AccountId,
|
||||
Balances,
|
||||
ResolveTo<StakingPotAccountId<Runtime>, Balances>,
|
||||
>;
|
||||
type ResponseHandler = PolkadotXcm;
|
||||
type AssetTrap = PolkadotXcm;
|
||||
type AssetLocker = ();
|
||||
|
||||
@@ -291,7 +291,7 @@ parameter_types! {
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type OnChargeTransaction =
|
||||
pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees<Runtime>>;
|
||||
pallet_transaction_payment::FungibleAdapter<Balances, DealWithFees<Runtime>>;
|
||||
type OperationalFeeMultiplier = ConstU8<5>;
|
||||
type WeightToFee = WeightToFee;
|
||||
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
|
||||
|
||||
@@ -22,12 +22,12 @@ use super::{
|
||||
use crate::bridge_common_config::{DeliveryRewardInBalance, RequiredStakeForStakeAndSlash};
|
||||
use frame_support::{
|
||||
parameter_types,
|
||||
traits::{ConstU32, Contains, Equals, Everything, Nothing},
|
||||
traits::{tokens::imbalance::ResolveTo, ConstU32, Contains, Equals, Everything, Nothing},
|
||||
};
|
||||
use frame_system::EnsureRoot;
|
||||
use pallet_collator_selection::StakingPotAccountId;
|
||||
use pallet_xcm::XcmPassthrough;
|
||||
use parachains_common::{
|
||||
impls::ToStakingPot,
|
||||
xcm_config::{
|
||||
AllSiblingSystemParachains, ConcreteAssetFromSystem, ParentRelayOrSiblingParachains,
|
||||
RelayOrOtherSystemParachains,
|
||||
@@ -244,8 +244,13 @@ impl xcm_executor::Config for XcmConfig {
|
||||
RuntimeCall,
|
||||
MaxInstructions,
|
||||
>;
|
||||
type Trader =
|
||||
UsingComponents<WeightToFee, WestendLocation, AccountId, Balances, ToStakingPot<Runtime>>;
|
||||
type Trader = UsingComponents<
|
||||
WeightToFee,
|
||||
WestendLocation,
|
||||
AccountId,
|
||||
Balances,
|
||||
ResolveTo<StakingPotAccountId<Runtime>, Balances>,
|
||||
>;
|
||||
type ResponseHandler = PolkadotXcm;
|
||||
type AssetTrap = PolkadotXcm;
|
||||
type AssetLocker = ();
|
||||
|
||||
@@ -223,7 +223,7 @@ parameter_types! {
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type OnChargeTransaction =
|
||||
pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees<Runtime>>;
|
||||
pallet_transaction_payment::FungibleAdapter<Balances, DealWithFees<Runtime>>;
|
||||
type WeightToFee = WeightToFee;
|
||||
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
|
||||
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
|
||||
|
||||
@@ -20,17 +20,15 @@ use super::{
|
||||
};
|
||||
use frame_support::{
|
||||
parameter_types,
|
||||
traits::{ConstU32, Contains, Equals, Everything, Nothing},
|
||||
traits::{tokens::imbalance::ResolveTo, ConstU32, Contains, Equals, Everything, Nothing},
|
||||
weights::Weight,
|
||||
};
|
||||
use frame_system::EnsureRoot;
|
||||
use pallet_collator_selection::StakingPotAccountId;
|
||||
use pallet_xcm::XcmPassthrough;
|
||||
use parachains_common::{
|
||||
impls::ToStakingPot,
|
||||
xcm_config::{
|
||||
AllSiblingSystemParachains, ConcreteAssetFromSystem, ParentRelayOrSiblingParachains,
|
||||
RelayOrOtherSystemParachains,
|
||||
},
|
||||
use parachains_common::xcm_config::{
|
||||
AllSiblingSystemParachains, ConcreteAssetFromSystem, ParentRelayOrSiblingParachains,
|
||||
RelayOrOtherSystemParachains,
|
||||
};
|
||||
use polkadot_parachain_primitives::primitives::Sibling;
|
||||
use polkadot_runtime_common::xcm_sender::ExponentialPrice;
|
||||
@@ -268,8 +266,13 @@ impl xcm_executor::Config for XcmConfig {
|
||||
type UniversalLocation = UniversalLocation;
|
||||
type Barrier = Barrier;
|
||||
type Weigher = FixedWeightBounds<TempFixedXcmWeight, RuntimeCall, MaxInstructions>;
|
||||
type Trader =
|
||||
UsingComponents<WeightToFee, WndLocation, AccountId, Balances, ToStakingPot<Runtime>>;
|
||||
type Trader = UsingComponents<
|
||||
WeightToFee,
|
||||
WndLocation,
|
||||
AccountId,
|
||||
Balances,
|
||||
ResolveTo<StakingPotAccountId<Runtime>, Balances>,
|
||||
>;
|
||||
type ResponseHandler = PolkadotXcm;
|
||||
type AssetTrap = PolkadotXcm;
|
||||
type AssetClaims = PolkadotXcm;
|
||||
|
||||
@@ -232,7 +232,7 @@ parameter_types! {
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type OnChargeTransaction =
|
||||
pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees<Runtime>>;
|
||||
pallet_transaction_payment::FungibleAdapter<Balances, DealWithFees<Runtime>>;
|
||||
type WeightToFee = WeightToFee;
|
||||
/// Relay Chain `TransactionByteFee` / 10
|
||||
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
|
||||
|
||||
@@ -244,7 +244,7 @@ parameter_types! {
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type OnChargeTransaction =
|
||||
pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees<Runtime>>;
|
||||
pallet_transaction_payment::FungibleAdapter<Balances, DealWithFees<Runtime>>;
|
||||
type OperationalFeeMultiplier = ConstU8<5>;
|
||||
type WeightToFee = WeightToFee;
|
||||
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
|
||||
|
||||
@@ -22,12 +22,12 @@ use super::{
|
||||
use frame_support::{
|
||||
pallet_prelude::PalletInfoAccess,
|
||||
parameter_types,
|
||||
traits::{ConstU32, Contains, Equals, Everything, Nothing},
|
||||
traits::{tokens::imbalance::ResolveTo, ConstU32, Contains, Equals, Everything, Nothing},
|
||||
};
|
||||
use frame_system::EnsureRoot;
|
||||
use pallet_collator_selection::StakingPotAccountId;
|
||||
use pallet_xcm::XcmPassthrough;
|
||||
use parachains_common::{
|
||||
impls::ToStakingPot,
|
||||
xcm_config::{
|
||||
AllSiblingSystemParachains, ConcreteAssetFromSystem, ParentRelayOrSiblingParachains,
|
||||
RelayOrOtherSystemParachains,
|
||||
@@ -237,8 +237,13 @@ impl xcm_executor::Config for XcmConfig {
|
||||
RuntimeCall,
|
||||
MaxInstructions,
|
||||
>;
|
||||
type Trader =
|
||||
UsingComponents<WeightToFee, RocRelayLocation, AccountId, Balances, ToStakingPot<Runtime>>;
|
||||
type Trader = UsingComponents<
|
||||
WeightToFee,
|
||||
RocRelayLocation,
|
||||
AccountId,
|
||||
Balances,
|
||||
ResolveTo<StakingPotAccountId<Runtime>, Balances>,
|
||||
>;
|
||||
type ResponseHandler = PolkadotXcm;
|
||||
type AssetTrap = PolkadotXcm;
|
||||
type AssetClaims = PolkadotXcm;
|
||||
|
||||
@@ -244,7 +244,7 @@ parameter_types! {
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type OnChargeTransaction =
|
||||
pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees<Runtime>>;
|
||||
pallet_transaction_payment::FungibleAdapter<Balances, DealWithFees<Runtime>>;
|
||||
type OperationalFeeMultiplier = ConstU8<5>;
|
||||
type WeightToFee = WeightToFee;
|
||||
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
|
||||
|
||||
@@ -22,12 +22,12 @@ use super::{
|
||||
use frame_support::{
|
||||
pallet_prelude::PalletInfoAccess,
|
||||
parameter_types,
|
||||
traits::{ConstU32, Contains, Equals, Everything, Nothing},
|
||||
traits::{tokens::imbalance::ResolveTo, ConstU32, Contains, Equals, Everything, Nothing},
|
||||
};
|
||||
use frame_system::EnsureRoot;
|
||||
use pallet_collator_selection::StakingPotAccountId;
|
||||
use pallet_xcm::XcmPassthrough;
|
||||
use parachains_common::{
|
||||
impls::ToStakingPot,
|
||||
xcm_config::{
|
||||
AllSiblingSystemParachains, ConcreteAssetFromSystem, ParentRelayOrSiblingParachains,
|
||||
RelayOrOtherSystemParachains,
|
||||
@@ -249,7 +249,7 @@ impl xcm_executor::Config for XcmConfig {
|
||||
TokenRelayLocation,
|
||||
AccountId,
|
||||
Balances,
|
||||
ToStakingPot<Runtime>,
|
||||
ResolveTo<StakingPotAccountId<Runtime>, Balances>,
|
||||
>;
|
||||
type ResponseHandler = PolkadotXcm;
|
||||
type AssetTrap = PolkadotXcm;
|
||||
|
||||
@@ -225,7 +225,7 @@ parameter_types! {
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type OnChargeTransaction =
|
||||
pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees<Runtime>>;
|
||||
pallet_transaction_payment::FungibleAdapter<Balances, DealWithFees<Runtime>>;
|
||||
type OperationalFeeMultiplier = ConstU8<5>;
|
||||
type WeightToFee = WeightToFee;
|
||||
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
|
||||
|
||||
@@ -20,12 +20,12 @@ use super::{
|
||||
use crate::{TransactionByteFee, CENTS};
|
||||
use frame_support::{
|
||||
parameter_types,
|
||||
traits::{ConstU32, Contains, Equals, Everything, Nothing},
|
||||
traits::{tokens::imbalance::ResolveTo, ConstU32, Contains, Equals, Everything, Nothing},
|
||||
};
|
||||
use frame_system::EnsureRoot;
|
||||
use pallet_collator_selection::StakingPotAccountId;
|
||||
use pallet_xcm::XcmPassthrough;
|
||||
use parachains_common::{
|
||||
impls::ToStakingPot,
|
||||
xcm_config::{
|
||||
AllSiblingSystemParachains, ConcreteAssetFromSystem, ParentRelayOrSiblingParachains,
|
||||
RelayOrOtherSystemParachains,
|
||||
@@ -249,8 +249,13 @@ impl xcm_executor::Config for XcmConfig {
|
||||
RuntimeCall,
|
||||
MaxInstructions,
|
||||
>;
|
||||
type Trader =
|
||||
UsingComponents<WeightToFee, RelayLocation, AccountId, Balances, ToStakingPot<Runtime>>;
|
||||
type Trader = UsingComponents<
|
||||
WeightToFee,
|
||||
RelayLocation,
|
||||
AccountId,
|
||||
Balances,
|
||||
ResolveTo<StakingPotAccountId<Runtime>, Balances>,
|
||||
>;
|
||||
type ResponseHandler = PolkadotXcm;
|
||||
type AssetTrap = PolkadotXcm;
|
||||
type AssetClaims = PolkadotXcm;
|
||||
|
||||
@@ -225,7 +225,7 @@ parameter_types! {
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type OnChargeTransaction =
|
||||
pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees<Runtime>>;
|
||||
pallet_transaction_payment::FungibleAdapter<Balances, DealWithFees<Runtime>>;
|
||||
type OperationalFeeMultiplier = ConstU8<5>;
|
||||
type WeightToFee = WeightToFee;
|
||||
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
|
||||
|
||||
@@ -20,12 +20,12 @@ use super::{
|
||||
use crate::{TransactionByteFee, CENTS};
|
||||
use frame_support::{
|
||||
parameter_types,
|
||||
traits::{ConstU32, Contains, Equals, Everything, Nothing},
|
||||
traits::{tokens::imbalance::ResolveTo, ConstU32, Contains, Equals, Everything, Nothing},
|
||||
};
|
||||
use frame_system::EnsureRoot;
|
||||
use pallet_collator_selection::StakingPotAccountId;
|
||||
use pallet_xcm::XcmPassthrough;
|
||||
use parachains_common::{
|
||||
impls::ToStakingPot,
|
||||
xcm_config::{
|
||||
AllSiblingSystemParachains, ConcreteAssetFromSystem, ParentRelayOrSiblingParachains,
|
||||
RelayOrOtherSystemParachains,
|
||||
@@ -257,8 +257,13 @@ impl xcm_executor::Config for XcmConfig {
|
||||
RuntimeCall,
|
||||
MaxInstructions,
|
||||
>;
|
||||
type Trader =
|
||||
UsingComponents<WeightToFee, RelayLocation, AccountId, Balances, ToStakingPot<Runtime>>;
|
||||
type Trader = UsingComponents<
|
||||
WeightToFee,
|
||||
RelayLocation,
|
||||
AccountId,
|
||||
Balances,
|
||||
ResolveTo<StakingPotAccountId<Runtime>, Balances>,
|
||||
>;
|
||||
type ResponseHandler = PolkadotXcm;
|
||||
type AssetTrap = PolkadotXcm;
|
||||
type AssetClaims = PolkadotXcm;
|
||||
|
||||
@@ -416,7 +416,7 @@ parameter_types! {
|
||||
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, ()>;
|
||||
type OnChargeTransaction = pallet_transaction_payment::FungibleAdapter<Balances, ()>;
|
||||
type WeightToFee = WeightToFee;
|
||||
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
|
||||
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
|
||||
|
||||
@@ -259,7 +259,7 @@ impl pallet_balances::Config for Runtime {
|
||||
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, ()>;
|
||||
type OnChargeTransaction = pallet_transaction_payment::FungibleAdapter<Balances, ()>;
|
||||
type WeightToFee = IdentityFee<Balance>;
|
||||
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
|
||||
type FeeMultiplierUpdate = ();
|
||||
|
||||
@@ -241,7 +241,7 @@ impl pallet_balances::Config for Runtime {
|
||||
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, ()>;
|
||||
type OnChargeTransaction = pallet_transaction_payment::FungibleAdapter<Balances, ()>;
|
||||
type WeightToFee = IdentityFee<Balance>;
|
||||
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
|
||||
type FeeMultiplierUpdate = ();
|
||||
|
||||
Reference in New Issue
Block a user