* upgrade to v1.7.0 from v1.6.0

* update rust version

* fix dalek and tests (use rust-src in components)

* remove pallet template
This commit is contained in:
Özgün Özerk
2024-02-20 17:50:57 +03:00
committed by GitHub
parent 7792b7d386
commit 7af4ae2c50
16 changed files with 1568 additions and 1758 deletions
+8 -24
View File
@@ -13,7 +13,7 @@ pub mod xcm_config;
use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;
use cumulus_primitives_core::{AggregateMessageOrigin, ParaId};
use frame_support::{
construct_runtime,
construct_runtime, derive_impl,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
parameter_types,
@@ -294,7 +294,10 @@ impl Contains<RuntimeCall> for NormalFilter {
}
}
// Configure FRAME pallets to include in runtime.
/// The default types are being injected by [`derive_impl`](`frame_support::derive_impl`) from
/// [`ParaChainDefaultConfig`](`struct@frame_system::config_preludes::ParaChainDefaultConfig`),
/// but overridden as needed.
#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
/// The data to be stored in an account.
type AccountData = pallet_balances::AccountData<Balance>;
@@ -304,8 +307,7 @@ impl frame_system::Config for Runtime {
type BaseCallFilter = NormalFilter;
/// The block type.
type Block = Block;
/// Maximum number of block number to block hash mappings to keep (oldest
/// pruned first).
/// Maximum number of block number to block hash mappings to keep (oldest pruned first).
type BlockHashCount = BlockHashCount;
/// The maximum length of a block (in bytes).
type BlockLength = RuntimeBlockLength;
@@ -315,18 +317,13 @@ impl frame_system::Config for Runtime {
type DbWeight = RocksDbWeight;
/// The type for hashing blocks and tries.
type Hash = Hash;
/// The hashing algorithm used.
type Hashing = BlakeTwo256;
/// The lookup mechanism to get account ID from whatever is passed in
/// dispatchers.
type Lookup = AccountIdLookup<AccountId, ()>;
/// The maximum number of consumers allowed on a single account.
type MaxConsumers = ConstU32<16>;
/// The index type for storing how many extrinsics an account has signed.
type Nonce = Nonce;
/// What to do if an account is fully reaped from the system.
type OnKilledAccount = ();
/// What to do if a new account is created.
type OnNewAccount = ();
/// The action to take on a Runtime Upgrade
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
/// Converts a module to an index of this module in the runtime.
@@ -337,11 +334,8 @@ impl frame_system::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
/// The ubiquitous origin type.
type RuntimeOrigin = RuntimeOrigin;
/// This is used as an identifier of the chain. 42 is the generic substrate
/// prefix.
/// This is used as an identifier of the chain. 42 is the generic substrate prefix.
type SS58Prefix = SS58Prefix;
/// Weight information for the extrinsics of this pallet.
type SystemWeightInfo = ();
/// Runtime version.
type Version = Version;
}
@@ -431,7 +425,6 @@ impl pallet_proxy::Config for Runtime {
parameter_types! {
pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT;
pub const MaxFreezes: u32 = 0;
pub const MaxHolds: u32 = 0;
pub const MaxLocks: u32 = 50;
pub const MaxReserves: u32 = 50;
}
@@ -444,7 +437,6 @@ impl pallet_balances::Config for Runtime {
type ExistentialDeposit = ExistentialDeposit;
type FreezeIdentifier = ();
type MaxFreezes = MaxFreezes;
type MaxHolds = MaxHolds;
type MaxLocks = MaxLocks;
type MaxReserves = MaxReserves;
type ReserveIdentifier = [u8; 8];
@@ -670,11 +662,6 @@ impl pallet_collator_selection::Config for Runtime {
type WeightInfo = pallet_collator_selection::weights::SubstrateWeight<Runtime>;
}
/// Configure the pallet template in pallets/template.
impl pallet_template::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
}
impl pallet_utility::Config for Runtime {
type PalletsOrigin = OriginCaller;
type RuntimeCall = RuntimeCall;
@@ -717,9 +704,6 @@ construct_runtime!(
PolkadotXcm: pallet_xcm = 31,
CumulusXcm: cumulus_pallet_xcm = 32,
MessageQueue: pallet_message_queue = 33,
// Template
TemplatePallet: pallet_template = 50,
}
);
+20 -18
View File
@@ -1,6 +1,6 @@
use frame_support::{
match_types, parameter_types,
traits::{ConstU32, Everything, Nothing, PalletInfoAccess},
parameter_types,
traits::{ConstU32, Contains, Everything, Nothing, PalletInfoAccess},
weights::Weight,
};
use frame_system::EnsureRoot;
@@ -10,11 +10,12 @@ use polkadot_runtime_common::impls::ToAuthor;
use xcm::latest::prelude::*;
use xcm_builder::{
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowTopLevelPaidExecutionFrom,
CurrencyAdapter, DenyReserveTransferToRelayChain, DenyThenTry, EnsureXcmOrigin,
FixedWeightBounds, FungiblesAdapter, IsConcrete, NativeAsset, NoChecking, ParentIsPreset,
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
TrailingSetTopicAsId, UsingComponents, WithComputedOrigin, WithUniqueTopic,
DenyReserveTransferToRelayChain, DenyThenTry, EnsureXcmOrigin, FixedWeightBounds,
FrameTransactionalProcessor, FungibleAdapter, FungiblesAdapter, IsConcrete, NativeAsset,
NoChecking, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents,
WithComputedOrigin, WithUniqueTopic,
};
use xcm_executor::XcmExecutor;
@@ -24,20 +25,20 @@ use super::{
};
parameter_types! {
pub const RelayLocation: MultiLocation = MultiLocation::parent();
pub const RelayLocation: Location = Location::parent();
pub const RelayNetwork: Option<NetworkId> = None;
pub PlaceholderAccount: AccountId = PolkadotXcm::check_account();
pub AssetsPalletLocation: MultiLocation =
pub AssetsPalletLocation: Location =
PalletInstance(<Assets as PalletInfoAccess>::index() as u8).into();
pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into();
pub UniversalLocation: InteriorMultiLocation = Parachain(ParachainInfo::parachain_id().into()).into();
pub UniversalLocation: InteriorLocation = Parachain(ParachainInfo::parachain_id().into()).into();
}
/// `AssetId/Balancer` converter for `TrustBackedAssets`
pub type TrustBackedAssetsConvertedConcreteId =
assets_common::TrustBackedAssetsConvertedConcreteId<AssetsPalletLocation, Balance>;
/// Type for specifying how a `MultiLocation` can be converted into an
/// Type for specifying how a `Location` can be converted into an
/// `AccountId`. This is used when determining ownership of accounts for asset
/// transacting and when attempting to use XCM `Transact` in order to determine
/// the dispatch Origin.
@@ -51,12 +52,12 @@ pub type LocationToAccountId = (
);
/// Means for transacting assets on this chain.
pub type LocalAssetTransactor = CurrencyAdapter<
pub type LocalAssetTransactor = FungibleAdapter<
// Use this currency:
Balances,
// Use this currency when it is a fungible asset matching the given location or name:
IsConcrete<RelayLocation>,
// Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID:
// Do a simple punn to convert an AccountId32 Location into a native chain account ID:
LocationToAccountId,
// Our chain's account ID type (we can't get away without mentioning it explicitly):
AccountId,
@@ -113,11 +114,11 @@ parameter_types! {
pub const MaxAssetsIntoHolding: u32 = 64;
}
match_types! {
pub type ParentOrParentsExecutivePlurality: impl Contains<MultiLocation> = {
MultiLocation { parents: 1, interior: Here } |
MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) }
};
pub struct ParentOrParentsExecutivePlurality;
impl Contains<Location> for ParentOrParentsExecutivePlurality {
fn contains(location: &Location) -> bool {
matches!(location.unpack(), (1, []) | (1, [Plurality { id: BodyId::Executive, .. }]))
}
}
pub type Barrier = TrailingSetTopicAsId<
@@ -162,6 +163,7 @@ impl xcm_executor::Config for XcmConfig {
type SubscriptionService = PolkadotXcm;
type Trader =
UsingComponents<WeightToFee, RelayLocation, AccountId, Balances, ToAuthor<Runtime>>;
type TransactionalProcessor = FrameTransactionalProcessor;
type UniversalAliases = Nothing;
// Teleporting is disabled.
type UniversalLocation = UniversalLocation;