git.delta.rocks / unique-network / refs/commits / 11819bef1c7a

difftreelog

feat sapphire runtime

Alexander Saft2022-11-22parent: #df29d0d.patch.diff
in: master

5 files changed

modifiednode/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',
+]
modifiednode/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;
 		}
 
modifiednode/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"
 				}
modifiedruntime/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 = []
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
4242
43pub use runtime_common::*;43pub use runtime_common::*;
4444
45#[cfg(feature = "become-sapphire")]
46pub const RUNTIME_NAME: &str = "sapphire";
47#[cfg(feature = "become-sapphire")]
48pub const TOKEN_SYMBOL: &str = "QTZ";
49
50#[cfg(not(feature = "become-sapphire"))]
45pub const RUNTIME_NAME: &str = "opal";51pub const RUNTIME_NAME: &str = "opal";
52#[cfg(not(feature = "become-sapphire"))]
46pub const TOKEN_SYMBOL: &str = "OPL";53pub const TOKEN_SYMBOL: &str = "OPL";
4754
48/// This runtime version.55/// This runtime version.
57 state_version: 0,64 state_version: 0,
58};65};
5966
60parameter_types! {67parameter_types! {
61 pub const Version: RuntimeVersion = VERSION;68 pub const Version: RuntimeVersion = VERSION;
69}
70#[cfg(feature = "become-sapphire")]
71parameter_types! {
62 pub const SS58Prefix: u8 = 42;72 pub const SS58Prefix: u16 = 8883;
73 pub const ChainId: u64 = 8883;
74}
75
76#[cfg(not(feature = "become-sapphire"))]
77parameter_types! {
78 pub const SS58Prefix: u16 = 42;
63 pub const ChainId: u64 = 8882;79 pub const ChainId: u64 = 8882;
64}80}
6581
66construct_runtime!(opal);82construct_runtime!(opal);
6783