// 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 . //! 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_core::ParaId; /// Configuration trait of this pallet. pub trait Config: frame_system::Config {} impl Get for Module { fn get() -> ParaId { Self::parachain_id() } } decl_storage! { trait Store for Module as ParachainInfo { ParachainId get(fn parachain_id) config(): ParaId = 100.into(); } } decl_module! { pub struct Module for enum Call where origin: T::Origin {} }