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.tomldiffbeforeafterboth1[package]2name = "unique-rpc"3version = "0.1.0"4authors = ['Unique Network <support@uniquenetwork.io>']5license = 'GPLv3'6edition = "2021"7description = "Unique chain rpc"89[package.metadata.docs.rs]10targets = ["x86_64-unknown-linux-gnu"]1112[dependencies]13futures = { version = "0.3.17", features = ["compat"] }14jsonrpc-core = "18.0.0"15jsonrpc-pubsub = "18.0.0"16# pallet-contracts-rpc = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }17pallet-transaction-payment-rpc = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }18pallet-transaction-payment-rpc-runtime-api = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }19sc-client-api = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }20sc-consensus-aura = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }21sc-consensus-epochs = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }22sc-finality-grandpa = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }23sc-finality-grandpa-rpc = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }24sc-keystore = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }25sc-network = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }26sc-rpc-api = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }27sc-rpc = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }28sc-service = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }29sp-api = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }30sp-block-builder = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }31sp-blockchain = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }32sp-consensus = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }33sp-consensus-aura = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }34sp-core = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }35sp-offchain = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }36sp-runtime = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }37sp-storage = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }38sp-session = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }39sp-transaction-pool = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }40sc-transaction-pool = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }41substrate-frame-rpc-system = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }42tokio = { version = "0.2.25", features = ["macros", "sync"] }4344pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.17" }45fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.17" }46fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.17" }47fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.17" }48fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.17" }49fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.17" }5051pallet-unique = { path = "../../pallets/unique" }52uc-rpc = { path = "../../client/rpc" }53up-rpc = { path = "../../primitives/rpc" }54unique-runtime = { path = "../../runtime" }5556[features]57std = []1[package]2name = "unique-rpc"3version = "0.1.0"4authors = ['Unique Network <support@uniquenetwork.io>']5license = 'GPLv3'6edition = "2021"7description = "Unique chain rpc"89[package.metadata.docs.rs]10targets = ["x86_64-unknown-linux-gnu"]1112[dependencies]13futures = { version = "0.3.17", features = ["compat"] }14jsonrpc-core = "18.0.0"15jsonrpc-pubsub = "18.0.0"16# pallet-contracts-rpc = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }17pallet-transaction-payment-rpc = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }18pallet-transaction-payment-rpc-runtime-api = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }19sc-client-api = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }20sc-consensus-aura = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }21sc-consensus-epochs = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }22sc-finality-grandpa = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }23sc-finality-grandpa-rpc = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }24sc-keystore = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }25sc-network = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }26sc-rpc-api = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }27sc-rpc = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }28sc-service = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }29sp-api = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }30sp-block-builder = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }31sp-blockchain = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }32sp-consensus = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }33sp-consensus-aura = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }34sp-core = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }35sp-offchain = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }36sp-runtime = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }37sp-storage = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }38sp-session = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }39sp-transaction-pool = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }40sc-transaction-pool = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }41substrate-frame-rpc-system = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.17' }42tokio = { version = "0.2.25", features = ["macros", "sync"] }4344pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.17" }45fc-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.17" }46fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.17" }47fc-rpc-core = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.17" }48fc-db = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.17" }49fc-mapping-sync = { default-features = false, git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.17" }5051pallet-unique = { path = "../../pallets/unique" }52uc-rpc = { path = "../../client/rpc" }53up-rpc = { path = "../../primitives/rpc" }54unique-runtime = { path = "../../runtime/unique", optional = true }55quartz-runtime = { path = "../../runtime/quartz", optional = true }56opal-runtime = { path = "../../runtime/opal", optional = true }5758[features]59default = ["unique-runtime"]60std = []node/rpc/src/lib.rsdiffbeforeafterboth--- a/node/rpc/src/lib.rs
+++ b/node/rpc/src/lib.rs
@@ -15,7 +15,6 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
use sp_runtime::traits::BlakeTwo256;
-use unique_runtime::{Hash, AccountId, CrossAccountId, Index, opaque::Block, BlockNumber, Balance};
use fc_rpc::{
EthBlockDataCache, OverrideHandle, RuntimeApiStorageOverride, SchemaV1Override,
StorageOverride, SchemaV2Override, SchemaV3Override,
@@ -41,6 +40,17 @@
use sc_service::TransactionPool;
use std::{collections::BTreeMap, marker::PhantomData, sync::Arc};
+#[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::{Hash, AccountId, CrossAccountId, Index, Block, BlockNumber, Balance};
+
/// Public io handler for exporting into other modules
pub type IoHandler = jsonrpc_core::IoHandler<sc_rpc::Metadata>;
@@ -231,7 +241,7 @@
client.clone(),
pool.clone(),
graph,
- unique_runtime::TransactionConverter,
+ runtime::TransactionConverter,
network.clone(),
signers,
overrides.clone(),