mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 22:11:02 +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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user