mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-09 17:38:02 +00:00
Align the Statemint Runtimes (#736)
* align the different Statemint runtimes so they are more similar in structure * align Unpaid Execution filter * revert changes to Unpaid execution filter for Westmint
This commit is contained in:
@@ -43,7 +43,7 @@ use codec::{Decode, Encode, MaxEncodedLen};
|
||||
use constants::{currency::*, fee::WeightToFee};
|
||||
use frame_support::{
|
||||
construct_runtime, match_type, parameter_types,
|
||||
traits::{Contains, Everything, InstanceFilter, Nothing},
|
||||
traits::{Everything, InstanceFilter, Nothing},
|
||||
weights::{
|
||||
constants::{BlockExecutionWeight, ExtrinsicBaseWeight},
|
||||
DispatchClass, IdentityFee, Weight,
|
||||
@@ -127,16 +127,9 @@ parameter_types! {
|
||||
pub const SS58Prefix: u8 = 2;
|
||||
}
|
||||
|
||||
pub struct BaseFilter;
|
||||
impl Contains<Call> for BaseFilter {
|
||||
fn contains(_c: &Call) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
// Configure FRAME pallets to include in runtime.
|
||||
impl frame_system::Config for Runtime {
|
||||
type BaseCallFilter = BaseFilter;
|
||||
type BaseCallFilter = frame_support::traits::Everything;
|
||||
type BlockWeights = RuntimeBlockWeights;
|
||||
type BlockLength = RuntimeBlockLength;
|
||||
type AccountId = AccountId;
|
||||
@@ -253,34 +246,6 @@ impl pallet_assets::Config for Runtime {
|
||||
type WeightInfo = weights::pallet_assets::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const ClassDeposit: Balance = UNITS; // 1 UNIT deposit to create asset class
|
||||
pub const InstanceDeposit: Balance = UNITS / 100; // 1/100 UNIT deposit to create asset instance
|
||||
pub const KeyLimit: u32 = 32; // Max 32 bytes per key
|
||||
pub const ValueLimit: u32 = 64; // Max 64 bytes per value
|
||||
pub const UniquesMetadataDepositBase: Balance = deposit(1, 129);
|
||||
pub const AttributeDepositBase: Balance = deposit(1, 0);
|
||||
pub const DepositPerByte: Balance = deposit(0, 1);
|
||||
pub const UniquesStringLimit: u32 = 128;
|
||||
}
|
||||
|
||||
impl pallet_uniques::Config for Runtime {
|
||||
type Event = Event;
|
||||
type ClassId = u32;
|
||||
type InstanceId = u32;
|
||||
type Currency = Balances;
|
||||
type ForceOrigin = AssetsForceOrigin;
|
||||
type ClassDeposit = ClassDeposit;
|
||||
type InstanceDeposit = InstanceDeposit;
|
||||
type MetadataDepositBase = UniquesMetadataDepositBase;
|
||||
type AttributeDepositBase = AttributeDepositBase;
|
||||
type DepositPerByte = DepositPerByte;
|
||||
type StringLimit = UniquesStringLimit;
|
||||
type KeyLimit = KeyLimit;
|
||||
type ValueLimit = ValueLimit;
|
||||
type WeightInfo = weights::pallet_uniques::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
// One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes.
|
||||
pub const DepositBase: Balance = deposit(1, 88);
|
||||
@@ -345,7 +310,7 @@ pub enum ProxyType {
|
||||
AssetOwner,
|
||||
/// Asset manager. Can execute calls related to asset management.
|
||||
AssetManager,
|
||||
// Collator selection proxy. Can execute calls related to collator selection mechanism.
|
||||
/// Collator selection proxy. Can execute calls related to collator selection mechanism.
|
||||
Collator,
|
||||
}
|
||||
impl Default for ProxyType {
|
||||
@@ -528,7 +493,7 @@ pub type XcmOriginToTransactDispatchOrigin = (
|
||||
// using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for
|
||||
// foreign chains who want to have a local sovereign account on this chain which they control.
|
||||
SovereignSignedViaLocation<LocationToAccountId, Origin>,
|
||||
// Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when
|
||||
// Native converter for Relay-chain (Parent) location; will convert to a `Relay` origin when
|
||||
// recognised.
|
||||
RelayChainAsNative<RelayChainOrigin, Origin>,
|
||||
// Native converter for sibling Parachains; will convert to a `SiblingPara` origin when
|
||||
@@ -566,8 +531,8 @@ match_type! {
|
||||
pub type Barrier = (
|
||||
TakeWeightCredit,
|
||||
AllowTopLevelPaidExecutionFrom<Everything>,
|
||||
// Parent and its exec plurality get free execution
|
||||
AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
|
||||
// ^^^ Parent and its exec plurality get free execution
|
||||
// Expected responses are OK.
|
||||
AllowKnownQueryResponses<PolkadotXcm>,
|
||||
// Subscriptions for version tracking are OK.
|
||||
@@ -578,7 +543,6 @@ pub struct XcmConfig;
|
||||
impl Config for XcmConfig {
|
||||
type Call = Call;
|
||||
type XcmSender = XcmRouter;
|
||||
// How to withdraw and deposit an asset.
|
||||
type AssetTransactor = AssetTransactors;
|
||||
type OriginConverter = XcmOriginToTransactDispatchOrigin;
|
||||
type IsReserve = NativeAsset;
|
||||
@@ -622,7 +586,6 @@ impl pallet_xcm::Config for Runtime {
|
||||
type LocationInverter = LocationInverter<Ancestry>;
|
||||
type Origin = Origin;
|
||||
type Call = Call;
|
||||
|
||||
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
|
||||
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
|
||||
}
|
||||
@@ -710,6 +673,34 @@ impl pallet_asset_tx_payment::Config for Runtime {
|
||||
>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const ClassDeposit: Balance = UNITS; // 1 UNIT deposit to create asset class
|
||||
pub const InstanceDeposit: Balance = UNITS / 100; // 1/100 UNIT deposit to create asset instance
|
||||
pub const KeyLimit: u32 = 32; // Max 32 bytes per key
|
||||
pub const ValueLimit: u32 = 64; // Max 64 bytes per value
|
||||
pub const UniquesMetadataDepositBase: Balance = deposit(1, 129);
|
||||
pub const AttributeDepositBase: Balance = deposit(1, 0);
|
||||
pub const DepositPerByte: Balance = deposit(0, 1);
|
||||
pub const UniquesStringLimit: u32 = 128;
|
||||
}
|
||||
|
||||
impl pallet_uniques::Config for Runtime {
|
||||
type Event = Event;
|
||||
type ClassId = u32;
|
||||
type InstanceId = u32;
|
||||
type Currency = Balances;
|
||||
type ForceOrigin = AssetsForceOrigin;
|
||||
type ClassDeposit = ClassDeposit;
|
||||
type InstanceDeposit = InstanceDeposit;
|
||||
type MetadataDepositBase = UniquesMetadataDepositBase;
|
||||
type AttributeDepositBase = AttributeDepositBase;
|
||||
type DepositPerByte = DepositPerByte;
|
||||
type StringLimit = UniquesStringLimit;
|
||||
type KeyLimit = KeyLimit;
|
||||
type ValueLimit = ValueLimit;
|
||||
type WeightInfo = weights::pallet_uniques::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
// Create the runtime by composing the FRAME pallets that were previously configured.
|
||||
construct_runtime!(
|
||||
pub enum Runtime where
|
||||
|
||||
@@ -322,7 +322,7 @@ pub enum ProxyType {
|
||||
AssetOwner,
|
||||
/// Asset manager. Can execute calls related to asset management.
|
||||
AssetManager,
|
||||
// Collator selection proxy. Can execute calls related to collator selection mechanism.
|
||||
/// Collator selection proxy. Can execute calls related to collator selection mechanism.
|
||||
Collator,
|
||||
}
|
||||
impl Default for ProxyType {
|
||||
@@ -505,7 +505,7 @@ pub type XcmOriginToTransactDispatchOrigin = (
|
||||
// using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for
|
||||
// foreign chains who want to have a local sovereign account on this chain which they control.
|
||||
SovereignSignedViaLocation<LocationToAccountId, Origin>,
|
||||
// Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when
|
||||
// Native converter for Relay-chain (Parent) location; will convert to a `Relay` origin when
|
||||
// recognised.
|
||||
RelayChainAsNative<RelayChainOrigin, Origin>,
|
||||
// Native converter for sibling Parachains; will convert to a `SiblingPara` origin when
|
||||
@@ -543,8 +543,8 @@ match_type! {
|
||||
pub type Barrier = (
|
||||
TakeWeightCredit,
|
||||
AllowTopLevelPaidExecutionFrom<Everything>,
|
||||
// Parent and its exec plurality get free execution
|
||||
AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
|
||||
// ^^^ Parent and its exec plurality get free execution
|
||||
// Expected responses are OK.
|
||||
AllowKnownQueryResponses<PolkadotXcm>,
|
||||
// Subscriptions for version tracking are OK.
|
||||
|
||||
@@ -213,13 +213,6 @@ impl pallet_transaction_payment::Config for Runtime {
|
||||
type OperationalFeeMultiplier = OperationalFeeMultiplier;
|
||||
}
|
||||
|
||||
impl pallet_sudo::Config for Runtime {
|
||||
type Event = Event;
|
||||
type Call = Call;
|
||||
}
|
||||
|
||||
pub type AssetsForceOrigin = EnsureRoot<AccountId>;
|
||||
|
||||
parameter_types! {
|
||||
pub const AssetDeposit: Balance = 1 * UNITS; // 1 WND deposit to create asset
|
||||
pub const ApprovalDeposit: Balance = EXISTENTIAL_DEPOSIT;
|
||||
@@ -230,6 +223,8 @@ parameter_types! {
|
||||
pub const MetadataDepositPerByte: Balance = deposit(0, 1);
|
||||
}
|
||||
|
||||
pub type AssetsForceOrigin = EnsureRoot<AccountId>;
|
||||
|
||||
impl pallet_assets::Config for Runtime {
|
||||
type Event = Event;
|
||||
type Balance = Balance;
|
||||
@@ -300,7 +295,7 @@ parameter_types! {
|
||||
pub enum ProxyType {
|
||||
/// Fully permissioned proxy. Can execute any call on behalf of _proxied_.
|
||||
Any,
|
||||
/// Can execute any call that does not transfer funds, including asset transfers.
|
||||
/// Can execute any call that does not transfer funds or assets.
|
||||
NonTransfer,
|
||||
/// Proxy with the ability to reject time-delay proxy announcements.
|
||||
CancelProxy,
|
||||
@@ -525,8 +520,8 @@ match_type! {
|
||||
pub type Barrier = (
|
||||
TakeWeightCredit,
|
||||
AllowTopLevelPaidExecutionFrom<Everything>,
|
||||
// Parent and its plurality get free execution
|
||||
AllowUnpaidExecutionFrom<ParentOrParentsPlurality>,
|
||||
// ^^^ Parent & its plurality gets free execution
|
||||
// Expected responses are OK.
|
||||
AllowKnownQueryResponses<PolkadotXcm>,
|
||||
// Subscriptions for version tracking are OK.
|
||||
@@ -580,7 +575,6 @@ impl pallet_xcm::Config for Runtime {
|
||||
type LocationInverter = LocationInverter<Ancestry>;
|
||||
type Origin = Origin;
|
||||
type Call = Call;
|
||||
|
||||
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
|
||||
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
|
||||
}
|
||||
@@ -637,10 +631,12 @@ parameter_types! {
|
||||
pub const MaxInvulnerables: u32 = 100;
|
||||
}
|
||||
|
||||
pub type CollatorSelectionUpdateOrigin = EnsureRoot<AccountId>;
|
||||
|
||||
impl pallet_collator_selection::Config for Runtime {
|
||||
type Event = Event;
|
||||
type Currency = Balances;
|
||||
type UpdateOrigin = EnsureRoot<AccountId>;
|
||||
type UpdateOrigin = CollatorSelectionUpdateOrigin;
|
||||
type PotId = PotId;
|
||||
type MaxCandidates = MaxCandidates;
|
||||
type MinCandidates = MinCandidates;
|
||||
@@ -689,6 +685,11 @@ impl pallet_uniques::Config for Runtime {
|
||||
type WeightInfo = weights::pallet_uniques::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
impl pallet_sudo::Config for Runtime {
|
||||
type Event = Event;
|
||||
type Call = Call;
|
||||
}
|
||||
|
||||
// Create the runtime by composing the FRAME pallets that were previously configured.
|
||||
construct_runtime!(
|
||||
pub enum Runtime where
|
||||
|
||||
Reference in New Issue
Block a user