--- 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', +] --- 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; } --- 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" } --- a/runtime/opal/Cargo.toml +++ b/runtime/opal/Cargo.toml @@ -181,6 +181,7 @@ 'foreign-assets', 'pallet-test-utils', ] +become-sapphire = [] refungible = [] scheduler = [] --- a/runtime/opal/src/lib.rs +++ b/runtime/opal/src/lib.rs @@ -42,7 +42,14 @@ pub use runtime_common::*; +#[cfg(feature = "become-sapphire")] +pub const RUNTIME_NAME: &str = "sapphire"; +#[cfg(feature = "become-sapphire")] +pub const TOKEN_SYMBOL: &str = "QTZ"; + +#[cfg(not(feature = "become-sapphire"))] pub const RUNTIME_NAME: &str = "opal"; +#[cfg(not(feature = "become-sapphire"))] pub const TOKEN_SYMBOL: &str = "OPL"; /// This runtime version. @@ -59,7 +66,16 @@ parameter_types! { pub const Version: RuntimeVersion = VERSION; - pub const SS58Prefix: u8 = 42; +} +#[cfg(feature = "become-sapphire")] +parameter_types! { + pub const SS58Prefix: u16 = 8883; + pub const ChainId: u64 = 8883; +} + +#[cfg(not(feature = "become-sapphire"))] +parameter_types! { + pub const SS58Prefix: u16 = 42; pub const ChainId: u64 = 8882; }