mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 15:11: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 constants::{currency::*, fee::WeightToFee};
|
||||||
use frame_support::{
|
use frame_support::{
|
||||||
construct_runtime, match_type, parameter_types,
|
construct_runtime, match_type, parameter_types,
|
||||||
traits::{Contains, Everything, InstanceFilter, Nothing},
|
traits::{Everything, InstanceFilter, Nothing},
|
||||||
weights::{
|
weights::{
|
||||||
constants::{BlockExecutionWeight, ExtrinsicBaseWeight},
|
constants::{BlockExecutionWeight, ExtrinsicBaseWeight},
|
||||||
DispatchClass, IdentityFee, Weight,
|
DispatchClass, IdentityFee, Weight,
|
||||||
@@ -127,16 +127,9 @@ parameter_types! {
|
|||||||
pub const SS58Prefix: u8 = 2;
|
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.
|
// Configure FRAME pallets to include in runtime.
|
||||||
impl frame_system::Config for Runtime {
|
impl frame_system::Config for Runtime {
|
||||||
type BaseCallFilter = BaseFilter;
|
type BaseCallFilter = frame_support::traits::Everything;
|
||||||
type BlockWeights = RuntimeBlockWeights;
|
type BlockWeights = RuntimeBlockWeights;
|
||||||
type BlockLength = RuntimeBlockLength;
|
type BlockLength = RuntimeBlockLength;
|
||||||
type AccountId = AccountId;
|
type AccountId = AccountId;
|
||||||
@@ -253,34 +246,6 @@ impl pallet_assets::Config for Runtime {
|
|||||||
type WeightInfo = weights::pallet_assets::WeightInfo<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! {
|
parameter_types! {
|
||||||
// One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes.
|
// One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes.
|
||||||
pub const DepositBase: Balance = deposit(1, 88);
|
pub const DepositBase: Balance = deposit(1, 88);
|
||||||
@@ -345,7 +310,7 @@ pub enum ProxyType {
|
|||||||
AssetOwner,
|
AssetOwner,
|
||||||
/// Asset manager. Can execute calls related to asset management.
|
/// Asset manager. Can execute calls related to asset management.
|
||||||
AssetManager,
|
AssetManager,
|
||||||
// Collator selection proxy. Can execute calls related to collator selection mechanism.
|
/// Collator selection proxy. Can execute calls related to collator selection mechanism.
|
||||||
Collator,
|
Collator,
|
||||||
}
|
}
|
||||||
impl Default for ProxyType {
|
impl Default for ProxyType {
|
||||||
@@ -528,7 +493,7 @@ pub type XcmOriginToTransactDispatchOrigin = (
|
|||||||
// using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for
|
// 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.
|
// foreign chains who want to have a local sovereign account on this chain which they control.
|
||||||
SovereignSignedViaLocation<LocationToAccountId, Origin>,
|
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.
|
// recognised.
|
||||||
RelayChainAsNative<RelayChainOrigin, Origin>,
|
RelayChainAsNative<RelayChainOrigin, Origin>,
|
||||||
// Native converter for sibling Parachains; will convert to a `SiblingPara` origin when
|
// Native converter for sibling Parachains; will convert to a `SiblingPara` origin when
|
||||||
@@ -566,8 +531,8 @@ match_type! {
|
|||||||
pub type Barrier = (
|
pub type Barrier = (
|
||||||
TakeWeightCredit,
|
TakeWeightCredit,
|
||||||
AllowTopLevelPaidExecutionFrom<Everything>,
|
AllowTopLevelPaidExecutionFrom<Everything>,
|
||||||
|
// Parent and its exec plurality get free execution
|
||||||
AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
|
AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
|
||||||
// ^^^ Parent and its exec plurality get free execution
|
|
||||||
// Expected responses are OK.
|
// Expected responses are OK.
|
||||||
AllowKnownQueryResponses<PolkadotXcm>,
|
AllowKnownQueryResponses<PolkadotXcm>,
|
||||||
// Subscriptions for version tracking are OK.
|
// Subscriptions for version tracking are OK.
|
||||||
@@ -578,7 +543,6 @@ pub struct XcmConfig;
|
|||||||
impl Config for XcmConfig {
|
impl Config for XcmConfig {
|
||||||
type Call = Call;
|
type Call = Call;
|
||||||
type XcmSender = XcmRouter;
|
type XcmSender = XcmRouter;
|
||||||
// How to withdraw and deposit an asset.
|
|
||||||
type AssetTransactor = AssetTransactors;
|
type AssetTransactor = AssetTransactors;
|
||||||
type OriginConverter = XcmOriginToTransactDispatchOrigin;
|
type OriginConverter = XcmOriginToTransactDispatchOrigin;
|
||||||
type IsReserve = NativeAsset;
|
type IsReserve = NativeAsset;
|
||||||
@@ -622,7 +586,6 @@ impl pallet_xcm::Config for Runtime {
|
|||||||
type LocationInverter = LocationInverter<Ancestry>;
|
type LocationInverter = LocationInverter<Ancestry>;
|
||||||
type Origin = Origin;
|
type Origin = Origin;
|
||||||
type Call = Call;
|
type Call = Call;
|
||||||
|
|
||||||
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
|
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
|
||||||
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
|
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.
|
// Create the runtime by composing the FRAME pallets that were previously configured.
|
||||||
construct_runtime!(
|
construct_runtime!(
|
||||||
pub enum Runtime where
|
pub enum Runtime where
|
||||||
|
|||||||
@@ -322,7 +322,7 @@ pub enum ProxyType {
|
|||||||
AssetOwner,
|
AssetOwner,
|
||||||
/// Asset manager. Can execute calls related to asset management.
|
/// Asset manager. Can execute calls related to asset management.
|
||||||
AssetManager,
|
AssetManager,
|
||||||
// Collator selection proxy. Can execute calls related to collator selection mechanism.
|
/// Collator selection proxy. Can execute calls related to collator selection mechanism.
|
||||||
Collator,
|
Collator,
|
||||||
}
|
}
|
||||||
impl Default for ProxyType {
|
impl Default for ProxyType {
|
||||||
@@ -505,7 +505,7 @@ pub type XcmOriginToTransactDispatchOrigin = (
|
|||||||
// using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for
|
// 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.
|
// foreign chains who want to have a local sovereign account on this chain which they control.
|
||||||
SovereignSignedViaLocation<LocationToAccountId, Origin>,
|
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.
|
// recognised.
|
||||||
RelayChainAsNative<RelayChainOrigin, Origin>,
|
RelayChainAsNative<RelayChainOrigin, Origin>,
|
||||||
// Native converter for sibling Parachains; will convert to a `SiblingPara` origin when
|
// Native converter for sibling Parachains; will convert to a `SiblingPara` origin when
|
||||||
@@ -543,8 +543,8 @@ match_type! {
|
|||||||
pub type Barrier = (
|
pub type Barrier = (
|
||||||
TakeWeightCredit,
|
TakeWeightCredit,
|
||||||
AllowTopLevelPaidExecutionFrom<Everything>,
|
AllowTopLevelPaidExecutionFrom<Everything>,
|
||||||
|
// Parent and its exec plurality get free execution
|
||||||
AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
|
AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
|
||||||
// ^^^ Parent and its exec plurality get free execution
|
|
||||||
// Expected responses are OK.
|
// Expected responses are OK.
|
||||||
AllowKnownQueryResponses<PolkadotXcm>,
|
AllowKnownQueryResponses<PolkadotXcm>,
|
||||||
// Subscriptions for version tracking are OK.
|
// Subscriptions for version tracking are OK.
|
||||||
|
|||||||
@@ -213,13 +213,6 @@ impl pallet_transaction_payment::Config for Runtime {
|
|||||||
type OperationalFeeMultiplier = OperationalFeeMultiplier;
|
type OperationalFeeMultiplier = OperationalFeeMultiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl pallet_sudo::Config for Runtime {
|
|
||||||
type Event = Event;
|
|
||||||
type Call = Call;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub type AssetsForceOrigin = EnsureRoot<AccountId>;
|
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const AssetDeposit: Balance = 1 * UNITS; // 1 WND deposit to create asset
|
pub const AssetDeposit: Balance = 1 * UNITS; // 1 WND deposit to create asset
|
||||||
pub const ApprovalDeposit: Balance = EXISTENTIAL_DEPOSIT;
|
pub const ApprovalDeposit: Balance = EXISTENTIAL_DEPOSIT;
|
||||||
@@ -230,6 +223,8 @@ parameter_types! {
|
|||||||
pub const MetadataDepositPerByte: Balance = deposit(0, 1);
|
pub const MetadataDepositPerByte: Balance = deposit(0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub type AssetsForceOrigin = EnsureRoot<AccountId>;
|
||||||
|
|
||||||
impl pallet_assets::Config for Runtime {
|
impl pallet_assets::Config for Runtime {
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type Balance = Balance;
|
type Balance = Balance;
|
||||||
@@ -300,7 +295,7 @@ parameter_types! {
|
|||||||
pub enum ProxyType {
|
pub enum ProxyType {
|
||||||
/// Fully permissioned proxy. Can execute any call on behalf of _proxied_.
|
/// Fully permissioned proxy. Can execute any call on behalf of _proxied_.
|
||||||
Any,
|
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,
|
NonTransfer,
|
||||||
/// Proxy with the ability to reject time-delay proxy announcements.
|
/// Proxy with the ability to reject time-delay proxy announcements.
|
||||||
CancelProxy,
|
CancelProxy,
|
||||||
@@ -525,8 +520,8 @@ match_type! {
|
|||||||
pub type Barrier = (
|
pub type Barrier = (
|
||||||
TakeWeightCredit,
|
TakeWeightCredit,
|
||||||
AllowTopLevelPaidExecutionFrom<Everything>,
|
AllowTopLevelPaidExecutionFrom<Everything>,
|
||||||
|
// Parent and its plurality get free execution
|
||||||
AllowUnpaidExecutionFrom<ParentOrParentsPlurality>,
|
AllowUnpaidExecutionFrom<ParentOrParentsPlurality>,
|
||||||
// ^^^ Parent & its plurality gets free execution
|
|
||||||
// Expected responses are OK.
|
// Expected responses are OK.
|
||||||
AllowKnownQueryResponses<PolkadotXcm>,
|
AllowKnownQueryResponses<PolkadotXcm>,
|
||||||
// Subscriptions for version tracking are OK.
|
// Subscriptions for version tracking are OK.
|
||||||
@@ -580,7 +575,6 @@ impl pallet_xcm::Config for Runtime {
|
|||||||
type LocationInverter = LocationInverter<Ancestry>;
|
type LocationInverter = LocationInverter<Ancestry>;
|
||||||
type Origin = Origin;
|
type Origin = Origin;
|
||||||
type Call = Call;
|
type Call = Call;
|
||||||
|
|
||||||
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
|
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
|
||||||
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
|
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
|
||||||
}
|
}
|
||||||
@@ -637,10 +631,12 @@ parameter_types! {
|
|||||||
pub const MaxInvulnerables: u32 = 100;
|
pub const MaxInvulnerables: u32 = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub type CollatorSelectionUpdateOrigin = EnsureRoot<AccountId>;
|
||||||
|
|
||||||
impl pallet_collator_selection::Config for Runtime {
|
impl pallet_collator_selection::Config for Runtime {
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type Currency = Balances;
|
type Currency = Balances;
|
||||||
type UpdateOrigin = EnsureRoot<AccountId>;
|
type UpdateOrigin = CollatorSelectionUpdateOrigin;
|
||||||
type PotId = PotId;
|
type PotId = PotId;
|
||||||
type MaxCandidates = MaxCandidates;
|
type MaxCandidates = MaxCandidates;
|
||||||
type MinCandidates = MinCandidates;
|
type MinCandidates = MinCandidates;
|
||||||
@@ -689,6 +685,11 @@ impl pallet_uniques::Config for Runtime {
|
|||||||
type WeightInfo = weights::pallet_uniques::WeightInfo<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.
|
// Create the runtime by composing the FRAME pallets that were previously configured.
|
||||||
construct_runtime!(
|
construct_runtime!(
|
||||||
pub enum Runtime where
|
pub enum Runtime where
|
||||||
|
|||||||
Reference in New Issue
Block a user