difftreelog
feat sapphire runtime
in: master
5 files changed
node/cli/Cargo.tomldiffbeforeafterboth--- a/node/cli/Cargo.toml
+++ b/node/cli/Cargo.toml
@@ -335,3 +335,7 @@
'quartz-runtime?/try-runtime',
'opal-runtime?/try-runtime',
]
+sapphire-runtime = [
+ 'opal-runtime',
+ 'opal-runtime/become-sapphire',
+]
node/cli/src/chain_spec.rsdiffbeforeafterboth--- a/node/cli/src/chain_spec.rs
+++ b/node/cli/src/chain_spec.rs
@@ -66,7 +66,7 @@
}
#[cfg(not(feature = "unique-runtime"))]
-/// PARA_ID for Opal/Quartz
+/// PARA_ID for Opal/Sapphire/Quartz
const PARA_ID: u32 = 2095;
#[cfg(feature = "unique-runtime")]
@@ -89,7 +89,11 @@
return RuntimeId::Quartz;
}
- if self.id().starts_with("opal") || self.id() == "dev" || self.id() == "local_testnet" {
+ if self.id().starts_with("opal")
+ || self.id().starts_with("sapphire")
+ || self.id() == "dev"
+ || self.id() == "local_testnet"
+ {
return RuntimeId::Opal;
}
node/cli/src/cli.rsdiffbeforeafterboth--- a/node/cli/src/cli.rs
+++ b/node/cli/src/cli.rs
@@ -101,6 +101,8 @@
"Unique"
} else if cfg!(feature = "quartz-runtime") {
"Quartz"
+ } else if cfg!(feature = "sapphire-runtime") {
+ "Sapphire"
} else {
"Opal"
}
runtime/opal/Cargo.tomldiffbeforeafterboth--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -181,6 +181,7 @@
'foreign-assets',
'pallet-test-utils',
]
+become-sapphire = []
refungible = []
scheduler = []
runtime/opal/src/lib.rsdiffbeforeafterboth1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617//! The Substrate Node Template runtime. This can be compiled with `#[no_std]`, ready for Wasm.1819#![cfg_attr(not(feature = "std"), no_std)]20// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.21#![recursion_limit = "1024"]22#![allow(clippy::from_over_into, clippy::identity_op)]23#![allow(clippy::fn_to_numeric_cast_with_truncation)]24// Make the WASM binary available.25#[cfg(feature = "std")]26include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));2728use frame_support::parameter_types;2930use sp_version::RuntimeVersion;31use sp_runtime::create_runtime_str;3233use up_common::types::*;3435#[path = "../../common/mod.rs"]36mod runtime_common;3738pub mod xcm_barrier;3940#[cfg(test)]41mod tests;4243pub use runtime_common::*;4445pub const RUNTIME_NAME: &str = "opal";46pub const TOKEN_SYMBOL: &str = "OPL";4748/// This runtime version.49pub const VERSION: RuntimeVersion = RuntimeVersion {50 spec_name: create_runtime_str!(RUNTIME_NAME),51 impl_name: create_runtime_str!(RUNTIME_NAME),52 authoring_version: 1,53 spec_version: 930032,54 impl_version: 0,55 apis: RUNTIME_API_VERSIONS,56 transaction_version: 2,57 state_version: 0,58};5960parameter_types! {61 pub const Version: RuntimeVersion = VERSION;62 pub const SS58Prefix: u8 = 42;63 pub const ChainId: u64 = 8882;64}6566construct_runtime!(opal);6768impl_common_runtime_apis!();6970cumulus_pallet_parachain_system::register_validate_block!(71 Runtime = Runtime,72 BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,73 CheckInherents = CheckInherents,74);1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617//! The Substrate Node Template runtime. This can be compiled with `#[no_std]`, ready for Wasm.1819#![cfg_attr(not(feature = "std"), no_std)]20// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.21#![recursion_limit = "1024"]22#![allow(clippy::from_over_into, clippy::identity_op)]23#![allow(clippy::fn_to_numeric_cast_with_truncation)]24// Make the WASM binary available.25#[cfg(feature = "std")]26include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));2728use frame_support::parameter_types;2930use sp_version::RuntimeVersion;31use sp_runtime::create_runtime_str;3233use up_common::types::*;3435#[path = "../../common/mod.rs"]36mod runtime_common;3738pub mod xcm_barrier;3940#[cfg(test)]41mod tests;4243pub use runtime_common::*;4445#[cfg(feature = "become-sapphire")]46pub const RUNTIME_NAME: &str = "sapphire";47#[cfg(feature = "become-sapphire")]48pub const TOKEN_SYMBOL: &str = "QTZ";4950#[cfg(not(feature = "become-sapphire"))]51pub const RUNTIME_NAME: &str = "opal";52#[cfg(not(feature = "become-sapphire"))]53pub const TOKEN_SYMBOL: &str = "OPL";5455/// This runtime version.56pub const VERSION: RuntimeVersion = RuntimeVersion {57 spec_name: create_runtime_str!(RUNTIME_NAME),58 impl_name: create_runtime_str!(RUNTIME_NAME),59 authoring_version: 1,60 spec_version: 930032,61 impl_version: 0,62 apis: RUNTIME_API_VERSIONS,63 transaction_version: 2,64 state_version: 0,65};6667parameter_types! {68 pub const Version: RuntimeVersion = VERSION;69}70#[cfg(feature = "become-sapphire")]71parameter_types! {72 pub const SS58Prefix: u16 = 8883;73 pub const ChainId: u64 = 8883;74}7576#[cfg(not(feature = "become-sapphire"))]77parameter_types! {78 pub const SS58Prefix: u16 = 42;79 pub const ChainId: u64 = 8882;80}8182construct_runtime!(opal);8384impl_common_runtime_apis!();8586cumulus_pallet_parachain_system::register_validate_block!(87 Runtime = Runtime,88 BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,89 CheckInherents = CheckInherents,90);