difftreelog
Adjust node to new runtimes
in: master
6 files changed
node/cli/Cargo.tomldiffbeforeafterboth--- a/node/cli/Cargo.toml
+++ b/node/cli/Cargo.toml
@@ -239,8 +239,17 @@
# Local dependencies
[dependencies.unique-runtime]
-path = '../../runtime'
+path = '../../runtime/unique'
+optional = true
+
+[dependencies.quartz-runtime]
+path = '../../runtime/quartz'
+optional = true
+[dependencies.opal-runtime]
+path = '../../runtime/opal'
+optional = true
+
[dependencies.up-data-structs]
path = "../../primitives/data-structs"
default-features = false
@@ -283,10 +292,10 @@
fp-rpc = { git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.17" }
pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.17" }
-unique-rpc = { path = "../rpc" }
+unique-rpc = { default-features = false, path = "../rpc" }
[features]
-default = []
+default = ["unique-runtime"]
runtime-benchmarks = [
'unique-runtime/runtime-benchmarks',
'polkadot-service/runtime-benchmarks',
node/cli/src/chain_spec.rsdiffbeforeafterboth--- a/node/cli/src/chain_spec.rs
+++ b/node/cli/src/chain_spec.rs
@@ -15,7 +15,6 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
use cumulus_primitives_core::ParaId;
-use unique_runtime::*;
use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup};
use sc_service::ChainType;
use sp_core::{sr25519, Pair, Public};
@@ -25,8 +24,19 @@
use serde::{Deserialize, Serialize};
use serde_json::map::Map;
+#[cfg(feature = "unique-runtime")]
+use unique_runtime as runtime;
+
+#[cfg(feature = "quartz-runtime")]
+use quartz_runtime as runtime;
+
+#[cfg(feature = "opal-runtime")]
+use opal_runtime as runtime;
+
+use runtime::{*, opaque::*};
+
/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type.
-pub type ChainSpec = sc_service::GenericChainSpec<unique_runtime::GenesisConfig, Extensions>;
+pub type ChainSpec = sc_service::GenericChainSpec<runtime::GenesisConfig, Extensions>;
/// Helper function to generate a crypto pair from seed
pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {
@@ -217,8 +227,8 @@
id: ParaId,
) -> GenesisConfig {
GenesisConfig {
- system: unique_runtime::SystemConfig {
- code: unique_runtime::WASM_BINARY
+ system: runtime::SystemConfig {
+ code: runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
.to_vec(),
},
@@ -235,9 +245,9 @@
key: Some(root_key),
},
vesting: VestingConfig { vesting: vec![] },
- parachain_info: unique_runtime::ParachainInfoConfig { parachain_id: id },
+ parachain_info: runtime::ParachainInfoConfig { parachain_id: id },
parachain_system: Default::default(),
- aura: unique_runtime::AuraConfig {
+ aura: runtime::AuraConfig {
authorities: initial_authorities,
},
aura_ext: Default::default(),
node/cli/src/command.rsdiffbeforeafterboth--- a/node/cli/src/command.rs
+++ b/node/cli/src/command.rs
@@ -41,7 +41,6 @@
use cumulus_primitives_core::ParaId;
use cumulus_client_service::genesis::generate_genesis_block;
use log::info;
-use unique_runtime::Block;
use polkadot_parachain::primitives::AccountIdConversion;
use sc_cli::{
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams,
@@ -54,6 +53,17 @@
use sp_runtime::traits::Block as BlockT;
use std::{io::Write, net::SocketAddr};
+#[cfg(feature = "unique-runtime")]
+use unique_runtime as runtime;
+
+#[cfg(feature = "quartz-runtime")]
+use quartz_runtime as runtime;
+
+#[cfg(feature = "opal-runtime")]
+use opal_runtime as runtime;
+
+use runtime::Block;
+
fn load_spec(id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
Ok(match id {
"westend-local" => Box::new(chain_spec::local_testnet_westend_config()),
@@ -104,7 +114,7 @@
}
fn native_runtime_version(_: &Box<dyn ChainSpec>) -> &'static RuntimeVersion {
- &unique_runtime::VERSION
+ &runtime::VERSION
}
}
node/cli/src/service.rsdiffbeforeafterboth--- a/node/cli/src/service.rs
+++ b/node/cli/src/service.rs
@@ -26,8 +26,17 @@
use unique_rpc::overrides_handle;
// Local Runtime Types
-use unique_runtime::RuntimeApi;
+#[cfg(feature = "unique-runtime")]
+use unique_runtime as runtime;
+
+#[cfg(feature = "quartz-runtime")]
+use quartz_runtime as runtime;
+#[cfg(feature = "opal-runtime")]
+use opal_runtime as runtime;
+
+use runtime::RuntimeApi;
+
// Cumulus Imports
use cumulus_client_consensus_aura::{AuraConsensus, BuildAuraConsensusParams, SlotProportion};
use cumulus_client_consensus_common::ParachainConsensus;
@@ -69,11 +78,11 @@
type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;
fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
- unique_runtime::api::dispatch(method, data)
+ runtime::api::dispatch(method, data)
}
fn native_version() -> sc_executor::NativeVersion {
- unique_runtime::native_version()
+ runtime::native_version()
}
}
node/rpc/Cargo.tomldiffbeforeafterboth--- a/node/rpc/Cargo.toml
+++ b/node/rpc/Cargo.toml
@@ -51,7 +51,10 @@
pallet-unique = { path = "../../pallets/unique" }
uc-rpc = { path = "../../client/rpc" }
up-rpc = { path = "../../primitives/rpc" }
-unique-runtime = { path = "../../runtime" }
+unique-runtime = { path = "../../runtime/unique", optional = true }
+quartz-runtime = { path = "../../runtime/quartz", optional = true }
+opal-runtime = { path = "../../runtime/opal", optional = true }
[features]
+default = ["unique-runtime"]
std = []
node/rpc/src/lib.rsdiffbeforeafterboth15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.161617use sp_runtime::traits::BlakeTwo256;17use sp_runtime::traits::BlakeTwo256;18use unique_runtime::{Hash, AccountId, CrossAccountId, Index, opaque::Block, BlockNumber, Balance};19use fc_rpc::{18use fc_rpc::{20 EthBlockDataCache, OverrideHandle, RuntimeApiStorageOverride, SchemaV1Override,19 EthBlockDataCache, OverrideHandle, RuntimeApiStorageOverride, SchemaV1Override,21 StorageOverride, SchemaV2Override, SchemaV3Override,20 StorageOverride, SchemaV2Override, SchemaV3Override,41use sc_service::TransactionPool;40use sc_service::TransactionPool;42use std::{collections::BTreeMap, marker::PhantomData, sync::Arc};41use std::{collections::BTreeMap, marker::PhantomData, sync::Arc};4243#[cfg(feature = "unique-runtime")]44use unique_runtime as runtime;4546#[cfg(feature = "quartz-runtime")]47use quartz_runtime as runtime;4849#[cfg(feature = "opal-runtime")]50use opal_runtime as runtime;5152use runtime::opaque::{Hash, AccountId, CrossAccountId, Index, Block, BlockNumber, Balance};435344/// Public io handler for exporting into other modules54/// Public io handler for exporting into other modules45pub type IoHandler = jsonrpc_core::IoHandler<sc_rpc::Metadata>;55pub type IoHandler = jsonrpc_core::IoHandler<sc_rpc::Metadata>;231 client.clone(),241 client.clone(),232 pool.clone(),242 pool.clone(),233 graph,243 graph,234 unique_runtime::TransactionConverter,244 runtime::TransactionConverter,235 network.clone(),245 network.clone(),236 signers,246 signers,237 overrides.clone(),247 overrides.clone(),