Skip to content

Commit

Permalink
* Replaced CurrencyAdapter with FungibleAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
DidacSF committed Jun 18, 2024
1 parent b83a0d5 commit 600f408
Showing 1 changed file with 24 additions and 31 deletions.
55 changes: 24 additions & 31 deletions runtime/bajun/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ use frame_support::{
parameter_types,
traits::{
fungible::HoldConsideration,
tokens::{PayFromAccount, UnityAssetBalanceConversion},
tokens::{imbalance::ResolveTo, PayFromAccount, UnityAssetBalanceConversion},
AsEnsureOriginWithArg, ConstBool, Contains, LinearStoragePrice,
},
weights::{
Expand All @@ -69,15 +69,11 @@ use frame_system::{
EnsureRoot, EnsureSigned, EnsureWithSuccess,
};
use pallet_identity::legacy::IdentityInfo;
use pallet_transaction_payment::FungibleAdapter;
use scale_info::TypeInfo;
pub use sp_consensus_aura::sr25519::AuthorityId as AuraId;
pub use sp_runtime::{MultiAddress, Perbill, Permill};

// Wait until more upstream code has migrated, see:
// https://github.com/paritytech/polkadot-sdk/pull/2292
#[allow(deprecated)]
use pallet_transaction_payment::CurrencyAdapter;

#[cfg(any(feature = "std", test))]
pub use sp_runtime::BuildStorage;

Expand Down Expand Up @@ -329,22 +325,35 @@ impl Contains<RuntimeCall> for BaseCallFilter {
}

impl frame_system::Config for Runtime {
/// The identifier used to distinguish between accounts.
type AccountId = AccountId;
/// The ubiquitous event type.
type RuntimeEvent = RuntimeEvent;
/// The basic call filter to use in dispatchable.
type BaseCallFilter = BaseCallFilter;
/// Block & extrinsics weights: base values and limits.
type BlockWeights = RuntimeBlockWeights;
/// The maximum length of a block (in bytes).
type BlockLength = RuntimeBlockLength;
/// The ubiquitous origin type.
type RuntimeOrigin = RuntimeOrigin;
/// The aggregated dispatch type that is available for extrinsics.
type RuntimeCall = RuntimeCall;
/// The lookup mechanism to get account ID from whatever is passed in dispatchers.
type Lookup = AccountIdLookup<AccountId, ()>;
type RuntimeTask = RuntimeTask;
/// The Nonce value type
type Nonce = Nonce;
/// The type for hashing blocks and tries.
type Hash = Hash;
/// The hashing algorithm used.
type Hashing = BlakeTwo256;
/// The ubiquitous event type.
type RuntimeEvent = RuntimeEvent;
/// The ubiquitous origin type.
type RuntimeOrigin = RuntimeOrigin;
/// The identifier used to distinguish between accounts.
type AccountId = AccountId;
/// The lookup mechanism to get account ID from whatever is passed in dispatchers.
type Lookup = AccountIdLookup<AccountId, ()>;
/// The Block provider type
type Block = Block;
/// Maximum number of block number to block hash mappings to keep (oldest pruned first).
type BlockHashCount = BlockHashCount;
/// The weight of database operations that the runtime can invoke.
type DbWeight = RocksDbWeight;
/// Runtime version.
type Version = Version;
/// Converts a module to an index of this module in the runtime.
Expand All @@ -355,26 +364,13 @@ impl frame_system::Config for Runtime {
type OnNewAccount = ();
/// What to do if an account is fully reaped from the system.
type OnKilledAccount = ();
/// The weight of database operations that the runtime can invoke.
type DbWeight = RocksDbWeight;
/// The basic call filter to use in dispatchable.
type BaseCallFilter = BaseCallFilter;
/// Weight information for the extrinsics of this pallet.
type SystemWeightInfo = weights::frame_system::WeightInfo<Runtime>;
/// Block & extrinsics weights: base values and limits.
type BlockWeights = RuntimeBlockWeights;
/// The maximum length of a block (in bytes).
type BlockLength = RuntimeBlockLength;
/// This is used as an identifier of the chain. 42 is the generic substrate prefix.
type SS58Prefix = SS58Prefix;
/// The action to take on a Runtime Upgrade
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
type MaxConsumers = frame_support::traits::ConstU32<16>;
/// The Nonce value type
type Nonce = Nonce;
/// The Block provider type
type Block = Block;
type RuntimeTask = RuntimeTask;
// Note: Single block migrations are currently run in the classical way in the `Executive`
// because try-runtime doesn't support the pallet-migrations yet.
//
Expand Down Expand Up @@ -485,10 +481,7 @@ parameter_types! {

impl pallet_transaction_payment::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
// Wait until more upstream code has migrated, see:
// https://github.com/paritytech/polkadot-sdk/pull/2292
#[allow(deprecated)]
type OnChargeTransaction = CurrencyAdapter<Balances, Treasury>;
type OnChargeTransaction = FungibleAdapter<Balances, ResolveTo<TreasuryAccount, Balances>>;
type WeightToFee = WeightToFee;
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
Expand Down

0 comments on commit 600f408

Please sign in to comment.