mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 20:31:13 +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:
@@ -76,6 +76,8 @@ mod benchmarking;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
pub mod weights;
|
||||
use core::marker::PhantomData;
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
pub use benchmarking::ArgumentsFactory;
|
||||
|
||||
@@ -1120,3 +1122,15 @@ impl<T: Config<I>, I: 'static> OnUnbalanced<NegativeImbalanceOf<T, I>> for Palle
|
||||
Self::deposit_event(Event::Deposit { value: numeric_amount });
|
||||
}
|
||||
}
|
||||
|
||||
/// TypedGet implementaion to get the AccountId of the Treasury.
|
||||
pub struct TreasuryAccountId<R>(PhantomData<R>);
|
||||
impl<R> sp_runtime::traits::TypedGet for TreasuryAccountId<R>
|
||||
where
|
||||
R: crate::Config,
|
||||
{
|
||||
type Type = <R as frame_system::Config>::AccountId;
|
||||
fn get() -> Self::Type {
|
||||
<crate::Pallet<R>>::account_id()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user