Separate ParachainId injection to its own pallet (#183)

* Separate paraid injection to own pallet

* Move token dealer to a crate

* Move to rococo-parachains

* Remove parameter_types hack

* Fix chainspec

* fix build

* remove commented code

* Update contracts runtime to match other runtime

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Alphebetize workspace members

* Parachain info to own crate

* prune system = frame_system

Co-authored-by: Ricardo Rius <ricardo@parity.io>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Joshy Orndorff
2020-08-07 15:52:15 -04:00
committed by GitHub
parent 8a6e29eef9
commit d8aabf0c32
13 changed files with 165 additions and 224 deletions
@@ -36,8 +36,6 @@ use sp_std::prelude::*;
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
mod message_example;
// A few exports that help ease life for downstream crates.
pub use frame_support::{
construct_runtime, parameter_types,
@@ -244,20 +242,16 @@ impl cumulus_parachain_upgrade::Trait for Runtime {
type OnValidationFunctionParams = ();
}
parameter_types! {
pub storage ParachainId: cumulus_primitives::ParaId = 100.into();
}
impl cumulus_message_broker::Trait for Runtime {
type Event = Event;
type DownwardMessageHandlers = TokenDealer;
type UpwardMessage = cumulus_upward_message::RococoUpwardMessage;
type ParachainId = ParachainId;
type XCMPMessage = XCMPMessage<AccountId, Balance>;
type ParachainId = ParachainInfo;
type XCMPMessage = cumulus_token_dealer::XCMPMessage<AccountId, Balance>;
type XCMPMessageHandlers = TokenDealer;
}
impl message_example::Trait for Runtime {
impl cumulus_token_dealer::Trait for Runtime {
type Event = Event;
type UpwardMessageSender = MessageBroker;
type UpwardMessage = cumulus_upward_message::RococoUpwardMessage;
@@ -265,6 +259,8 @@ impl message_example::Trait for Runtime {
type XCMPMessageSender = MessageBroker;
}
impl parachain_info::Trait for Runtime {}
// We disable the rent system for easier testing.
parameter_types! {
pub const TombstoneDeposit: Balance = 0;
@@ -307,8 +303,9 @@ construct_runtime! {
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage},
ParachainUpgrade: cumulus_parachain_upgrade::{Module, Call, Storage, Inherent, Event},
MessageBroker: cumulus_message_broker::{Module, Call, Inherent, Event<T>},
TokenDealer: message_example::{Module, Call, Event<T>, Config},
TokenDealer: cumulus_token_dealer::{Module, Call, Event<T>},
TransactionPayment: pallet_transaction_payment::{Module, Storage},
ParachainInfo: parachain_info::{Module, Storage, Config},
}
}