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 bda46b0b07
commit 1fcd05503a
13 changed files with 165 additions and 224 deletions
@@ -0,0 +1,24 @@
[package]
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
name = "parachain-info"
version = "0.1.0"
[dependencies]
codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.101", optional = true, features = ["derive"] }
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
cumulus-primitives = { path = "../../../primitives", default-features = false }
[features]
default = ["std"]
std = [
"codec/std",
"serde",
"cumulus-primitives/std",
"frame-support/std",
"frame-system/std",
]
@@ -0,0 +1,42 @@
// Copyright 2020 Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Minimal Pallet that injects a ParachainId into Runtime storage from
#![cfg_attr(not(feature = "std"), no_std)]
use frame_support::{decl_module, decl_storage, traits::Get};
use cumulus_primitives::ParaId;
/// Configuration trait of this pallet.
pub trait Trait: frame_system::Trait {}
impl <T: Trait> Get<ParaId> for Module<T> {
fn get() -> ParaId {
Self::parachain_id()
}
}
decl_storage! {
trait Store for Module<T: Trait> 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 {}
}