mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 06:21: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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user