Update polkadot to the latest master (#251)

* update cumulus to latest polkadot

* s/Trait/Config

To be more consistent with the new naming.

* Update Cargo.lock

* fix network tests
This commit is contained in:
Sergei Shulepov
2020-12-01 19:21:40 +01:00
committed by GitHub
parent 4e82ce66c1
commit ba1fa36411
10 changed files with 359 additions and 326 deletions
+10 -10
View File
@@ -108,7 +108,7 @@ parameter_types! {
pub const ExtrinsicBaseWeight: Weight = 10_000_000;
}
impl frame_system::Trait for Runtime {
impl frame_system::Config for Runtime {
/// The identifier used to distinguish between accounts.
type AccountId = AccountId;
/// The aggregated dispatch type that is available for extrinsics.
@@ -155,7 +155,7 @@ parameter_types! {
pub const MinimumPeriod: u64 = SLOT_DURATION / 2;
}
impl pallet_timestamp::Trait for Runtime {
impl pallet_timestamp::Config for Runtime {
/// A timestamp: milliseconds since the unix epoch.
type Moment = u64;
type OnTimestampSet = ();
@@ -170,7 +170,7 @@ parameter_types! {
pub const TransactionByteFee: u128 = 1;
}
impl pallet_balances::Trait for Runtime {
impl pallet_balances::Config for Runtime {
/// The type for recording an account's balance.
type Balance = Balance;
/// The ubiquitous event type.
@@ -181,7 +181,7 @@ impl pallet_balances::Trait for Runtime {
type WeightInfo = ();
}
impl pallet_transaction_payment::Trait for Runtime {
impl pallet_transaction_payment::Config for Runtime {
type Currency = Balances;
type OnTransactionPayment = ();
type TransactionByteFee = TransactionByteFee;
@@ -189,17 +189,17 @@ impl pallet_transaction_payment::Trait for Runtime {
type FeeMultiplierUpdate = ();
}
impl pallet_sudo::Trait for Runtime {
impl pallet_sudo::Config for Runtime {
type Call = Call;
type Event = Event;
}
impl cumulus_parachain_upgrade::Trait for Runtime {
impl cumulus_parachain_upgrade::Config for Runtime {
type Event = Event;
type OnValidationFunctionParams = ();
}
impl cumulus_message_broker::Trait for Runtime {
impl cumulus_message_broker::Config for Runtime {
type Event = Event;
type DownwardMessageHandlers = TokenDealer;
type UpwardMessage = cumulus_upward_message::RococoUpwardMessage;
@@ -208,7 +208,7 @@ impl cumulus_message_broker::Trait for Runtime {
type XCMPMessageHandlers = TokenDealer;
}
impl cumulus_token_dealer::Trait for Runtime {
impl cumulus_token_dealer::Config for Runtime {
type Event = Event;
type UpwardMessageSender = MessageBroker;
type UpwardMessage = cumulus_upward_message::RococoUpwardMessage;
@@ -216,7 +216,7 @@ impl cumulus_token_dealer::Trait for Runtime {
type XCMPMessageSender = MessageBroker;
}
impl parachain_info::Trait for Runtime {}
impl parachain_info::Config for Runtime {}
// We disable the rent system for easier testing.
parameter_types! {
@@ -226,7 +226,7 @@ parameter_types! {
pub const SurchargeReward: Balance = 0;
}
impl cumulus_pallet_contracts::Trait for Runtime {
impl cumulus_pallet_contracts::Config for Runtime {
type Time = Timestamp;
type Randomness = RandomnessCollectiveFlip;
type Currency = Balances;
@@ -23,20 +23,20 @@ use frame_support::{decl_module, decl_storage, traits::Get};
use cumulus_primitives::ParaId;
/// Configuration trait of this pallet.
pub trait Trait: frame_system::Trait {}
pub trait Config: frame_system::Config {}
impl<T: Trait> Get<ParaId> for Module<T> {
impl<T: Config> Get<ParaId> for Module<T> {
fn get() -> ParaId {
Self::parachain_id()
}
}
decl_storage! {
trait Store for Module<T: Trait> as ParachainUpgrade {
trait Store for Module<T: Config> as ParachainUpgrade {
ParachainId get(fn parachain_id) config(): ParaId = 100.into();
}
}
decl_module! {
pub struct Module<T: Trait> for enum Call where origin: T::Origin {}
pub struct Module<T: Config> for enum Call where origin: T::Origin {}
}
+8 -8
View File
@@ -107,7 +107,7 @@ parameter_types! {
pub const ExtrinsicBaseWeight: Weight = 10_000_000;
}
impl frame_system::Trait for Runtime {
impl frame_system::Config for Runtime {
/// The identifier used to distinguish between accounts.
type AccountId = AccountId;
/// The aggregated dispatch type that is available for extrinsics.
@@ -155,7 +155,7 @@ parameter_types! {
pub const MinimumPeriod: u64 = SLOT_DURATION / 2;
}
impl pallet_timestamp::Trait for Runtime {
impl pallet_timestamp::Config for Runtime {
/// A timestamp: milliseconds since the unix epoch.
type Moment = u64;
type OnTimestampSet = ();
@@ -171,7 +171,7 @@ parameter_types! {
pub const MaxLocks: u32 = 50;
}
impl pallet_balances::Trait for Runtime {
impl pallet_balances::Config for Runtime {
/// The type for recording an account's balance.
type Balance = Balance;
/// The ubiquitous event type.
@@ -183,28 +183,28 @@ impl pallet_balances::Trait for Runtime {
type MaxLocks = MaxLocks;
}
impl pallet_transaction_payment::Trait for Runtime {
impl pallet_transaction_payment::Config for Runtime {
type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, ()>;
type TransactionByteFee = TransactionByteFee;
type WeightToFee = IdentityFee<Balance>;
type FeeMultiplierUpdate = ();
}
impl pallet_sudo::Trait for Runtime {
impl pallet_sudo::Config for Runtime {
type Call = Call;
type Event = Event;
}
impl cumulus_parachain_upgrade::Trait for Runtime {
impl cumulus_parachain_upgrade::Config for Runtime {
type Event = Event;
type OnValidationData = ();
}
impl cumulus_message_broker::Trait for Runtime {
impl cumulus_message_broker::Config for Runtime {
type DownwardMessageHandlers = ();
}
impl parachain_info::Trait for Runtime {}
impl parachain_info::Config for Runtime {}
construct_runtime! {
pub enum Runtime where