mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-11 16:31:07 +00:00
The crate rename (#4223)
* Adding script for rename, could be applicable for nodes on top of it, too * add stderr and gitlab ci features * apply script * fix now minor details in expected stderr * Update the Cargo.lock * fix name: sc-transaction -> sc-tracing * fix rename in script, too
This commit is contained in:
committed by
GitHub
parent
40f6d05a4c
commit
927e13c13a
@@ -218,14 +218,14 @@ check-web-wasm:
|
||||
script:
|
||||
# WASM support is in progress. As more and more crates support WASM, we
|
||||
# should add entries here. See https://github.com/paritytech/substrate/issues/2416
|
||||
- time cargo build --target=wasm32-unknown-unknown -p sr-io
|
||||
- time cargo build --target=wasm32-unknown-unknown -p sr-primitives
|
||||
- time cargo build --target=wasm32-unknown-unknown -p sr-std
|
||||
- time cargo build --target=wasm32-unknown-unknown -p substrate-client
|
||||
- time cargo build --target=wasm32-unknown-unknown -p substrate-consensus-aura
|
||||
- time cargo build --target=wasm32-unknown-unknown -p substrate-consensus-babe
|
||||
- time cargo build --target=wasm32-unknown-unknown -p substrate-consensus-common
|
||||
- time cargo build --target=wasm32-unknown-unknown -p substrate-telemetry
|
||||
- time cargo build --target=wasm32-unknown-unknown -p sp-io
|
||||
- time cargo build --target=wasm32-unknown-unknown -p sp-runtime
|
||||
- time cargo build --target=wasm32-unknown-unknown -p sp-std
|
||||
- time cargo build --target=wasm32-unknown-unknown -p sc-client
|
||||
- time cargo build --target=wasm32-unknown-unknown -p sc-consensus-aura
|
||||
- time cargo build --target=wasm32-unknown-unknown -p sc-consensus-babe
|
||||
- time cargo build --target=wasm32-unknown-unknown -p sp-consensus
|
||||
- time cargo build --target=wasm32-unknown-unknown -p sc-telemetry
|
||||
# Note: the command below is a bit weird because several Cargo issues prevent us from compiling the node in a more straight-forward way.
|
||||
- time cargo build --manifest-path=bin/node/cli/Cargo.toml --no-default-features --features "browser" --target=wasm32-unknown-unknown
|
||||
- sccache -s
|
||||
@@ -369,7 +369,7 @@ check_polkadot:
|
||||
- git grep -l "polkadot-master" | grep toml | xargs sed -i "s/branch.*=.*\"polkadot-master\"/rev = \"$COMMIT_HASH\"/; s~https://github.com/paritytech/substrate~file://$SUBSTRATE_PATH~; s/,\s*}/ }/"
|
||||
# Make sure 'Cargo.lock' matches 'Cargo.toml'. It's enough to update one
|
||||
# package, others are updated along the way.
|
||||
- cargo update -p sr-io
|
||||
- cargo update -p sp-io
|
||||
# Check whether Polkadot 'master' branch builds with this Substrate commit.
|
||||
- time cargo check
|
||||
- cd -
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
#!/bin/bash
|
||||
|
||||
function rust_rename() {
|
||||
sed -i "s/$1/$2/g" `grep -Rl --include="*.rs" --include="*.stderr" "$1" *` > /dev/null
|
||||
}
|
||||
|
||||
function cargo_rename() {
|
||||
find . -name "Cargo.toml" -exec sed -i "s/\(^\|[^\/]\)$1/\1$2/g" {} \;
|
||||
}
|
||||
|
||||
function rename_gitlabci() {
|
||||
sed -i "s/$1/$2/g" .gitlab-ci.yml
|
||||
}
|
||||
|
||||
function rename() {
|
||||
old=$(echo $1 | cut -f1 -d\ );
|
||||
new=$(echo $1 | cut -f2 -d\ );
|
||||
|
||||
echo "Renaming $old to $new"
|
||||
# rename in Cargo.tomls
|
||||
cargo_rename $old $new
|
||||
rename_gitlabci $old $new
|
||||
# and it appears, we have the same syntax in rust files
|
||||
rust_rename $old $new
|
||||
|
||||
# but generally we have the snail case syntax in rust files
|
||||
old=$(echo $old | sed s/-/_/g );
|
||||
new=$(echo $new | sed s/-/_/g );
|
||||
|
||||
echo " > $old to $new"
|
||||
rust_rename $old $new
|
||||
}
|
||||
|
||||
TO_RENAME=(
|
||||
# OLD-CRATE-NAME NEW-CRATE-NAME
|
||||
|
||||
# PRIMITIVES
|
||||
"substrate-application-crypto sc-application-crypto"
|
||||
"substrate-authority-discovery-primitives sp-authority-discovery"
|
||||
"substrate-block-builder-runtime-api sp-block-builder"
|
||||
"substrate-consensus-aura-primitives sp-consensus-aura"
|
||||
"substrate-consensus-babe-primitives sp-consensus-babe"
|
||||
"substrate-consensus-common sp-consensus"
|
||||
"substrate-consensus-pow-primitives sp-consensus-pow"
|
||||
"substrate-primitives sp-core"
|
||||
"substrate-debug-derive sp-debug-derive"
|
||||
"substrate-primitives-storage sp-storage"
|
||||
"substrate-externalities sp-externalities"
|
||||
"substrate-finality-grandpa-primitives sp-finality-granpda"
|
||||
"substrate-inherents sp-inherents"
|
||||
"substrate-keyring sp-keyring"
|
||||
"substrate-offchain-primitives sp-offchain"
|
||||
"substrate-panic-handler sp-panic-handler"
|
||||
"substrate-phragmen sp-phragmen"
|
||||
"substrate-rpc-primitives sp-rpc"
|
||||
"substrate-runtime-interface sp-runtime-interface"
|
||||
"substrate-runtime-interface-proc-macro sp-runtime-interface-proc-macro"
|
||||
"substrate-runtime-interface-test-wasm sp-runtime-interface-test-wasm"
|
||||
"substrate-serializer sp-serializer"
|
||||
"substrate-session sp-sesssion"
|
||||
"sr-api sp-api"
|
||||
"sr-api-proc-macro sp-api-proc-macro"
|
||||
"sr-api-test sp-api-test"
|
||||
"sr-arithmetic sp-arithmetic"
|
||||
"sr-arithmetic-fuzzer sp-arithmetic-fuzzer"
|
||||
"sr-io sp-io"
|
||||
"sr-primitives sp-runtime"
|
||||
"sr-sandbox sp-sandbox"
|
||||
"sr-staking-primitives sp-staking"
|
||||
"sr-std sp-std"
|
||||
"sr-version sp-version"
|
||||
"substrate-state-machine sp-state-machine"
|
||||
"substrate-transaction-pool-runtime-api sp-transaction-pool"
|
||||
"substrate-trie sp-trie"
|
||||
"substrate-wasm-interface sp-wasm-interface"
|
||||
|
||||
# # CLIENT
|
||||
"substrate-client sc-client"
|
||||
"substrate-client-api sc-api"
|
||||
"substrate-authority-discovery sc-authority-discovery"
|
||||
"substrate-basic-authorship sc-basic-authority"
|
||||
"substrate-block-builder sc-block-builder"
|
||||
"substrate-chain-spec sc-chain-spec"
|
||||
"substrate-chain-spec-derive sc-chain-spec-derive"
|
||||
"substrate-cli sc-cli"
|
||||
"substrate-consensus-aura sc-consensus-aura"
|
||||
"substrate-consensus-babe sc-consensus-babe"
|
||||
"substrate-consensus-pow sc-consensus-pow"
|
||||
"substrate-consensus-slots sc-consensus-slots"
|
||||
"substrate-consensus-uncles sc-consensus-uncles"
|
||||
"substrate-client-db sc-database"
|
||||
"substrate-executor sc-executor"
|
||||
"substrate-runtime-test sc-runtime-test"
|
||||
"substrate-finality-grandpa sc-finality-grandpa"
|
||||
"substrate-keystore sc-keystore"
|
||||
"substrate-network sc-network"
|
||||
"substrate-offchain sc-offchain"
|
||||
"substrate-peerset sc-peerset"
|
||||
"substrate-rpc-servers sc-rpc-server"
|
||||
"substrate-rpc sc-rpc"
|
||||
"substrate-service sc-service"
|
||||
"substrate-service-test sc-service-test"
|
||||
"substrate-state-db sc-state-db"
|
||||
"substrate-telemetry sc-telemetry"
|
||||
"substrate-tracing sc-tracing"
|
||||
|
||||
);
|
||||
|
||||
for rule in "${TO_RENAME[@]}"
|
||||
do
|
||||
rename "$rule";
|
||||
done
|
||||
Generated
+1560
-1560
File diff suppressed because it is too large
Load Diff
@@ -18,24 +18,24 @@ tokio = "0.1.22"
|
||||
parking_lot = "0.9.0"
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0" }
|
||||
trie-root = "0.15.2"
|
||||
sr-io = { path = "../../primitives/sr-io" }
|
||||
substrate-cli = { path = "../../client/cli" }
|
||||
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
|
||||
substrate-executor = { path = "../../client/executor" }
|
||||
substrate-service = { path = "../../client/service" }
|
||||
inherents = { package = "substrate-inherents", path = "../../primitives/inherents" }
|
||||
txpool = { package = "sc-transaction-pool", path = "../../client/transaction-pool" }
|
||||
sp-io = { path = "../../primitives/sr-io" }
|
||||
sc-cli = { path = "../../client/cli" }
|
||||
primitives = { package = "sp-core", path = "../../primitives/core" }
|
||||
sc-executor = { path = "../../client/executor" }
|
||||
sc-service = { path = "../../client/service" }
|
||||
inherents = { package = "sp-inherents", path = "../../primitives/inherents" }
|
||||
txpool = { package = "sc-tracing-pool", path = "../../client/transaction-pool" }
|
||||
txpool-api = { package = "sp-transaction-pool-api", path = "../../primitives/transaction-pool" }
|
||||
network = { package = "substrate-network", path = "../../client/network" }
|
||||
aura = { package = "substrate-consensus-aura", path = "../../client/consensus/aura" }
|
||||
aura-primitives = { package = "substrate-consensus-aura-primitives", path = "../../primitives/consensus/aura" }
|
||||
consensus-common = { package = "substrate-consensus-common", path = "../../primitives/consensus/common" }
|
||||
grandpa = { package = "substrate-finality-grandpa", path = "../../client/finality-grandpa" }
|
||||
grandpa-primitives = { package = "substrate-finality-grandpa-primitives", path = "../../primitives/finality-grandpa" }
|
||||
substrate-client = { path = "../../client/" }
|
||||
network = { package = "sc-network", path = "../../client/network" }
|
||||
aura = { package = "sc-consensus-aura", path = "../../client/consensus/aura" }
|
||||
aura-primitives = { package = "sp-consensus-aura", path = "../../primitives/consensus/aura" }
|
||||
consensus-common = { package = "sp-consensus", path = "../../primitives/consensus/common" }
|
||||
grandpa = { package = "sc-finality-grandpa", path = "../../client/finality-grandpa" }
|
||||
grandpa-primitives = { package = "sp-finality-granpda", path = "../../primitives/finality-grandpa" }
|
||||
sc-client = { path = "../../client/" }
|
||||
runtime = { package = "node-template-runtime", path = "runtime" }
|
||||
sr-primitives = { path = "../../primitives/sr-primitives" }
|
||||
basic-authorship = { package = "substrate-basic-authorship", path = "../../client/basic-authorship"}
|
||||
sp-runtime = { path = "../../primitives/sr-primitives" }
|
||||
basic-authorship = { package = "sc-basic-authority", path = "../../client/basic-authorship"}
|
||||
|
||||
[build-dependencies]
|
||||
vergen = "3.0.4"
|
||||
|
||||
@@ -6,31 +6,31 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
aura = { package = "pallet-aura", path = "../../../frame/aura", default-features = false }
|
||||
aura-primitives = { package = "substrate-consensus-aura-primitives", path = "../../../primitives/consensus/aura", default-features = false }
|
||||
aura-primitives = { package = "sp-consensus-aura", path = "../../../primitives/consensus/aura", default-features = false }
|
||||
balances = { package = "pallet-balances", path = "../../../frame/balances", default-features = false }
|
||||
block-builder-api = { package = "substrate-block-builder-runtime-api", path = "../../../primitives/block-builder/runtime-api", default-features = false}
|
||||
block-builder-api = { package = "sp-block-builder", path = "../../../primitives/block-builder/runtime-api", default-features = false}
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
|
||||
executive = { package = "frame-executive", path = "../../../frame/executive", default-features = false }
|
||||
grandpa = { package = "pallet-grandpa", path = "../../../frame/grandpa", default-features = false }
|
||||
indices = { package = "pallet-indices", path = "../../../frame/indices", default-features = false }
|
||||
inherents = { package = "substrate-inherents", path = "../../../primitives/inherents", default-features = false}
|
||||
offchain-primitives = { package = "substrate-offchain-primitives", path = "../../../primitives/offchain", default-features = false }
|
||||
primitives = { package = "substrate-primitives", path = "../../../primitives/core", default-features = false }
|
||||
inherents = { package = "sp-inherents", path = "../../../primitives/inherents", default-features = false}
|
||||
offchain-primitives = { package = "sp-offchain", path = "../../../primitives/offchain", default-features = false }
|
||||
primitives = { package = "sp-core", path = "../../../primitives/core", default-features = false }
|
||||
randomness-collective-flip = { package = "pallet-randomness-collective-flip", path = "../../../frame/randomness-collective-flip", default-features = false }
|
||||
rstd = { package = "sr-std", path = "../../../primitives/sr-std", default-features = false }
|
||||
runtime-io = { package = "sr-io", path = "../../../primitives/sr-io", default-features = false }
|
||||
rstd = { package = "sp-std", path = "../../../primitives/sr-std", default-features = false }
|
||||
runtime-io = { package = "sp-io", path = "../../../primitives/sr-io", default-features = false }
|
||||
safe-mix = { version = "1.0.0", default-features = false }
|
||||
serde = { version = "1.0.101", optional = true, features = ["derive"] }
|
||||
sr-api = { path = "../../../primitives/sr-api", default-features = false }
|
||||
sr-primitives = { path = "../../../primitives/sr-primitives", default-features = false }
|
||||
substrate-session = { path = "../../../primitives/session", default-features = false }
|
||||
sp-api = { path = "../../../primitives/sr-api", default-features = false }
|
||||
sp-runtime = { path = "../../../primitives/sr-primitives", default-features = false }
|
||||
sp-sesssion = { path = "../../../primitives/session", default-features = false }
|
||||
sudo = { package = "pallet-sudo", path = "../../../frame/sudo", default-features = false }
|
||||
support = { package = "frame-support", path = "../../../frame/support", default-features = false }
|
||||
system = { package = "frame-system", path = "../../../frame/system", default-features = false }
|
||||
timestamp = { package = "pallet-timestamp", path = "../../../frame/timestamp", default-features = false }
|
||||
transaction-payment = { package = "pallet-transaction-payment", path = "../../../frame/transaction-payment", default-features = false }
|
||||
txpool-runtime-api = { package = "sp-transaction-pool-runtime-api", path = "../../../primitives/transaction-pool/runtime-api", default-features = false }
|
||||
version = { package = "sr-version", path = "../../../primitives/sr-version", default-features = false }
|
||||
version = { package = "sp-version", path = "../../../primitives/sr-version", default-features = false }
|
||||
|
||||
[build-dependencies]
|
||||
wasm-builder-runner = { package = "substrate-wasm-builder-runner", path = "../../../client/utils/wasm-builder-runner", version = "1.0.4" }
|
||||
@@ -54,9 +54,9 @@ std = [
|
||||
"runtime-io/std",
|
||||
"safe-mix/std",
|
||||
"serde",
|
||||
"sr-api/std",
|
||||
"sr-primitives/std",
|
||||
"substrate-session/std",
|
||||
"sp-api/std",
|
||||
"sp-runtime/std",
|
||||
"sp-sesssion/std",
|
||||
"sudo/std",
|
||||
"support/std",
|
||||
"system/std",
|
||||
|
||||
@@ -10,14 +10,14 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
|
||||
|
||||
use rstd::prelude::*;
|
||||
use primitives::OpaqueMetadata;
|
||||
use sr_primitives::{
|
||||
use sp_runtime::{
|
||||
ApplyExtrinsicResult, transaction_validity::TransactionValidity, generic, create_runtime_str,
|
||||
impl_opaque_keys, MultiSignature
|
||||
};
|
||||
use sr_primitives::traits::{
|
||||
use sp_runtime::traits::{
|
||||
NumberFor, BlakeTwo256, Block as BlockT, StaticLookup, Verify, ConvertInto, IdentifyAccount
|
||||
};
|
||||
use sr_api::impl_runtime_apis;
|
||||
use sp_api::impl_runtime_apis;
|
||||
use aura_primitives::sr25519::AuthorityId as AuraId;
|
||||
use grandpa::AuthorityList as GrandpaAuthorityList;
|
||||
use grandpa::fg_primitives;
|
||||
@@ -27,10 +27,10 @@ use version::NativeVersion;
|
||||
|
||||
// A few exports that help ease life for downstream crates.
|
||||
#[cfg(any(feature = "std", test))]
|
||||
pub use sr_primitives::BuildStorage;
|
||||
pub use sp_runtime::BuildStorage;
|
||||
pub use timestamp::Call as TimestampCall;
|
||||
pub use balances::Call as BalancesCall;
|
||||
pub use sr_primitives::{Permill, Perbill};
|
||||
pub use sp_runtime::{Permill, Perbill};
|
||||
pub use support::{
|
||||
StorageValue, construct_runtime, parameter_types,
|
||||
traits::Randomness,
|
||||
@@ -73,7 +73,7 @@ mod template;
|
||||
pub mod opaque {
|
||||
use super::*;
|
||||
|
||||
pub use sr_primitives::OpaqueExtrinsic as UncheckedExtrinsic;
|
||||
pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic;
|
||||
|
||||
/// Opaque block header type.
|
||||
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||
@@ -283,7 +283,7 @@ pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Call, SignedExt
|
||||
pub type Executive = executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>;
|
||||
|
||||
impl_runtime_apis! {
|
||||
impl sr_api::Core<Block> for Runtime {
|
||||
impl sp_api::Core<Block> for Runtime {
|
||||
fn version() -> RuntimeVersion {
|
||||
VERSION
|
||||
}
|
||||
@@ -297,7 +297,7 @@ impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
impl sr_api::Metadata<Block> for Runtime {
|
||||
impl sp_api::Metadata<Block> for Runtime {
|
||||
fn metadata() -> OpaqueMetadata {
|
||||
Runtime::metadata().into()
|
||||
}
|
||||
@@ -350,7 +350,7 @@ impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
impl substrate_session::SessionKeys<Block> for Runtime {
|
||||
impl sp_sesssion::SessionKeys<Block> for Runtime {
|
||||
fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {
|
||||
opaque::SessionKeys::generate(seed)
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ mod tests {
|
||||
|
||||
use primitives::H256;
|
||||
use support::{impl_outer_origin, assert_ok, parameter_types, weights::Weight};
|
||||
use sr_primitives::{
|
||||
use sp_runtime::{
|
||||
traits::{BlakeTwo256, IdentityLookup}, testing::Header, Perbill,
|
||||
};
|
||||
|
||||
|
||||
@@ -5,14 +5,14 @@ use runtime::{
|
||||
};
|
||||
use aura_primitives::sr25519::{AuthorityId as AuraId};
|
||||
use grandpa_primitives::{AuthorityId as GrandpaId};
|
||||
use substrate_service;
|
||||
use sr_primitives::traits::{Verify, IdentifyAccount};
|
||||
use sc_service;
|
||||
use sp_runtime::traits::{Verify, IdentifyAccount};
|
||||
|
||||
// Note this is the URL for the telemetry server
|
||||
//const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";
|
||||
|
||||
/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type.
|
||||
pub type ChainSpec = substrate_service::ChainSpec<GenesisConfig>;
|
||||
pub type ChainSpec = sc_service::ChainSpec<GenesisConfig>;
|
||||
|
||||
/// The chain specification option. This is expected to come in from the CLI and
|
||||
/// is little more than one of a number of alternatives which can easily be converted
|
||||
|
||||
@@ -2,9 +2,9 @@ use crate::service;
|
||||
use futures::{future::{select, Map}, FutureExt, TryFutureExt, channel::oneshot, compat::Future01CompatExt};
|
||||
use std::cell::RefCell;
|
||||
use tokio::runtime::Runtime;
|
||||
pub use substrate_cli::{VersionInfo, IntoExit, error};
|
||||
use substrate_cli::{display_role, informant, parse_and_prepare, ParseAndPrepare, NoCustom};
|
||||
use substrate_service::{AbstractService, Roles as ServiceRoles, Configuration};
|
||||
pub use sc_cli::{VersionInfo, IntoExit, error};
|
||||
use sc_cli::{display_role, informant, parse_and_prepare, ParseAndPrepare, NoCustom};
|
||||
use sc_service::{AbstractService, Roles as ServiceRoles, Configuration};
|
||||
use aura_primitives::sr25519::{AuthorityPair as AuraPair};
|
||||
use crate::chain_spec;
|
||||
use log::info;
|
||||
|
||||
@@ -8,7 +8,7 @@ mod chain_spec;
|
||||
mod service;
|
||||
mod cli;
|
||||
|
||||
pub use substrate_cli::{VersionInfo, IntoExit, error};
|
||||
pub use sc_cli::{VersionInfo, IntoExit, error};
|
||||
|
||||
fn main() -> Result<(), cli::error::Error> {
|
||||
let version = VersionInfo {
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use substrate_client::LongestChain;
|
||||
use sc_client::LongestChain;
|
||||
use runtime::{self, GenesisConfig, opaque::Block, RuntimeApi};
|
||||
use substrate_service::{error::{Error as ServiceError}, AbstractService, Configuration, ServiceBuilder};
|
||||
use sc_service::{error::{Error as ServiceError}, AbstractService, Configuration, ServiceBuilder};
|
||||
use inherents::InherentDataProviders;
|
||||
use network::{construct_simple_protocol};
|
||||
use substrate_executor::native_executor_instance;
|
||||
pub use substrate_executor::NativeExecutor;
|
||||
use sc_executor::native_executor_instance;
|
||||
pub use sc_executor::NativeExecutor;
|
||||
use aura_primitives::sr25519::{AuthorityPair as AuraPair};
|
||||
use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider};
|
||||
use basic_authorship;
|
||||
@@ -34,11 +34,11 @@ macro_rules! new_full_start {
|
||||
let mut import_setup = None;
|
||||
let inherent_data_providers = inherents::InherentDataProviders::new();
|
||||
|
||||
let builder = substrate_service::ServiceBuilder::new_full::<
|
||||
let builder = sc_service::ServiceBuilder::new_full::<
|
||||
runtime::opaque::Block, runtime::RuntimeApi, crate::service::Executor
|
||||
>($config)?
|
||||
.with_select_chain(|_config, backend| {
|
||||
Ok(substrate_client::LongestChain::new(backend.clone()))
|
||||
Ok(sc_client::LongestChain::new(backend.clone()))
|
||||
})?
|
||||
.with_transaction_pool(|config, client, _fetcher| {
|
||||
let pool_api = txpool::FullChainApi::new(client.clone());
|
||||
@@ -49,7 +49,7 @@ macro_rules! new_full_start {
|
||||
})?
|
||||
.with_import_queue(|_config, client, mut select_chain, transaction_pool| {
|
||||
let select_chain = select_chain.take()
|
||||
.ok_or_else(|| substrate_service::Error::SelectChainRequired)?;
|
||||
.ok_or_else(|| sc_service::Error::SelectChainRequired)?;
|
||||
|
||||
let (grandpa_block_import, grandpa_link) =
|
||||
grandpa::block_import::<_, _, _, runtime::RuntimeApi, _>(
|
||||
|
||||
@@ -34,34 +34,34 @@ rand = "0.7.2"
|
||||
structopt = "0.3.3"
|
||||
|
||||
# primitives
|
||||
authority-discovery-primitives = { package = "substrate-authority-discovery-primitives", path = "../../../primitives/authority-discovery"}
|
||||
babe-primitives = { package = "substrate-consensus-babe-primitives", path = "../../../primitives/consensus/babe" }
|
||||
grandpa_primitives = { package = "substrate-finality-grandpa-primitives", path = "../../../primitives/finality-grandpa" }
|
||||
primitives = { package = "substrate-primitives", path = "../../../primitives/core" }
|
||||
sr-primitives = { path = "../../../primitives/sr-primitives" }
|
||||
authority-discovery-primitives = { package = "sp-authority-discovery", path = "../../../primitives/authority-discovery"}
|
||||
babe-primitives = { package = "sp-consensus-babe", path = "../../../primitives/consensus/babe" }
|
||||
grandpa_primitives = { package = "sp-finality-granpda", path = "../../../primitives/finality-grandpa" }
|
||||
primitives = { package = "sp-core", path = "../../../primitives/core" }
|
||||
sp-runtime = { path = "../../../primitives/sr-primitives" }
|
||||
sp-timestamp = { path = "../../../primitives/timestamp", default-features = false }
|
||||
sp-finality-tracker = { path = "../../../primitives/finality-tracker", default-features = false }
|
||||
inherents = { package = "substrate-inherents", path = "../../../primitives/inherents" }
|
||||
keyring = { package = "substrate-keyring", path = "../../../primitives/keyring" }
|
||||
runtime-io = { package = "sr-io", path = "../../../primitives/sr-io" }
|
||||
inherents = { package = "sp-inherents", path = "../../../primitives/inherents" }
|
||||
keyring = { package = "sp-keyring", path = "../../../primitives/keyring" }
|
||||
runtime-io = { package = "sp-io", path = "../../../primitives/sr-io" }
|
||||
|
||||
# client dependencies
|
||||
client-api = { package = "substrate-client-api", path = "../../../client/api" }
|
||||
client = { package = "substrate-client", path = "../../../client/" }
|
||||
chain-spec = { package = "substrate-chain-spec", path = "../../../client/chain-spec" }
|
||||
txpool = { package = "sc-transaction-pool", path = "../../../client/transaction-pool" }
|
||||
client-api = { package = "sc-client-api", path = "../../../client/api" }
|
||||
client = { package = "sc-client", path = "../../../client/" }
|
||||
chain-spec = { package = "sc-chain-spec", path = "../../../client/chain-spec" }
|
||||
txpool = { package = "sc-tracing-pool", path = "../../../client/transaction-pool" }
|
||||
txpool-api = { package = "sp-transaction-pool-api", path = "../../../primitives/transaction-pool" }
|
||||
network = { package = "substrate-network", path = "../../../client/network" }
|
||||
babe = { package = "substrate-consensus-babe", path = "../../../client/consensus/babe" }
|
||||
grandpa = { package = "substrate-finality-grandpa", path = "../../../client/finality-grandpa" }
|
||||
client_db = { package = "substrate-client-db", path = "../../../client/db", default-features = false }
|
||||
offchain = { package = "substrate-offchain", path = "../../../client/offchain" }
|
||||
substrate-rpc = { package = "substrate-rpc", path = "../../../client/rpc" }
|
||||
substrate-basic-authorship = { path = "../../../client/basic-authorship" }
|
||||
substrate-service = { path = "../../../client/service", default-features = false }
|
||||
substrate-telemetry = { package = "substrate-telemetry", path = "../../../client/telemetry" }
|
||||
authority-discovery = { package = "substrate-authority-discovery", path = "../../../client/authority-discovery"}
|
||||
consensus-common = { package = "substrate-consensus-common", path = "../../../primitives/consensus/common" }
|
||||
network = { package = "sc-network", path = "../../../client/network" }
|
||||
babe = { package = "sc-consensus-babe", path = "../../../client/consensus/babe" }
|
||||
grandpa = { package = "sc-finality-grandpa", path = "../../../client/finality-grandpa" }
|
||||
client_db = { package = "sc-client-db", path = "../../../client/db", default-features = false }
|
||||
offchain = { package = "sc-offchain", path = "../../../client/offchain" }
|
||||
sc-rpc = { package = "sc-rpc", path = "../../../client/rpc" }
|
||||
sc-basic-authority = { path = "../../../client/basic-authorship" }
|
||||
sc-service = { path = "../../../client/service", default-features = false }
|
||||
sc-telemetry = { package = "sc-telemetry", path = "../../../client/telemetry" }
|
||||
authority-discovery = { package = "sc-authority-discovery", path = "../../../client/authority-discovery"}
|
||||
consensus-common = { package = "sp-consensus", path = "../../../primitives/consensus/common" }
|
||||
|
||||
# frame dependencies
|
||||
indices = { package = "pallet-indices", path = "../../../frame/indices" }
|
||||
@@ -82,7 +82,7 @@ node-executor = { path = "../executor" }
|
||||
|
||||
# CLI-specific dependencies
|
||||
tokio = { version = "0.1.22", optional = true }
|
||||
substrate-cli = { path = "../../../client/cli", optional = true }
|
||||
sc-cli = { path = "../../../client/cli", optional = true }
|
||||
transaction-factory = { path = "../../../test/utils/transaction-factory", optional = true }
|
||||
ctrlc = { version = "3.1.3", features = ["termination"], optional = true }
|
||||
|
||||
@@ -98,14 +98,14 @@ kvdb-memorydb = { version = "0.1.1", optional = true }
|
||||
rand6 = { package = "rand", version = "0.6", features = ["wasm-bindgen"], optional = true } # Imported just for the `wasm-bindgen` feature
|
||||
|
||||
[dev-dependencies]
|
||||
keystore = { package = "substrate-keystore", path = "../../../client/keystore" }
|
||||
babe = { package = "substrate-consensus-babe", path = "../../../client/consensus/babe", features = ["test-helpers"] }
|
||||
service-test = { package = "substrate-service-test", path = "../../../client/service/test" }
|
||||
keystore = { package = "sc-keystore", path = "../../../client/keystore" }
|
||||
babe = { package = "sc-consensus-babe", path = "../../../client/consensus/babe", features = ["test-helpers"] }
|
||||
service-test = { package = "sc-service-test", path = "../../../client/service/test" }
|
||||
futures = "0.3.1"
|
||||
tempfile = "3.1.0"
|
||||
|
||||
[build-dependencies]
|
||||
substrate-cli = { package = "substrate-cli", path = "../../../client/cli" }
|
||||
sc-cli = { package = "sc-cli", path = "../../../client/cli" }
|
||||
build-script-utils = { package = "substrate-build-script-utils", path = "../../../utils/build-script-utils" }
|
||||
structopt = "0.3.3"
|
||||
vergen = "3.0.4"
|
||||
@@ -125,16 +125,16 @@ browser = [
|
||||
"rand6"
|
||||
]
|
||||
cli = [
|
||||
"substrate-cli",
|
||||
"sc-cli",
|
||||
"transaction-factory",
|
||||
"tokio",
|
||||
"ctrlc",
|
||||
"substrate-service/rocksdb",
|
||||
"sc-service/rocksdb",
|
||||
"node-executor/wasmi-errno",
|
||||
]
|
||||
wasmtime = [
|
||||
"cli",
|
||||
"node-executor/wasmtime",
|
||||
"substrate-cli/wasmtime",
|
||||
"substrate-service/wasmtime",
|
||||
"sc-cli/wasmtime",
|
||||
"sc-service/wasmtime",
|
||||
]
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
|
||||
use futures::channel::oneshot;
|
||||
use futures::{future, FutureExt};
|
||||
use substrate_cli::VersionInfo;
|
||||
use sc_cli::VersionInfo;
|
||||
|
||||
use std::cell::RefCell;
|
||||
|
||||
// handles ctrl-c
|
||||
struct Exit;
|
||||
impl substrate_cli::IntoExit for Exit {
|
||||
impl sc_cli::IntoExit for Exit {
|
||||
type Exit = future::Map<oneshot::Receiver<()>, fn(Result<(), oneshot::Canceled>) -> ()>;
|
||||
fn into_exit(self) -> Self::Exit {
|
||||
// can't use signal directly here because CtrlC takes only `Fn`.
|
||||
@@ -43,7 +43,7 @@ impl substrate_cli::IntoExit for Exit {
|
||||
}
|
||||
}
|
||||
|
||||
fn main() -> Result<(), substrate_cli::error::Error> {
|
||||
fn main() -> Result<(), sc_cli::error::Error> {
|
||||
let version = VersionInfo {
|
||||
name: "Substrate Node",
|
||||
commit: env!("VERGEN_SHA_SHORT"),
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
use std::{fs, env, path::Path};
|
||||
use structopt::{StructOpt, clap::Shell};
|
||||
use substrate_cli::{NoCustom, CoreParams};
|
||||
use sc_cli::{NoCustom, CoreParams};
|
||||
use vergen::{ConstantsFlags, generate_cargo_keys};
|
||||
|
||||
fn main() {
|
||||
|
||||
@@ -19,7 +19,7 @@ use futures01::{prelude::*, sync::oneshot, sync::mpsc};
|
||||
use libp2p::wasm_ext;
|
||||
use log::{debug, info};
|
||||
use std::sync::Arc;
|
||||
use substrate_service::{AbstractService, RpcSession, Roles as ServiceRoles, Configuration, config::DatabaseConfig};
|
||||
use sc_service::{AbstractService, RpcSession, Roles as ServiceRoles, Configuration, config::DatabaseConfig};
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
/// Starts the client.
|
||||
|
||||
@@ -26,14 +26,14 @@ use node_runtime::{
|
||||
};
|
||||
use node_runtime::Block;
|
||||
use node_runtime::constants::currency::*;
|
||||
use substrate_service;
|
||||
use sc_service;
|
||||
use hex_literal::hex;
|
||||
use substrate_telemetry::TelemetryEndpoints;
|
||||
use sc_telemetry::TelemetryEndpoints;
|
||||
use grandpa_primitives::{AuthorityId as GrandpaId};
|
||||
use babe_primitives::{AuthorityId as BabeId};
|
||||
use im_online::sr25519::{AuthorityId as ImOnlineId};
|
||||
use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
|
||||
use sr_primitives::{Perbill, traits::{Verify, IdentifyAccount}};
|
||||
use sp_runtime::{Perbill, traits::{Verify, IdentifyAccount}};
|
||||
|
||||
pub use node_primitives::{AccountId, Balance, Signature};
|
||||
pub use node_runtime::GenesisConfig;
|
||||
@@ -53,7 +53,7 @@ pub struct Extensions {
|
||||
}
|
||||
|
||||
/// Specialized `ChainSpec`.
|
||||
pub type ChainSpec = substrate_service::ChainSpec<
|
||||
pub type ChainSpec = sc_service::ChainSpec<
|
||||
GenesisConfig,
|
||||
Extensions,
|
||||
>;
|
||||
@@ -347,7 +347,7 @@ pub fn local_testnet_config() -> ChainSpec {
|
||||
pub(crate) mod tests {
|
||||
use super::*;
|
||||
use crate::service::new_full;
|
||||
use substrate_service::Roles;
|
||||
use sc_service::Roles;
|
||||
use service_test;
|
||||
|
||||
fn local_testnet_genesis_instant_single() -> GenesisConfig {
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pub use substrate_cli::VersionInfo;
|
||||
pub use sc_cli::VersionInfo;
|
||||
use tokio::prelude::Future;
|
||||
use tokio::runtime::{Builder as RuntimeBuilder, Runtime};
|
||||
use substrate_cli::{IntoExit, NoCustom, SharedParams, ImportParams, error};
|
||||
use substrate_service::{AbstractService, Roles as ServiceRoles, Configuration};
|
||||
use sc_cli::{IntoExit, NoCustom, SharedParams, ImportParams, error};
|
||||
use sc_service::{AbstractService, Roles as ServiceRoles, Configuration};
|
||||
use log::info;
|
||||
use structopt::{StructOpt, clap::App};
|
||||
use substrate_cli::{display_role, parse_and_prepare, AugmentClap, GetLogFilter, ParseAndPrepare};
|
||||
use sc_cli::{display_role, parse_and_prepare, AugmentClap, GetLogFilter, ParseAndPrepare};
|
||||
use crate::{service, ChainSpec, load_spec};
|
||||
use crate::factory_impl::FactoryState;
|
||||
use transaction_factory::RuntimeAdapter;
|
||||
@@ -93,7 +93,7 @@ impl AugmentClap for FactoryCmd {
|
||||
}
|
||||
|
||||
/// Parse command line arguments into service configuration.
|
||||
pub fn run<I, T, E>(args: I, exit: E, version: substrate_cli::VersionInfo) -> error::Result<()> where
|
||||
pub fn run<I, T, E>(args: I, exit: E, version: sc_cli::VersionInfo) -> error::Result<()> where
|
||||
I: IntoIterator<Item = T>,
|
||||
T: Into<std::ffi::OsString> + Clone,
|
||||
E: IntoExit,
|
||||
@@ -135,13 +135,13 @@ pub fn run<I, T, E>(args: I, exit: E, version: substrate_cli::VersionInfo) -> er
|
||||
ParseAndPrepare::RevertChain(cmd) => cmd.run_with_builder(|config: Config<_, _>|
|
||||
Ok(new_full_start!(config).0), load_spec),
|
||||
ParseAndPrepare::CustomCommand(CustomSubcommands::Factory(cli_args)) => {
|
||||
let mut config: Config<_, _> = substrate_cli::create_config_with_db_path(
|
||||
let mut config: Config<_, _> = sc_cli::create_config_with_db_path(
|
||||
load_spec,
|
||||
&cli_args.shared_params,
|
||||
&version,
|
||||
)?;
|
||||
|
||||
substrate_cli::fill_import_params(&mut config, &cli_args.import_params, ServiceRoles::FULL)?;
|
||||
sc_cli::fill_import_params(&mut config, &cli_args.import_params, ServiceRoles::FULL)?;
|
||||
|
||||
match ChainSpec::from(config.chain_spec.id()) {
|
||||
Some(ref c) if c == &ChainSpec::Development || c == &ChainSpec::LocalTestnet => {},
|
||||
@@ -180,7 +180,7 @@ where
|
||||
|
||||
let (exit_send, exit) = oneshot::channel();
|
||||
|
||||
let informant = substrate_cli::informant::build(&service);
|
||||
let informant = sc_cli::informant::build(&service);
|
||||
|
||||
let future = select(informant, exit)
|
||||
.map(|_| Ok(()))
|
||||
|
||||
@@ -29,7 +29,7 @@ use node_runtime::{
|
||||
};
|
||||
use node_primitives::Signature;
|
||||
use primitives::{sr25519, crypto::Pair};
|
||||
use sr_primitives::{
|
||||
use sp_runtime::{
|
||||
generic::Era, traits::{Block as BlockT, Header as HeaderT, SignedExtension, Verify, IdentifyAccount}
|
||||
};
|
||||
use transaction_factory::RuntimeAdapter;
|
||||
@@ -71,7 +71,7 @@ impl RuntimeAdapter for FactoryState<Number> {
|
||||
type AccountId = node_primitives::AccountId;
|
||||
type Balance = node_primitives::Balance;
|
||||
type Block = node_primitives::Block;
|
||||
type Phase = sr_primitives::generic::Phase;
|
||||
type Phase = sp_runtime::generic::Phase;
|
||||
type Secret = sr25519::Pair;
|
||||
type Index = node_primitives::Index;
|
||||
|
||||
|
||||
@@ -26,16 +26,16 @@ use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider};
|
||||
use node_executor;
|
||||
use node_primitives::Block;
|
||||
use node_runtime::{GenesisConfig, RuntimeApi};
|
||||
use substrate_service::{
|
||||
use sc_service::{
|
||||
AbstractService, ServiceBuilder, config::Configuration, error::{Error as ServiceError},
|
||||
};
|
||||
use inherents::InherentDataProviders;
|
||||
use network::construct_simple_protocol;
|
||||
|
||||
use substrate_service::{Service, NetworkStatus};
|
||||
use sc_service::{Service, NetworkStatus};
|
||||
use client::{Client, LocalCallExecutor};
|
||||
use client_db::Backend;
|
||||
use sr_primitives::traits::Block as BlockT;
|
||||
use sp_runtime::traits::Block as BlockT;
|
||||
use node_executor::NativeExecutor;
|
||||
use network::NetworkService;
|
||||
use offchain::OffchainWorkers;
|
||||
@@ -52,11 +52,11 @@ construct_simple_protocol! {
|
||||
/// be able to perform chain operations.
|
||||
macro_rules! new_full_start {
|
||||
($config:expr) => {{
|
||||
type RpcExtension = jsonrpc_core::IoHandler<substrate_rpc::Metadata>;
|
||||
type RpcExtension = jsonrpc_core::IoHandler<sc_rpc::Metadata>;
|
||||
let mut import_setup = None;
|
||||
let inherent_data_providers = inherents::InherentDataProviders::new();
|
||||
|
||||
let builder = substrate_service::ServiceBuilder::new_full::<
|
||||
let builder = sc_service::ServiceBuilder::new_full::<
|
||||
node_primitives::Block, node_runtime::RuntimeApi, node_executor::Executor
|
||||
>($config)?
|
||||
.with_select_chain(|_config, backend| {
|
||||
@@ -71,7 +71,7 @@ macro_rules! new_full_start {
|
||||
})?
|
||||
.with_import_queue(|_config, client, mut select_chain, _transaction_pool| {
|
||||
let select_chain = select_chain.take()
|
||||
.ok_or_else(|| substrate_service::Error::SelectChainRequired)?;
|
||||
.ok_or_else(|| sc_service::Error::SelectChainRequired)?;
|
||||
let (grandpa_block_import, grandpa_link) = grandpa::block_import(
|
||||
client.clone(),
|
||||
&*client,
|
||||
@@ -160,14 +160,14 @@ macro_rules! new_full {
|
||||
($with_startup_data)(&block_import, &babe_link);
|
||||
|
||||
if participates_in_consensus {
|
||||
let proposer = substrate_basic_authorship::ProposerFactory {
|
||||
let proposer = sc_basic_authority::ProposerFactory {
|
||||
client: service.client(),
|
||||
transaction_pool: service.transaction_pool(),
|
||||
};
|
||||
|
||||
let client = service.client();
|
||||
let select_chain = service.select_chain()
|
||||
.ok_or(substrate_service::Error::SelectChainRequired)?;
|
||||
.ok_or(sc_service::Error::SelectChainRequired)?;
|
||||
|
||||
let can_author_with =
|
||||
consensus_common::CanAuthorWithNativeVersion::new(client.executor().clone());
|
||||
@@ -314,7 +314,7 @@ pub fn new_full<C: Send + Default + 'static>(config: NodeConfiguration<C>)
|
||||
/// Builds a new service for a light client.
|
||||
pub fn new_light<C: Send + Default + 'static>(config: NodeConfiguration<C>)
|
||||
-> Result<impl AbstractService, ServiceError> {
|
||||
type RpcExtension = jsonrpc_core::IoHandler<substrate_rpc::Metadata>;
|
||||
type RpcExtension = jsonrpc_core::IoHandler<sc_rpc::Metadata>;
|
||||
let inherent_data_providers = InherentDataProviders::new();
|
||||
|
||||
let service = ServiceBuilder::new_light::<Block, RuntimeApi, node_executor::Executor>(config)?
|
||||
@@ -394,7 +394,7 @@ mod tests {
|
||||
use node_runtime::constants::{currency::CENTS, time::SLOT_DURATION};
|
||||
use codec::{Encode, Decode};
|
||||
use primitives::{crypto::Pair as CryptoPair, H256};
|
||||
use sr_primitives::{
|
||||
use sp_runtime::{
|
||||
generic::{BlockId, Era, Digest, SignedPayload},
|
||||
traits::Block as BlockT,
|
||||
traits::Verify,
|
||||
@@ -403,9 +403,9 @@ mod tests {
|
||||
use sp_timestamp;
|
||||
use sp_finality_tracker;
|
||||
use keyring::AccountKeyring;
|
||||
use substrate_service::{AbstractService, Roles};
|
||||
use sc_service::{AbstractService, Roles};
|
||||
use crate::service::new_full;
|
||||
use sr_primitives::traits::IdentifyAccount;
|
||||
use sp_runtime::traits::IdentifyAccount;
|
||||
|
||||
type AccountPublic = <Signature as Verify>::Signer;
|
||||
|
||||
@@ -518,7 +518,7 @@ mod tests {
|
||||
|
||||
let parent_id = BlockId::number(service.client().info().chain.best_number);
|
||||
let parent_header = service.client().header(&parent_id).unwrap().unwrap();
|
||||
let mut proposer_factory = substrate_basic_authorship::ProposerFactory {
|
||||
let mut proposer_factory = sc_basic_authority::ProposerFactory {
|
||||
client: service.client(),
|
||||
transaction_pool: service.transaction_pool(),
|
||||
};
|
||||
|
||||
@@ -8,18 +8,18 @@ edition = "2018"
|
||||
[dependencies]
|
||||
trie-root = "0.15.2"
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0" }
|
||||
runtime_io = { package = "sr-io", path = "../../../primitives/sr-io" }
|
||||
state_machine = { package = "substrate-state-machine", path = "../../../primitives/state-machine" }
|
||||
substrate-executor = { path = "../../../client/executor" }
|
||||
primitives = { package = "substrate-primitives", path = "../../../primitives/core" }
|
||||
trie = { package = "substrate-trie", path = "../../../primitives/trie" }
|
||||
runtime_io = { package = "sp-io", path = "../../../primitives/sr-io" }
|
||||
state_machine = { package = "sp-state-machine", path = "../../../primitives/state-machine" }
|
||||
sc-executor = { path = "../../../client/executor" }
|
||||
primitives = { package = "sp-core", path = "../../../primitives/core" }
|
||||
trie = { package = "sp-trie", path = "../../../primitives/trie" }
|
||||
node-primitives = { path = "../primitives" }
|
||||
node-runtime = { path = "../runtime" }
|
||||
|
||||
[dev-dependencies]
|
||||
node-testing = { path = "../testing" }
|
||||
test-client = { package = "substrate-test-client", path = "../../../test/utils/client" }
|
||||
sr-primitives = { path = "../../../primitives/sr-primitives" }
|
||||
sp-runtime = { path = "../../../primitives/sr-primitives" }
|
||||
runtime_support = { package = "frame-support", path = "../../../frame/support" }
|
||||
balances = { package = "pallet-balances", path = "../../../frame/balances" }
|
||||
transaction-payment = { package = "pallet-transaction-payment", path = "../../../frame/transaction-payment" }
|
||||
@@ -35,10 +35,10 @@ criterion = "0.3.0"
|
||||
|
||||
[features]
|
||||
wasmtime = [
|
||||
"substrate-executor/wasmtime",
|
||||
"sc-executor/wasmtime",
|
||||
]
|
||||
wasmi-errno = [
|
||||
"substrate-executor/wasmi-errno",
|
||||
"sc-executor/wasmi-errno",
|
||||
]
|
||||
stress-test = []
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ use primitives::storage::well_known_keys;
|
||||
use primitives::traits::CodeExecutor;
|
||||
use runtime_support::Hashable;
|
||||
use state_machine::TestExternalities as CoreTestExternalities;
|
||||
use substrate_executor::{NativeExecutor, RuntimeInfo, WasmExecutionMethod, Externalities};
|
||||
use sc_executor::{NativeExecutor, RuntimeInfo, WasmExecutionMethod, Externalities};
|
||||
|
||||
criterion_group!(benches, bench_execute_block);
|
||||
criterion_main!(benches);
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
//! A `CodeExecutor` specialization which uses natively compiled runtime when the wasm to be
|
||||
//! executed is equivalent to the natively compiled code.
|
||||
|
||||
pub use substrate_executor::NativeExecutor;
|
||||
use substrate_executor::native_executor_instance;
|
||||
pub use sc_executor::NativeExecutor;
|
||||
use sc_executor::native_executor_instance;
|
||||
|
||||
// Declare an instance of the native executor named `Executor`. Include the wasm binary as the
|
||||
// equivalent wasm code.
|
||||
@@ -30,7 +30,7 @@ native_executor_instance!(
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use substrate_executor::error::Result;
|
||||
use sc_executor::error::Result;
|
||||
use super::Executor;
|
||||
use {balances, contracts, indices, system, timestamp};
|
||||
use codec::{Encode, Decode, Joiner};
|
||||
@@ -44,12 +44,12 @@ mod tests {
|
||||
Blake2Hasher, NeverNativeValue, NativeOrEncoded, map,
|
||||
traits::{CodeExecutor, Externalities}, storage::well_known_keys,
|
||||
};
|
||||
use sr_primitives::{
|
||||
use sp_runtime::{
|
||||
Fixed64, traits::{Header as HeaderT, Hash as HashT, Convert}, ApplyExtrinsicResult,
|
||||
transaction_validity::InvalidTransaction,
|
||||
};
|
||||
use contracts::ContractAddressFor;
|
||||
use substrate_executor::{NativeExecutor, WasmExecutionMethod};
|
||||
use sc_executor::{NativeExecutor, WasmExecutionMethod};
|
||||
use system::{EventRecord, Phase};
|
||||
use node_runtime::{
|
||||
Header, Block, UncheckedExtrinsic, CheckedExtrinsic, Call, Runtime, Balances, BuildStorage,
|
||||
|
||||
@@ -5,16 +5,16 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
primitives = { package = "substrate-primitives", path = "../../../primitives/core", default-features = false }
|
||||
sr-primitives = { path = "../../../primitives/sr-primitives", default-features = false }
|
||||
primitives = { package = "sp-core", path = "../../../primitives/core", default-features = false }
|
||||
sp-runtime = { path = "../../../primitives/sr-primitives", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
substrate-serializer = { path = "../../../primitives/serializer" }
|
||||
sp-serializer = { path = "../../../primitives/serializer" }
|
||||
pretty_assertions = "0.6.1"
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"primitives/std",
|
||||
"sr-primitives/std",
|
||||
"sp-runtime/std",
|
||||
]
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
use sr_primitives::{
|
||||
use sp_runtime::{
|
||||
generic, traits::{Verify, BlakeTwo256, IdentifyAccount}, OpaqueExtrinsic, MultiSignature
|
||||
};
|
||||
|
||||
|
||||
@@ -11,4 +11,4 @@ hyper = "0.12.35"
|
||||
jsonrpc-core-client = { version = "14.0.3", features = ["http", "ws"] }
|
||||
log = "0.4.8"
|
||||
node-primitives = { path = "../primitives" }
|
||||
substrate-rpc = { path = "../../../client/rpc", version = "2.0.0" }
|
||||
sc-rpc = { path = "../../../client/rpc", version = "2.0.0" }
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
use futures::Future;
|
||||
use hyper::rt;
|
||||
use node_primitives::Hash;
|
||||
use substrate_rpc::author::{
|
||||
use sc_rpc::author::{
|
||||
AuthorClient,
|
||||
hash::ExtrinsicOrHash,
|
||||
};
|
||||
|
||||
@@ -5,11 +5,11 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
client = { package = "substrate-client", path = "../../../client/" }
|
||||
client = { package = "sc-client", path = "../../../client/" }
|
||||
jsonrpc-core = "14.0.3"
|
||||
node-primitives = { path = "../primitives" }
|
||||
node-runtime = { path = "../runtime" }
|
||||
sr-primitives = { path = "../../../primitives/sr-primitives" }
|
||||
sp-runtime = { path = "../../../primitives/sr-primitives" }
|
||||
pallet-contracts-rpc = { path = "../../../frame/contracts/rpc/" }
|
||||
pallet-transaction-payment-rpc = { path = "../../../frame/transaction-payment/rpc/" }
|
||||
substrate-frame-rpc-system = { path = "../../../utils/frame/rpc/system" }
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
//!
|
||||
//! Since `substrate` core functionality makes no assumptions
|
||||
//! about the modules used inside the runtime, so do
|
||||
//! RPC methods defined in `substrate-rpc` crate.
|
||||
//! RPC methods defined in `sc-rpc` crate.
|
||||
//! It means that `client/rpc` can't have any methods that
|
||||
//! need some strong assumptions about the particular runtime.
|
||||
//!
|
||||
@@ -33,7 +33,7 @@ use std::sync::Arc;
|
||||
|
||||
use node_primitives::{Block, AccountId, Index, Balance};
|
||||
use node_runtime::UncheckedExtrinsic;
|
||||
use sr_primitives::traits::ProvideRuntimeApi;
|
||||
use sp_runtime::traits::ProvideRuntimeApi;
|
||||
use txpool_api::TransactionPool;
|
||||
|
||||
/// Light client extra dependencies.
|
||||
|
||||
@@ -14,21 +14,21 @@ rustc-hex = { version = "2.0", optional = true }
|
||||
serde = { version = "1.0.102", optional = true }
|
||||
|
||||
# primitives
|
||||
authority-discovery-primitives = { package = "substrate-authority-discovery-primitives", path = "../../../primitives/authority-discovery", default-features = false }
|
||||
babe-primitives = { package = "substrate-consensus-babe-primitives", path = "../../../primitives/consensus/babe", default-features = false }
|
||||
block-builder-api = { package = "substrate-block-builder-runtime-api", path = "../../../primitives/block-builder/runtime-api", default-features = false}
|
||||
inherents = { package = "substrate-inherents", path = "../../../primitives/inherents", default-features = false }
|
||||
authority-discovery-primitives = { package = "sp-authority-discovery", path = "../../../primitives/authority-discovery", default-features = false }
|
||||
babe-primitives = { package = "sp-consensus-babe", path = "../../../primitives/consensus/babe", default-features = false }
|
||||
block-builder-api = { package = "sp-block-builder", path = "../../../primitives/block-builder/runtime-api", default-features = false}
|
||||
inherents = { package = "sp-inherents", path = "../../../primitives/inherents", default-features = false }
|
||||
node-primitives = { path = "../primitives", default-features = false }
|
||||
offchain-primitives = { package = "substrate-offchain-primitives", path = "../../../primitives/offchain", default-features = false }
|
||||
primitives = { package = "substrate-primitives", path = "../../../primitives/core", default-features = false }
|
||||
rstd = { package = "sr-std", path = "../../../primitives/sr-std", default-features = false }
|
||||
sr-api = { path = "../../../primitives/sr-api", default-features = false }
|
||||
sr-primitives = { path = "../../../primitives/sr-primitives", default-features = false }
|
||||
sr-staking-primitives = { path = "../../../primitives/sr-staking-primitives", default-features = false }
|
||||
substrate-keyring = { path = "../../../primitives/keyring", optional = true }
|
||||
substrate-session = { path = "../../../primitives/session", default-features = false }
|
||||
offchain-primitives = { package = "sp-offchain", path = "../../../primitives/offchain", default-features = false }
|
||||
primitives = { package = "sp-core", path = "../../../primitives/core", default-features = false }
|
||||
rstd = { package = "sp-std", path = "../../../primitives/sr-std", default-features = false }
|
||||
sp-api = { path = "../../../primitives/sr-api", default-features = false }
|
||||
sp-runtime = { path = "../../../primitives/sr-primitives", default-features = false }
|
||||
sp-staking = { path = "../../../primitives/sr-staking-primitives", default-features = false }
|
||||
sp-keyring = { path = "../../../primitives/keyring", optional = true }
|
||||
sp-sesssion = { path = "../../../primitives/session", default-features = false }
|
||||
txpool-runtime-api = { package = "sp-transaction-pool-runtime-api", path = "../../../primitives/transaction-pool/runtime-api", default-features = false }
|
||||
version = { package = "sr-version", path = "../../../primitives/sr-version", default-features = false }
|
||||
version = { package = "sp-version", path = "../../../primitives/sr-version", default-features = false }
|
||||
|
||||
# frame dependencies
|
||||
authority-discovery = { package = "pallet-authority-discovery", path = "../../../frame/authority-discovery", default-features = false }
|
||||
@@ -66,7 +66,7 @@ transaction-payment-rpc-runtime-api = { package = "pallet-transaction-payment-rp
|
||||
wasm-builder-runner = { package = "substrate-wasm-builder-runner", path = "../../../client/utils/wasm-builder-runner", version = "1.0.4" }
|
||||
|
||||
[dev-dependencies]
|
||||
runtime_io = { package = "sr-io", path = "../../../primitives/sr-io" }
|
||||
runtime_io = { package = "sp-io", path = "../../../primitives/sr-io" }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
@@ -102,12 +102,12 @@ std = [
|
||||
"safe-mix/std",
|
||||
"serde",
|
||||
"session/std",
|
||||
"sr-api/std",
|
||||
"sr-primitives/std",
|
||||
"sr-staking-primitives/std",
|
||||
"sp-api/std",
|
||||
"sp-runtime/std",
|
||||
"sp-staking/std",
|
||||
"staking/std",
|
||||
"substrate-keyring",
|
||||
"substrate-session/std",
|
||||
"sp-keyring",
|
||||
"sp-sesssion/std",
|
||||
"sudo/std",
|
||||
"support/std",
|
||||
"system-rpc-runtime-api/std",
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
//! Some configurable implementations as associated type for the substrate runtime.
|
||||
|
||||
use node_primitives::Balance;
|
||||
use sr_primitives::traits::{Convert, Saturating};
|
||||
use sr_primitives::{Fixed64, Perbill};
|
||||
use sp_runtime::traits::{Convert, Saturating};
|
||||
use sp_runtime::{Fixed64, Perbill};
|
||||
use support::{traits::{OnUnbalanced, Currency, Get}, weights::Weight};
|
||||
use crate::{Balances, System, Authorship, MaximumBlockWeight, NegativeImbalance};
|
||||
|
||||
@@ -115,7 +115,7 @@ impl<T: Get<Perbill>> Convert<Fixed64, Fixed64> for TargetedFeeAdjustment<T> {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use sr_primitives::assert_eq_error_rate;
|
||||
use sp_runtime::assert_eq_error_rate;
|
||||
use crate::{MaximumBlockWeight, AvailableBlockRatio, Runtime};
|
||||
use crate::{constants::currency::*, TransactionPayment, TargetBlockFullness};
|
||||
use support::weights::Weight;
|
||||
|
||||
@@ -28,11 +28,11 @@ use support::{
|
||||
};
|
||||
use primitives::u32_trait::{_1, _2, _3, _4};
|
||||
use node_primitives::{AccountId, AccountIndex, Balance, BlockNumber, Hash, Index, Moment, Signature};
|
||||
use sr_api::impl_runtime_apis;
|
||||
use sr_primitives::{Permill, Perbill, ApplyExtrinsicResult, impl_opaque_keys, generic, create_runtime_str};
|
||||
use sr_primitives::curve::PiecewiseLinear;
|
||||
use sr_primitives::transaction_validity::TransactionValidity;
|
||||
use sr_primitives::traits::{
|
||||
use sp_api::impl_runtime_apis;
|
||||
use sp_runtime::{Permill, Perbill, ApplyExtrinsicResult, impl_opaque_keys, generic, create_runtime_str};
|
||||
use sp_runtime::curve::PiecewiseLinear;
|
||||
use sp_runtime::transaction_validity::TransactionValidity;
|
||||
use sp_runtime::traits::{
|
||||
self, BlakeTwo256, Block as BlockT, NumberFor, StaticLookup, SaturatedConversion,
|
||||
OpaqueKeys,
|
||||
};
|
||||
@@ -50,7 +50,7 @@ use system::offchain::TransactionSubmitter;
|
||||
use inherents::{InherentData, CheckInherentsResult};
|
||||
|
||||
#[cfg(any(feature = "std", test))]
|
||||
pub use sr_primitives::BuildStorage;
|
||||
pub use sp_runtime::BuildStorage;
|
||||
pub use timestamp::Call as TimestampCall;
|
||||
pub use balances::Call as BalancesCall;
|
||||
pub use contracts::Gas;
|
||||
@@ -248,7 +248,7 @@ pallet_staking_reward_curve::build! {
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const SessionsPerEra: sr_staking_primitives::SessionIndex = 6;
|
||||
pub const SessionsPerEra: sp_staking::SessionIndex = 6;
|
||||
pub const BondingDuration: staking::EraIndex = 24 * 28;
|
||||
pub const SlashDeferDuration: staking::EraIndex = 24 * 7; // 1/4 the bonding duration.
|
||||
pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
|
||||
@@ -571,7 +571,7 @@ pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Call, SignedExt
|
||||
pub type Executive = executive::Executive<Runtime, Block, system::ChainContext<Runtime>, Runtime, AllModules>;
|
||||
|
||||
impl_runtime_apis! {
|
||||
impl sr_api::Core<Block> for Runtime {
|
||||
impl sp_api::Core<Block> for Runtime {
|
||||
fn version() -> RuntimeVersion {
|
||||
VERSION
|
||||
}
|
||||
@@ -585,7 +585,7 @@ impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
impl sr_api::Metadata<Block> for Runtime {
|
||||
impl sp_api::Metadata<Block> for Runtime {
|
||||
fn metadata() -> OpaqueMetadata {
|
||||
Runtime::metadata().into()
|
||||
}
|
||||
@@ -711,7 +711,7 @@ impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
impl substrate_session::SessionKeys<Block> for Runtime {
|
||||
impl sp_sesssion::SessionKeys<Block> for Runtime {
|
||||
fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {
|
||||
SessionKeys::generate(seed)
|
||||
}
|
||||
|
||||
@@ -7,22 +7,22 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
balances = { package = "pallet-balances", path = "../../../frame/balances" }
|
||||
client = { package = "substrate-client", path = "../../../client/" }
|
||||
client = { package = "sc-client", path = "../../../client/" }
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0" }
|
||||
contracts = { package = "pallet-contracts", path = "../../../frame/contracts" }
|
||||
grandpa = { package = "pallet-grandpa", path = "../../../frame/grandpa" }
|
||||
indices = { package = "pallet-indices", path = "../../../frame/indices" }
|
||||
keyring = { package = "substrate-keyring", path = "../../../primitives/keyring" }
|
||||
keyring = { package = "sp-keyring", path = "../../../primitives/keyring" }
|
||||
node-executor = { path = "../executor" }
|
||||
node-primitives = { path = "../primitives" }
|
||||
node-runtime = { path = "../runtime" }
|
||||
primitives = { package = "substrate-primitives", path = "../../../primitives/core" }
|
||||
runtime-io = { package = "sr-io", path = "../../../primitives/sr-io" }
|
||||
primitives = { package = "sp-core", path = "../../../primitives/core" }
|
||||
runtime-io = { package = "sp-io", path = "../../../primitives/sr-io" }
|
||||
runtime_support = { package = "frame-support", path = "../../../frame/support" }
|
||||
session = { package = "pallet-session", path = "../../../frame/session" }
|
||||
sr-primitives = { path = "../../../primitives/sr-primitives" }
|
||||
sp-runtime = { path = "../../../primitives/sr-primitives" }
|
||||
staking = { package = "pallet-staking", path = "../../../frame/staking" }
|
||||
substrate-executor = { path = "../../../client/executor" }
|
||||
sc-executor = { path = "../../../client/executor" }
|
||||
system = { package = "frame-system", path = "../../../frame/system" }
|
||||
test-client = { package = "substrate-test-client", path = "../../../test/utils/client" }
|
||||
timestamp = { package = "pallet-timestamp", path = "../../../frame/timestamp" }
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
//! Utilites to build a `TestClient` for `node-runtime`.
|
||||
|
||||
use sr_primitives::BuildStorage;
|
||||
use sp_runtime::BuildStorage;
|
||||
|
||||
/// Re-export test-client utilities.
|
||||
pub use test_client::*;
|
||||
|
||||
/// Call executor for `node-runtime` `TestClient`.
|
||||
pub type Executor = substrate_executor::NativeExecutor<node_executor::Executor>;
|
||||
pub type Executor = sc_executor::NativeExecutor<node_executor::Executor>;
|
||||
|
||||
/// Default backend type.
|
||||
pub type Backend = client_db::Backend<node_primitives::Block>;
|
||||
|
||||
@@ -24,7 +24,7 @@ use node_runtime::{
|
||||
};
|
||||
use node_runtime::constants::currency::*;
|
||||
use primitives::ChangesTrieConfiguration;
|
||||
use sr_primitives::Perbill;
|
||||
use sp_runtime::Perbill;
|
||||
|
||||
|
||||
/// Create genesis runtime configuration for tests.
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
use keyring::{AccountKeyring, Sr25519Keyring, Ed25519Keyring};
|
||||
use node_primitives::{AccountId, Balance, Index};
|
||||
use node_runtime::{CheckedExtrinsic, UncheckedExtrinsic, SessionKeys, SignedExtra};
|
||||
use sr_primitives::generic::Era;
|
||||
use sp_runtime::generic::Era;
|
||||
use codec::Encode;
|
||||
|
||||
/// Alice's account id.
|
||||
|
||||
@@ -5,10 +5,10 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
primitives = { package = "substrate-primitives", version = "*", path = "../../primitives/core" }
|
||||
primitives = { package = "sp-core", version = "*", path = "../../primitives/core" }
|
||||
node-runtime = { version = "*", path = "../node/runtime" }
|
||||
node-primitives = { version = "*", path = "../node/primitives" }
|
||||
sr-primitives = { version = "*", path = "../../primitives/sr-primitives" }
|
||||
sp-runtime = { version = "*", path = "../../primitives/sr-primitives" }
|
||||
rand = "0.7.2"
|
||||
clap = "2.33.0"
|
||||
tiny-bip39 = "0.6.2"
|
||||
|
||||
@@ -28,7 +28,7 @@ use primitives::{
|
||||
crypto::{set_default_ss58_version, Ss58AddressFormat, Ss58Codec},
|
||||
ed25519, sr25519, ecdsa, Pair, Public, H256, hexdisplay::HexDisplay,
|
||||
};
|
||||
use sr_primitives::{traits::{IdentifyAccount, Verify}, generic::Era};
|
||||
use sp_runtime::{traits::{IdentifyAccount, Verify}, generic::Era};
|
||||
use std::{
|
||||
convert::{TryInto, TryFrom},
|
||||
io::{stdin, Read},
|
||||
|
||||
+18
-18
@@ -1,41 +1,41 @@
|
||||
[package]
|
||||
name = "substrate-client"
|
||||
name = "sc-client"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
block-builder = { package = "substrate-block-builder", path = "block-builder" }
|
||||
client-api = { package = "substrate-client-api", path = "api" }
|
||||
block-builder = { package = "sc-block-builder", path = "block-builder" }
|
||||
client-api = { package = "sc-client-api", path = "api" }
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0", features = ["derive"] }
|
||||
consensus = { package = "substrate-consensus-common", path = "../primitives/consensus/common" }
|
||||
consensus = { package = "sp-consensus", path = "../primitives/consensus/common" }
|
||||
derive_more = { version = "0.99.2" }
|
||||
executor = { package = "substrate-executor", path = "executor" }
|
||||
externalities = { package = "substrate-externalities", path = "../primitives/externalities" }
|
||||
executor = { package = "sc-executor", path = "executor" }
|
||||
externalities = { package = "sp-externalities", path = "../primitives/externalities" }
|
||||
fnv = { version = "1.0.6" }
|
||||
futures = { version = "0.3.1", features = ["compat"] }
|
||||
hash-db = { version = "0.15.2" }
|
||||
hex-literal = { version = "0.2.1" }
|
||||
inherents = { package = "substrate-inherents", path = "../primitives/inherents" }
|
||||
keyring = { package = "substrate-keyring", path = "../primitives/keyring" }
|
||||
inherents = { package = "sp-inherents", path = "../primitives/inherents" }
|
||||
keyring = { package = "sp-keyring", path = "../primitives/keyring" }
|
||||
kvdb = "0.1.1"
|
||||
log = { version = "0.4.8" }
|
||||
parking_lot = { version = "0.9.0" }
|
||||
primitives = { package = "substrate-primitives", path = "../primitives/core" }
|
||||
rstd = { package = "sr-std", path = "../primitives/sr-std" }
|
||||
runtime-version = { package = "sr-version", path = "../primitives/sr-version" }
|
||||
sr-api = { path = "../primitives/sr-api" }
|
||||
sr-primitives = { path = "../primitives/sr-primitives" }
|
||||
primitives = { package = "sp-core", path = "../primitives/core" }
|
||||
rstd = { package = "sp-std", path = "../primitives/sr-std" }
|
||||
runtime-version = { package = "sp-version", path = "../primitives/sr-version" }
|
||||
sp-api = { path = "../primitives/sr-api" }
|
||||
sp-runtime = { path = "../primitives/sr-primitives" }
|
||||
sp-blockchain = { path = "../primitives/blockchain" }
|
||||
state-machine = { package = "substrate-state-machine", path = "../primitives/state-machine" }
|
||||
substrate-telemetry = { path = "telemetry" }
|
||||
trie = { package = "substrate-trie", path = "../primitives/trie" }
|
||||
state-machine = { package = "sp-state-machine", path = "../primitives/state-machine" }
|
||||
sc-telemetry = { path = "telemetry" }
|
||||
trie = { package = "sp-trie", path = "../primitives/trie" }
|
||||
tracing = "0.1.10"
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = "0.7.0"
|
||||
tempfile = "3.1.0"
|
||||
client-db = { package = "substrate-client-db", path = "./db", features = ["kvdb-rocksdb"] }
|
||||
client-db = { package = "sc-client-db", path = "./db", features = ["kvdb-rocksdb"] }
|
||||
test-client = { package = "substrate-test-runtime-client", path = "../test/utils/runtime/client" }
|
||||
kvdb-memorydb = "0.1.2"
|
||||
panic-handler = { package = "substrate-panic-handler", path = "../primitives/panic-handler" }
|
||||
panic-handler = { package = "sp-panic-handler", path = "../primitives/panic-handler" }
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
[package]
|
||||
name = "substrate-client-api"
|
||||
name = "sc-client-api"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
block-builder = { package = "substrate-block-builder", path = "../block-builder" }
|
||||
block-builder = { package = "sc-block-builder", path = "../block-builder" }
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
|
||||
consensus = { package = "substrate-consensus-common", path = "../../primitives/consensus/common" }
|
||||
consensus = { package = "sp-consensus", path = "../../primitives/consensus/common" }
|
||||
derive_more = { version = "0.99.2" }
|
||||
executor = { package = "substrate-executor", path = "../executor" }
|
||||
externalities = { package = "substrate-externalities", path = "../../primitives/externalities" }
|
||||
executor = { package = "sc-executor", path = "../executor" }
|
||||
externalities = { package = "sp-externalities", path = "../../primitives/externalities" }
|
||||
fnv = { version = "1.0.6" }
|
||||
futures = { version = "0.3.1" }
|
||||
hash-db = { version = "0.15.2", default-features = false }
|
||||
sp-blockchain = { path = "../../primitives/blockchain" }
|
||||
hex-literal = { version = "0.2.1" }
|
||||
inherents = { package = "substrate-inherents", path = "../../primitives/inherents", default-features = false }
|
||||
keyring = { package = "substrate-keyring", path = "../../primitives/keyring" }
|
||||
inherents = { package = "sp-inherents", path = "../../primitives/inherents", default-features = false }
|
||||
keyring = { package = "sp-keyring", path = "../../primitives/keyring" }
|
||||
kvdb = "0.1.1"
|
||||
log = { version = "0.4.8" }
|
||||
parking_lot = { version = "0.9.0" }
|
||||
primitives = { package = "substrate-primitives", path = "../../primitives/core", default-features = false }
|
||||
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
|
||||
runtime-version = { package = "sr-version", path = "../../primitives/sr-version", default-features = false }
|
||||
sr-api = { path = "../../primitives/sr-api" }
|
||||
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
|
||||
state-machine = { package = "substrate-state-machine", path = "../../primitives/state-machine" }
|
||||
substrate-telemetry = { path = "../telemetry" }
|
||||
trie = { package = "substrate-trie", path = "../../primitives/trie" }
|
||||
primitives = { package = "sp-core", path = "../../primitives/core", default-features = false }
|
||||
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
|
||||
runtime-version = { package = "sp-version", path = "../../primitives/sr-version", default-features = false }
|
||||
sp-api = { path = "../../primitives/sr-api" }
|
||||
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
|
||||
state-machine = { package = "sp-state-machine", path = "../../primitives/state-machine" }
|
||||
sc-telemetry = { path = "../telemetry" }
|
||||
trie = { package = "sp-trie", path = "../../primitives/trie" }
|
||||
txpool-api = { package = "sp-transaction-pool-api", path = "../../primitives/transaction-pool" }
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = "0.7.0"
|
||||
tempfile = "3.1.0"
|
||||
client-db = { package = "substrate-client-db", path = ".././db", features = ["kvdb-rocksdb"] }
|
||||
client-db = { package = "sc-client-db", path = ".././db", features = ["kvdb-rocksdb"] }
|
||||
test-primitives = { package = "substrate-test-primitives", path = "../../test/utils/primitives" }
|
||||
test-client = { package = "substrate-test-runtime-client", path = "../../test/utils/runtime/client" }
|
||||
kvdb-memorydb = "0.1.2"
|
||||
panic-handler = { package = "substrate-panic-handler", path = "../../primitives/panic-handler" }
|
||||
panic-handler = { package = "sp-panic-handler", path = "../../primitives/panic-handler" }
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ use std::sync::Arc;
|
||||
use std::collections::HashMap;
|
||||
use primitives::ChangesTrieConfiguration;
|
||||
use primitives::offchain::OffchainStorage;
|
||||
use sr_primitives::{generic::BlockId, Justification, StorageOverlay, ChildrenStorageOverlay};
|
||||
use sr_primitives::traits::{Block as BlockT, NumberFor};
|
||||
use sp_runtime::{generic::BlockId, Justification, StorageOverlay, ChildrenStorageOverlay};
|
||||
use sp_runtime::traits::{Block as BlockT, NumberFor};
|
||||
use state_machine::backend::Backend as StateBackend;
|
||||
use state_machine::{ChangesTrieStorage as StateChangesTrieStorage, ChangesTrieTransaction};
|
||||
use crate::{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
use std::{cmp::Ord, panic::UnwindSafe, result, cell::RefCell};
|
||||
use codec::{Encode, Decode};
|
||||
use sr_primitives::{
|
||||
use sp_runtime::{
|
||||
generic::BlockId, traits::Block as BlockT, traits::NumberFor,
|
||||
};
|
||||
use state_machine::{
|
||||
@@ -30,7 +30,7 @@ use externalities::Extensions;
|
||||
use hash_db::Hasher;
|
||||
use primitives::{Blake2Hasher, NativeOrEncoded};
|
||||
|
||||
use sr_api::{ProofRecorder, InitializeBlock};
|
||||
use sp_api::{ProofRecorder, InitializeBlock};
|
||||
use sp_blockchain;
|
||||
|
||||
/// Method call executor.
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
use std::collections::HashMap;
|
||||
use futures::channel::mpsc;
|
||||
use primitives::storage::StorageKey;
|
||||
use sr_primitives::{
|
||||
use sp_runtime::{
|
||||
traits::{Block as BlockT, NumberFor},
|
||||
generic::BlockId
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@ use primitives::{
|
||||
offchain::{self, OffchainExt, TransactionPoolExt},
|
||||
traits::{BareCryptoStorePtr, KeystoreExt},
|
||||
};
|
||||
use sr_primitives::{
|
||||
use sp_runtime::{
|
||||
generic::BlockId,
|
||||
traits,
|
||||
};
|
||||
|
||||
@@ -39,7 +39,7 @@ pub use state_machine::{StorageProof, ExecutionStrategy};
|
||||
pub mod utils {
|
||||
use sp_blockchain::{HeaderBackend, HeaderMetadata, Error};
|
||||
use primitives::H256;
|
||||
use sr_primitives::traits::{Block as BlockT};
|
||||
use sp_runtime::traits::{Block as BlockT};
|
||||
use std::borrow::Borrow;
|
||||
|
||||
/// Returns a function for checking block ancestry, the returned function will
|
||||
|
||||
@@ -20,7 +20,7 @@ use std::sync::Arc;
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
use std::future::Future;
|
||||
|
||||
use sr_primitives::{
|
||||
use sp_runtime::{
|
||||
traits::{
|
||||
Block as BlockT, Header as HeaderT, NumberFor,
|
||||
},
|
||||
|
||||
@@ -24,7 +24,7 @@ use std::{
|
||||
use fnv::{FnvHashSet, FnvHashMap};
|
||||
use futures::channel::mpsc;
|
||||
use primitives::storage::{StorageKey, StorageData};
|
||||
use sr_primitives::traits::Block as BlockT;
|
||||
use sp_runtime::traits::Block as BlockT;
|
||||
|
||||
/// Storage change set
|
||||
#[derive(Debug)]
|
||||
@@ -307,7 +307,7 @@ impl<Block: BlockT> StorageNotifications<Block> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use sr_primitives::testing::{H256 as Hash, Block as RawBlock, ExtrinsicWrapper};
|
||||
use sp_runtime::testing::{H256 as Hash, Block as RawBlock, ExtrinsicWrapper};
|
||||
use super::*;
|
||||
use std::iter::{empty, Empty};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "substrate-authority-discovery"
|
||||
name = "sc-authority-discovery"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
@@ -9,25 +9,25 @@ build = "build.rs"
|
||||
prost-build = "0.5.0"
|
||||
|
||||
[dependencies]
|
||||
authority-discovery-primitives = { package = "substrate-authority-discovery-primitives", path = "../../primitives/authority-discovery" }
|
||||
authority-discovery-primitives = { package = "sp-authority-discovery", path = "../../primitives/authority-discovery" }
|
||||
bytes = "0.4.12"
|
||||
client-api = { package = "substrate-client-api", path = "../api" }
|
||||
client-api = { package = "sc-client-api", path = "../api" }
|
||||
codec = { package = "parity-scale-codec", default-features = false, version = "1.0.3" }
|
||||
derive_more = "0.99.2"
|
||||
futures = "0.3.1"
|
||||
futures-timer = "2.0"
|
||||
keystore = { package = "substrate-keystore", path = "../keystore" }
|
||||
keystore = { package = "sc-keystore", path = "../keystore" }
|
||||
libp2p = { version = "0.13.0", default-features = false, features = ["secp256k1", "libp2p-websocket"] }
|
||||
log = "0.4.8"
|
||||
network = { package = "substrate-network", path = "../network" }
|
||||
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
|
||||
network = { package = "sc-network", path = "../network" }
|
||||
primitives = { package = "sp-core", path = "../../primitives/core" }
|
||||
sp-blockchain = { path = "../../primitives/blockchain" }
|
||||
prost = "0.5.0"
|
||||
serde_json = "1.0.41"
|
||||
sr-primitives = { path = "../../primitives/sr-primitives" }
|
||||
sp-runtime = { path = "../../primitives/sr-primitives" }
|
||||
|
||||
[dev-dependencies]
|
||||
parking_lot = "0.9.0"
|
||||
peerset = { package = "substrate-peerset", path = "../peerset" }
|
||||
peerset = { package = "sc-peerset", path = "../peerset" }
|
||||
test-client = { package = "substrate-test-runtime-client", path = "../../test/utils/runtime/client" }
|
||||
sr-api = { path = "../../primitives/sr-api" }
|
||||
sp-api = { path = "../../primitives/sr-api" }
|
||||
|
||||
@@ -64,8 +64,8 @@ use network::{DhtEvent, ExHashT};
|
||||
use primitives::crypto::{key_types, Pair};
|
||||
use primitives::traits::BareCryptoStorePtr;
|
||||
use prost::Message;
|
||||
use sr_primitives::generic::BlockId;
|
||||
use sr_primitives::traits::{Block as BlockT, ProvideRuntimeApi};
|
||||
use sp_runtime::generic::BlockId;
|
||||
use sp_runtime::traits::{Block as BlockT, ProvideRuntimeApi};
|
||||
|
||||
type Interval = Box<dyn Stream<Item = ()> + Unpin + Send + Sync>;
|
||||
|
||||
@@ -472,13 +472,13 @@ fn interval_at(start: Instant, duration: Duration) -> Interval {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use sr_api::{ApiExt, Core, RuntimeVersion, StorageProof};
|
||||
use sp_api::{ApiExt, Core, RuntimeVersion, StorageProof};
|
||||
use futures::channel::mpsc::channel;
|
||||
use futures::executor::block_on;
|
||||
use futures::future::poll_fn;
|
||||
use primitives::{ExecutionContext, NativeOrEncoded, testing::KeyStore};
|
||||
use sr_primitives::traits::Zero;
|
||||
use sr_primitives::traits::{ApiRef, Block as BlockT, NumberFor, ProvideRuntimeApi};
|
||||
use sp_runtime::traits::Zero;
|
||||
use sp_runtime::traits::{ApiRef, Block as BlockT, NumberFor, ProvideRuntimeApi};
|
||||
use std::sync::{Arc, Mutex};
|
||||
use test_client::runtime::Block;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "substrate-basic-authorship"
|
||||
name = "sc-basic-authority"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
@@ -8,19 +8,19 @@ edition = "2018"
|
||||
log = "0.4.8"
|
||||
futures = "0.3.1"
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0" }
|
||||
sr-primitives = { path = "../../primitives/sr-primitives" }
|
||||
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
|
||||
sp-runtime = { path = "../../primitives/sr-primitives" }
|
||||
primitives = { package = "sp-core", path = "../../primitives/core" }
|
||||
sp-blockchain = { path = "../../primitives/blockchain" }
|
||||
client = { package = "substrate-client", path = "../" }
|
||||
client-api = { package = "substrate-client-api", path = "../api" }
|
||||
consensus_common = { package = "substrate-consensus-common", path = "../../primitives/consensus/common" }
|
||||
inherents = { package = "substrate-inherents", path = "../../primitives/inherents" }
|
||||
substrate-telemetry = { path = "../telemetry" }
|
||||
client = { package = "sc-client", path = "../" }
|
||||
client-api = { package = "sc-client-api", path = "../api" }
|
||||
consensus_common = { package = "sp-consensus", path = "../../primitives/consensus/common" }
|
||||
inherents = { package = "sp-inherents", path = "../../primitives/inherents" }
|
||||
sc-telemetry = { path = "../telemetry" }
|
||||
txpool-api = { package = "sp-transaction-pool-api", path = "../../primitives/transaction-pool" }
|
||||
block-builder = { package = "substrate-block-builder", path = "../block-builder" }
|
||||
block-builder = { package = "sc-block-builder", path = "../block-builder" }
|
||||
tokio-executor = { version = "0.2.0-alpha.6", features = ["blocking"] }
|
||||
|
||||
[dev-dependencies]
|
||||
txpool = { package = "sc-transaction-pool", path = "../../client/transaction-pool" }
|
||||
txpool = { package = "sc-tracing-pool", path = "../../client/transaction-pool" }
|
||||
test-client = { package = "substrate-test-runtime-client", path = "../../test/utils/runtime/client" }
|
||||
parking_lot = "0.9"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
//! A consensus proposer for "basic" chains which use the primitive inherent-data.
|
||||
|
||||
// FIXME #1021 move this into substrate-consensus-common
|
||||
// FIXME #1021 move this into sp-consensus
|
||||
|
||||
use std::{time, sync::Arc};
|
||||
use client_api::CallExecutor;
|
||||
@@ -27,14 +27,14 @@ use consensus_common::{evaluation};
|
||||
use inherents::InherentData;
|
||||
use log::{error, info, debug, trace};
|
||||
use primitives::{H256, Blake2Hasher, ExecutionContext};
|
||||
use sr_primitives::{
|
||||
use sp_runtime::{
|
||||
traits::{
|
||||
Block as BlockT, Hash as HashT, Header as HeaderT, ProvideRuntimeApi, DigestFor, BlakeTwo256
|
||||
},
|
||||
generic::BlockId,
|
||||
};
|
||||
use txpool_api::{TransactionPool, InPoolTransaction};
|
||||
use substrate_telemetry::{telemetry, CONSENSUS_INFO};
|
||||
use sc_telemetry::{telemetry, CONSENSUS_INFO};
|
||||
use block_builder::BlockBuilderApi;
|
||||
|
||||
/// Proposer factory.
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
//! # Example
|
||||
//!
|
||||
//! ```
|
||||
//! # use substrate_basic_authorship::ProposerFactory;
|
||||
//! # use sc_basic_authority::ProposerFactory;
|
||||
//! # use consensus_common::{Environment, Proposer};
|
||||
//! # use sr_primitives::generic::BlockId;
|
||||
//! # use sp_runtime::generic::BlockId;
|
||||
//! # use std::{sync::Arc, time::Duration};
|
||||
//! # use test_client::{self, runtime::{Extrinsic, Transfer}, AccountKeyring};
|
||||
//! # use txpool::{BasicPool, FullChainApi};
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
[package]
|
||||
name = "substrate-block-builder"
|
||||
name = "sc-block-builder"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
state-machine = { package = "substrate-state-machine", path = "../../primitives/state-machine" }
|
||||
sr-primitives = { path = "../../primitives/sr-primitives" }
|
||||
state-machine = { package = "sp-state-machine", path = "../../primitives/state-machine" }
|
||||
sp-runtime = { path = "../../primitives/sr-primitives" }
|
||||
sp-blockchain = { path = "../../primitives/blockchain" }
|
||||
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
|
||||
primitives = { package = "sp-core", path = "../../primitives/core" }
|
||||
codec = { package = "parity-scale-codec", version = "1.0.6", features = ["derive"] }
|
||||
runtime_api = { package = "substrate-block-builder-runtime-api", path = "../../primitives/block-builder/runtime-api" }
|
||||
sr-api = { path = "../../primitives/sr-api" }
|
||||
runtime_api = { package = "sp-block-builder", path = "../../primitives/block-builder/runtime-api" }
|
||||
sp-api = { path = "../../primitives/sr-api" }
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
use codec::Encode;
|
||||
|
||||
use sr_primitives::{
|
||||
use sp_runtime::{
|
||||
generic::BlockId,
|
||||
traits::{
|
||||
Header as HeaderT, Hash, Block as BlockT, HashFor, ProvideRuntimeApi, ApiRef, DigestFor,
|
||||
@@ -36,7 +36,7 @@ use sr_primitives::{
|
||||
use sp_blockchain::{ApplyExtrinsicFailed, Error};
|
||||
use primitives::ExecutionContext;
|
||||
use state_machine::StorageProof;
|
||||
use sr_api::{Core, ApiExt, ApiErrorFor};
|
||||
use sp_api::{Core, ApiExt, ApiErrorFor};
|
||||
|
||||
pub use runtime_api::BlockBuilder as BlockBuilderApi;
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
[package]
|
||||
name = "substrate-chain-spec"
|
||||
name = "sc-chain-spec"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
substrate-chain-spec-derive = { path = "./derive" }
|
||||
sc-chain-spec-derive = { path = "./derive" }
|
||||
impl-trait-for-tuples = "0.1.3"
|
||||
network = { package = "substrate-network", path = "../network" }
|
||||
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
|
||||
network = { package = "sc-network", path = "../network" }
|
||||
primitives = { package = "sp-core", path = "../../primitives/core" }
|
||||
serde = { version = "1.0.101", features = ["derive"] }
|
||||
serde_json = "1.0.41"
|
||||
sr-primitives = { path = "../../primitives/sr-primitives" }
|
||||
tel = { package = "substrate-telemetry", path = "../telemetry" }
|
||||
sp-runtime = { path = "../../primitives/sr-primitives" }
|
||||
tel = { package = "sc-telemetry", path = "../telemetry" }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "substrate-chain-spec-derive"
|
||||
name = "sc-chain-spec-derive"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
|
||||
@@ -19,7 +19,7 @@ use quote::quote;
|
||||
use syn::{DeriveInput, Ident, Error};
|
||||
use proc_macro_crate::crate_name;
|
||||
|
||||
const CRATE_NAME: &str = "substrate-chain-spec";
|
||||
const CRATE_NAME: &str = "sc-chain-spec";
|
||||
const ATTRIBUTE_NAME: &str = "forks";
|
||||
|
||||
/// Implements `Extension's` `Group` accessor.
|
||||
|
||||
@@ -23,7 +23,7 @@ use std::path::PathBuf;
|
||||
use std::rc::Rc;
|
||||
use serde::{Serialize, Deserialize};
|
||||
use primitives::storage::{StorageKey, StorageData};
|
||||
use sr_primitives::{BuildStorage, StorageOverlay, ChildrenStorageOverlay};
|
||||
use sp_runtime::{BuildStorage, StorageOverlay, ChildrenStorageOverlay};
|
||||
use serde_json as json;
|
||||
use crate::RuntimeGenesis;
|
||||
use network::Multiaddr;
|
||||
|
||||
@@ -253,9 +253,9 @@ impl<B, E> Extension for Forks<B, E> where
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use substrate_chain_spec_derive::{ChainSpecGroup, ChainSpecExtension};
|
||||
use sc_chain_spec_derive::{ChainSpecGroup, ChainSpecExtension};
|
||||
// Make the proc macro work for tests and doc tests.
|
||||
use crate as substrate_chain_spec;
|
||||
use crate as sc_chain_spec;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ChainSpecGroup)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
//! ```rust
|
||||
//! use std::collections::HashMap;
|
||||
//! use serde::{Serialize, Deserialize};
|
||||
//! use substrate_chain_spec::{ChainSpec, ChainSpecExtension};
|
||||
//! use sc_chain_spec::{ChainSpec, ChainSpecExtension};
|
||||
//!
|
||||
//! #[derive(Clone, Debug, Serialize, Deserialize, ChainSpecExtension)]
|
||||
//! pub struct MyExtension {
|
||||
@@ -49,7 +49,7 @@
|
||||
//!
|
||||
//! ```rust
|
||||
//! use serde::{Serialize, Deserialize};
|
||||
//! use substrate_chain_spec::{Forks, ChainSpec, ChainSpecGroup, ChainSpecExtension};
|
||||
//! use sc_chain_spec::{Forks, ChainSpec, ChainSpecGroup, ChainSpecExtension};
|
||||
//!
|
||||
//! #[derive(Clone, Debug, Serialize, Deserialize, ChainSpecGroup)]
|
||||
//! pub struct ClientParams {
|
||||
@@ -84,7 +84,7 @@
|
||||
//!
|
||||
//! ```rust
|
||||
//! use serde::{Serialize, Deserialize};
|
||||
//! use substrate_chain_spec::{Forks, ChainSpec, ChainSpecGroup, ChainSpecExtension};
|
||||
//! use sc_chain_spec::{Forks, ChainSpec, ChainSpecGroup, ChainSpecExtension};
|
||||
//!
|
||||
//! #[derive(Clone, Debug, Serialize, Deserialize, ChainSpecGroup)]
|
||||
//! pub struct ClientParams {
|
||||
@@ -113,10 +113,10 @@ mod extension;
|
||||
|
||||
pub use chain_spec::{ChainSpec, Properties, NoExtension};
|
||||
pub use extension::{Group, Fork, Forks, Extension};
|
||||
pub use substrate_chain_spec_derive::{ChainSpecExtension, ChainSpecGroup};
|
||||
pub use sc_chain_spec_derive::{ChainSpecExtension, ChainSpecGroup};
|
||||
|
||||
use serde::{Serialize, de::DeserializeOwned};
|
||||
use sr_primitives::BuildStorage;
|
||||
use sp_runtime::BuildStorage;
|
||||
|
||||
/// A set of traits for the runtime genesis config.
|
||||
pub trait RuntimeGenesis: Serialize + DeserializeOwned + BuildStorage {}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "substrate-cli"
|
||||
name = "sc-cli"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
description = "Substrate CLI interface."
|
||||
@@ -21,20 +21,20 @@ futures = { version = "0.3.1", features = ["compat"] }
|
||||
futures01 = "0.1.29"
|
||||
fdlimit = "0.1.1"
|
||||
serde_json = "1.0.41"
|
||||
panic-handler = { package = "substrate-panic-handler", path = "../../primitives/panic-handler" }
|
||||
client-api = { package = "substrate-client-api", path = "../api" }
|
||||
panic-handler = { package = "sp-panic-handler", path = "../../primitives/panic-handler" }
|
||||
client-api = { package = "sc-client-api", path = "../api" }
|
||||
sp-blockchain = { path = "../../primitives/blockchain" }
|
||||
network = { package = "substrate-network", path = "../network" }
|
||||
sr-primitives = { path = "../../primitives/sr-primitives" }
|
||||
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
|
||||
service = { package = "substrate-service", path = "../service", default-features = false }
|
||||
state-machine = { package = "substrate-state-machine", path = "../../primitives/state-machine" }
|
||||
substrate-telemetry = { path = "../telemetry" }
|
||||
keyring = { package = "substrate-keyring", path = "../../primitives/keyring" }
|
||||
network = { package = "sc-network", path = "../network" }
|
||||
sp-runtime = { path = "../../primitives/sr-primitives" }
|
||||
primitives = { package = "sp-core", path = "../../primitives/core" }
|
||||
service = { package = "sc-service", path = "../service", default-features = false }
|
||||
state-machine = { package = "sp-state-machine", path = "../../primitives/state-machine" }
|
||||
sc-telemetry = { path = "../telemetry" }
|
||||
keyring = { package = "sp-keyring", path = "../../primitives/keyring" }
|
||||
names = "0.11.0"
|
||||
structopt = "0.3.3"
|
||||
rpassword = "4.0.1"
|
||||
substrate-tracing = { package = "substrate-tracing", path = "../tracing" }
|
||||
sc-tracing = { package = "sc-tracing", path = "../tracing" }
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = "3.1.0"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
use client_api::BlockchainEvents;
|
||||
use futures::{StreamExt, TryStreamExt, FutureExt, future, compat::Stream01CompatExt};
|
||||
use log::{info, warn};
|
||||
use sr_primitives::traits::Header;
|
||||
use sp_runtime::traits::Header;
|
||||
use service::AbstractService;
|
||||
use std::time::Duration;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ use ansi_term::Colour;
|
||||
use client_api::ClientInfo;
|
||||
use log::info;
|
||||
use network::SyncState;
|
||||
use sr_primitives::traits::{Block as BlockT, CheckedDiv, NumberFor, Zero, Saturating};
|
||||
use sp_runtime::traits::{Block as BlockT, CheckedDiv, NumberFor, Zero, Saturating};
|
||||
use service::NetworkStatus;
|
||||
use std::{convert::{TryFrom, TryInto}, fmt, time};
|
||||
|
||||
|
||||
@@ -63,9 +63,9 @@ use log::info;
|
||||
use lazy_static::lazy_static;
|
||||
use futures::{Future, FutureExt, TryFutureExt};
|
||||
use futures01::{Async, Future as _};
|
||||
use substrate_telemetry::TelemetryEndpoints;
|
||||
use sr_primitives::generic::BlockId;
|
||||
use sr_primitives::traits::Block as BlockT;
|
||||
use sc_telemetry::TelemetryEndpoints;
|
||||
use sp_runtime::generic::BlockId;
|
||||
use sp_runtime::traits::Block as BlockT;
|
||||
|
||||
/// default sub directory to store network config
|
||||
const DEFAULT_NETWORK_CONFIG_PATH : &'static str = "network";
|
||||
@@ -970,8 +970,8 @@ fn init_logger(pattern: &str) {
|
||||
builder.filter(Some("ws"), log::LevelFilter::Off);
|
||||
builder.filter(Some("hyper"), log::LevelFilter::Warn);
|
||||
builder.filter(Some("cranelift_wasm"), log::LevelFilter::Warn);
|
||||
// Always log the special target `substrate_tracing`, overrides global level
|
||||
builder.filter(Some("substrate_tracing"), log::LevelFilter::Info);
|
||||
// Always log the special target `sc_tracing`, overrides global level
|
||||
builder.filter(Some("sc_tracing"), log::LevelFilter::Info);
|
||||
// Enable info for others.
|
||||
builder.filter(None, log::LevelFilter::Info);
|
||||
|
||||
|
||||
@@ -311,12 +311,12 @@ arg_enum! {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<substrate_tracing::TracingReceiver> for TracingReceiver {
|
||||
fn into(self) -> substrate_tracing::TracingReceiver {
|
||||
impl Into<sc_tracing::TracingReceiver> for TracingReceiver {
|
||||
fn into(self) -> sc_tracing::TracingReceiver {
|
||||
match self {
|
||||
TracingReceiver::Log => substrate_tracing::TracingReceiver::Log,
|
||||
TracingReceiver::Telemetry => substrate_tracing::TracingReceiver::Telemetry,
|
||||
TracingReceiver::Grafana => substrate_tracing::TracingReceiver::Grafana,
|
||||
TracingReceiver::Log => sc_tracing::TracingReceiver::Log,
|
||||
TracingReceiver::Telemetry => sc_tracing::TracingReceiver::Telemetry,
|
||||
TracingReceiver::Grafana => sc_tracing::TracingReceiver::Grafana,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,41 +1,41 @@
|
||||
[package]
|
||||
name = "substrate-consensus-aura"
|
||||
name = "sc-consensus-aura"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
description = "Aura consensus algorithm for substrate"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
app-crypto = { package = "substrate-application-crypto", path = "../../../primitives/application-crypto" }
|
||||
aura_primitives = { package = "substrate-consensus-aura-primitives", path = "../../../primitives/consensus/aura" }
|
||||
block-builder-api = { package = "substrate-block-builder-runtime-api", path = "../../../primitives/block-builder/runtime-api" }
|
||||
client = { package = "substrate-client", path = "../../" }
|
||||
client-api = { package = "substrate-client-api", path = "../../api" }
|
||||
app-crypto = { package = "sc-application-crypto", path = "../../../primitives/application-crypto" }
|
||||
aura_primitives = { package = "sp-consensus-aura", path = "../../../primitives/consensus/aura" }
|
||||
block-builder-api = { package = "sp-block-builder", path = "../../../primitives/block-builder/runtime-api" }
|
||||
client = { package = "sc-client", path = "../../" }
|
||||
client-api = { package = "sc-client-api", path = "../../api" }
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0" }
|
||||
consensus_common = { package = "substrate-consensus-common", path = "../../../primitives/consensus/common" }
|
||||
consensus_common = { package = "sp-consensus", path = "../../../primitives/consensus/common" }
|
||||
derive_more = "0.99.2"
|
||||
futures = { version = "0.3.1", features = ["compat"] }
|
||||
futures01 = { package = "futures", version = "0.1" }
|
||||
futures-timer = "0.4.0"
|
||||
inherents = { package = "substrate-inherents", path = "../../../primitives/inherents" }
|
||||
keystore = { package = "substrate-keystore", path = "../../keystore" }
|
||||
inherents = { package = "sp-inherents", path = "../../../primitives/inherents" }
|
||||
keystore = { package = "sc-keystore", path = "../../keystore" }
|
||||
log = "0.4.8"
|
||||
parking_lot = "0.9.0"
|
||||
primitives = { package = "substrate-primitives", path = "../../../primitives/core" }
|
||||
primitives = { package = "sp-core", path = "../../../primitives/core" }
|
||||
sp-blockchain = { path = "../../../primitives/blockchain" }
|
||||
runtime_io = { package = "sr-io", path = "../../../primitives/sr-io" }
|
||||
runtime_version = { package = "sr-version", path = "../../../primitives/sr-version" }
|
||||
slots = { package = "substrate-consensus-slots", path = "../slots" }
|
||||
sr-api = { path = "../../../primitives/sr-api" }
|
||||
sr-primitives = { path = "../../../primitives/sr-primitives" }
|
||||
runtime_io = { package = "sp-io", path = "../../../primitives/sr-io" }
|
||||
runtime_version = { package = "sp-version", path = "../../../primitives/sr-version" }
|
||||
slots = { package = "sc-consensus-slots", path = "../slots" }
|
||||
sp-api = { path = "../../../primitives/sr-api" }
|
||||
sp-runtime = { path = "../../../primitives/sr-primitives" }
|
||||
sp-timestamp = { path = "../../../primitives/timestamp" }
|
||||
substrate-telemetry = { path = "../../telemetry" }
|
||||
sc-telemetry = { path = "../../telemetry" }
|
||||
|
||||
[dev-dependencies]
|
||||
keyring = { package = "substrate-keyring", path = "../../../primitives/keyring" }
|
||||
substrate-executor = { path = "../../executor" }
|
||||
network = { package = "substrate-network", path = "../../network", features = ["test-helpers"]}
|
||||
service = { package = "substrate-service", path = "../../service" }
|
||||
keyring = { package = "sp-keyring", path = "../../../primitives/keyring" }
|
||||
sc-executor = { path = "../../executor" }
|
||||
network = { package = "sc-network", path = "../../network", features = ["test-helpers"]}
|
||||
service = { package = "sc-service", path = "../../service" }
|
||||
test-client = { package = "substrate-test-runtime-client", path = "../../../test/utils/runtime/client" }
|
||||
tokio = "0.1.22"
|
||||
env_logger = "0.7.0"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
use primitives::Pair;
|
||||
use aura_primitives::AURA_ENGINE_ID;
|
||||
use sr_primitives::generic::{DigestItem, OpaqueDigestItemId};
|
||||
use sp_runtime::generic::{DigestItem, OpaqueDigestItemId};
|
||||
use codec::{Encode, Codec};
|
||||
use std::fmt::Debug;
|
||||
|
||||
|
||||
@@ -48,8 +48,8 @@ use sp_blockchain::{
|
||||
|
||||
use block_builder_api::BlockBuilder as BlockBuilderApi;
|
||||
|
||||
use sr_primitives::{generic::{BlockId, OpaqueDigestItemId}, Justification};
|
||||
use sr_primitives::traits::{Block as BlockT, Header, DigestItemFor, ProvideRuntimeApi, Zero, Member};
|
||||
use sp_runtime::{generic::{BlockId, OpaqueDigestItemId}, Justification};
|
||||
use sp_runtime::traits::{Block as BlockT, Header, DigestItemFor, ProvideRuntimeApi, Zero, Member};
|
||||
|
||||
use primitives::crypto::Pair;
|
||||
use inherents::{InherentDataProviders, InherentData};
|
||||
@@ -63,14 +63,14 @@ use sp_timestamp::{
|
||||
TimestampInherentData, InherentType as TimestampInherent, InherentError as TIError
|
||||
};
|
||||
|
||||
use substrate_telemetry::{telemetry, CONSENSUS_TRACE, CONSENSUS_DEBUG, CONSENSUS_INFO};
|
||||
use sc_telemetry::{telemetry, CONSENSUS_TRACE, CONSENSUS_DEBUG, CONSENSUS_INFO};
|
||||
|
||||
use slots::{CheckedHeader, SlotData, SlotWorker, SlotInfo, SlotCompatible};
|
||||
use slots::check_equivocation;
|
||||
|
||||
use keystore::KeyStorePtr;
|
||||
|
||||
use sr_api::ApiExt;
|
||||
use sp_api::ApiExt;
|
||||
|
||||
pub use aura_primitives::{
|
||||
ConsensusLog, AuraApi, AURA_ENGINE_ID,
|
||||
@@ -256,7 +256,7 @@ impl<H, B, C, E, I, P, Error, SO> slots::SimpleSlotWorker<B> for AuraWorker<C, E
|
||||
})
|
||||
}
|
||||
|
||||
fn pre_digest_data(&self, slot_number: u64, _claim: &Self::Claim) -> Vec<sr_primitives::DigestItem<B::Hash>> {
|
||||
fn pre_digest_data(&self, slot_number: u64, _claim: &Self::Claim) -> Vec<sp_runtime::DigestItem<B::Hash>> {
|
||||
vec![
|
||||
<DigestItemFor<B> as CompatibleDigestItem<P>>::aura_pre_digest(slot_number),
|
||||
]
|
||||
@@ -720,7 +720,7 @@ mod tests {
|
||||
use consensus_common::NoNetwork as DummyOracle;
|
||||
use network::test::*;
|
||||
use network::test::{Block as TestBlock, PeersClient, PeersFullClient};
|
||||
use sr_primitives::traits::{Block as BlockT, DigestFor};
|
||||
use sp_runtime::traits::{Block as BlockT, DigestFor};
|
||||
use network::config::ProtocolConfig;
|
||||
use parking_lot::Mutex;
|
||||
use tokio::runtime::current_thread;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "substrate-consensus-babe"
|
||||
name = "sc-consensus-babe"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
description = "BABE consensus algorithm for substrate"
|
||||
@@ -7,27 +7,27 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0", features = ["derive"] }
|
||||
babe_primitives = { package = "substrate-consensus-babe-primitives", path = "../../../primitives/consensus/babe" }
|
||||
primitives = { package = "substrate-primitives", path = "../../../primitives/core" }
|
||||
app-crypto = { package = "substrate-application-crypto", path = "../../../primitives/application-crypto" }
|
||||
babe_primitives = { package = "sp-consensus-babe", path = "../../../primitives/consensus/babe" }
|
||||
primitives = { package = "sp-core", path = "../../../primitives/core" }
|
||||
app-crypto = { package = "sc-application-crypto", path = "../../../primitives/application-crypto" }
|
||||
num-bigint = "0.2.3"
|
||||
num-rational = "0.2.2"
|
||||
num-traits = "0.2.8"
|
||||
runtime-version = { package = "sr-version", path = "../../../primitives/sr-version" }
|
||||
runtime-io = { package = "sr-io", path = "../../../primitives/sr-io" }
|
||||
inherents = { package = "substrate-inherents", path = "../../../primitives/inherents" }
|
||||
runtime-version = { package = "sp-version", path = "../../../primitives/sr-version" }
|
||||
runtime-io = { package = "sp-io", path = "../../../primitives/sr-io" }
|
||||
inherents = { package = "sp-inherents", path = "../../../primitives/inherents" }
|
||||
sp-timestamp = { path = "../../../primitives/timestamp" }
|
||||
substrate-telemetry = { path = "../../telemetry" }
|
||||
keystore = { package = "substrate-keystore", path = "../../keystore" }
|
||||
client-api = { package = "substrate-client-api", path = "../../api" }
|
||||
client = { package = "substrate-client", path = "../../" }
|
||||
sr-api = { path = "../../../primitives/sr-api" }
|
||||
block-builder-api = { package = "substrate-block-builder-runtime-api", path = "../../../primitives/block-builder/runtime-api" }
|
||||
sc-telemetry = { path = "../../telemetry" }
|
||||
keystore = { package = "sc-keystore", path = "../../keystore" }
|
||||
client-api = { package = "sc-client-api", path = "../../api" }
|
||||
client = { package = "sc-client", path = "../../" }
|
||||
sp-api = { path = "../../../primitives/sr-api" }
|
||||
block-builder-api = { package = "sp-block-builder", path = "../../../primitives/block-builder/runtime-api" }
|
||||
sp-blockchain = { path = "../../../primitives/blockchain" }
|
||||
consensus-common = { package = "substrate-consensus-common", path = "../../../primitives/consensus/common" }
|
||||
uncles = { package = "substrate-consensus-uncles", path = "../uncles" }
|
||||
slots = { package = "substrate-consensus-slots", path = "../slots" }
|
||||
sr-primitives = { path = "../../../primitives/sr-primitives" }
|
||||
consensus-common = { package = "sp-consensus", path = "../../../primitives/consensus/common" }
|
||||
uncles = { package = "sc-consensus-uncles", path = "../uncles" }
|
||||
slots = { package = "sc-consensus-slots", path = "../slots" }
|
||||
sp-runtime = { path = "../../../primitives/sr-primitives" }
|
||||
fork-tree = { path = "../../../utils/fork-tree" }
|
||||
futures = { version = "0.3.1", features = ["compat"] }
|
||||
futures01 = { package = "futures", version = "0.1" }
|
||||
@@ -41,12 +41,12 @@ pdqselect = "0.1.0"
|
||||
derive_more = "0.99.2"
|
||||
|
||||
[dev-dependencies]
|
||||
keyring = { package = "substrate-keyring", path = "../../../primitives/keyring" }
|
||||
substrate-executor = { path = "../../executor" }
|
||||
network = { package = "substrate-network", path = "../../network", features = ["test-helpers"]}
|
||||
service = { package = "substrate-service", path = "../../service" }
|
||||
keyring = { package = "sp-keyring", path = "../../../primitives/keyring" }
|
||||
sc-executor = { path = "../../executor" }
|
||||
network = { package = "sc-network", path = "../../network", features = ["test-helpers"]}
|
||||
service = { package = "sc-service", path = "../../service" }
|
||||
test-client = { package = "substrate-test-runtime-client", path = "../../../test/utils/runtime/client" }
|
||||
block-builder = { package = "substrate-block-builder", path = "../../block-builder" }
|
||||
block-builder = { package = "sc-block-builder", path = "../../block-builder" }
|
||||
tokio = "0.1.22"
|
||||
env_logger = "0.7.0"
|
||||
tempfile = "3.1.0"
|
||||
|
||||
@@ -21,7 +21,7 @@ use codec::{Decode, Encode};
|
||||
|
||||
use client_api::backend::AuxStore;
|
||||
use sp_blockchain::{Result as ClientResult, Error as ClientError};
|
||||
use sr_primitives::traits::Block as BlockT;
|
||||
use sp_runtime::traits::Block as BlockT;
|
||||
use babe_primitives::BabeBlockWeight;
|
||||
|
||||
use super::{epoch_changes::EpochChangesFor, SharedEpochChanges};
|
||||
|
||||
@@ -23,7 +23,7 @@ use std::sync::Arc;
|
||||
use babe_primitives::{Epoch, SlotNumber, NextEpochDescriptor};
|
||||
use fork_tree::ForkTree;
|
||||
use parking_lot::{Mutex, MutexGuard};
|
||||
use sr_primitives::traits::{Block as BlockT, NumberFor, One, Zero};
|
||||
use sp_runtime::traits::{Block as BlockT, NumberFor, One, Zero};
|
||||
use codec::{Encode, Decode};
|
||||
use client_api::utils::is_descendent_of;
|
||||
use sp_blockchain::{HeaderMetadata, HeaderBackend, Error as ClientError};
|
||||
|
||||
@@ -69,8 +69,8 @@ use consensus_common::{ImportResult, CanAuthorWith};
|
||||
use consensus_common::import_queue::{
|
||||
BoxJustificationImport, BoxFinalityProofImport,
|
||||
};
|
||||
use sr_primitives::{generic::{BlockId, OpaqueDigestItemId}, Justification};
|
||||
use sr_primitives::traits::{
|
||||
use sp_runtime::{generic::{BlockId, OpaqueDigestItemId}, Justification};
|
||||
use sp_runtime::traits::{
|
||||
Block as BlockT, Header, DigestItemFor, ProvideRuntimeApi,
|
||||
Zero,
|
||||
};
|
||||
@@ -78,7 +78,7 @@ use keystore::KeyStorePtr;
|
||||
use parking_lot::Mutex;
|
||||
use primitives::{Blake2Hasher, H256, Pair};
|
||||
use inherents::{InherentDataProviders, InherentData};
|
||||
use substrate_telemetry::{telemetry, CONSENSUS_TRACE, CONSENSUS_DEBUG};
|
||||
use sc_telemetry::{telemetry, CONSENSUS_TRACE, CONSENSUS_DEBUG};
|
||||
use consensus_common::{
|
||||
self, BlockImport, Environment, Proposer, BlockCheckParams,
|
||||
ForkChoiceStrategy, BlockImportParams, BlockOrigin, Error as ConsensusError,
|
||||
@@ -107,7 +107,7 @@ use sp_blockchain::{
|
||||
};
|
||||
use schnorrkel::SignatureError;
|
||||
|
||||
use sr_api::ApiExt;
|
||||
use sp_api::ApiExt;
|
||||
|
||||
mod aux_schema;
|
||||
mod verification;
|
||||
@@ -411,7 +411,7 @@ impl<B, C, E, I, Error, SO> slots::SimpleSlotWorker<B> for BabeWorker<B, C, E, I
|
||||
s
|
||||
}
|
||||
|
||||
fn pre_digest_data(&self, _slot_number: u64, claim: &Self::Claim) -> Vec<sr_primitives::DigestItem<B::Hash>> {
|
||||
fn pre_digest_data(&self, _slot_number: u64, claim: &Self::Claim) -> Vec<sp_runtime::DigestItem<B::Hash>> {
|
||||
vec![
|
||||
<DigestItemFor<B> as CompatibleDigestItem>::babe_pre_digest(claim.0.clone()),
|
||||
]
|
||||
|
||||
@@ -31,7 +31,7 @@ use consensus_common::import_queue::{
|
||||
use network::test::*;
|
||||
use network::test::{Block as TestBlock, PeersClient};
|
||||
use network::config::BoxFinalityProofRequestBuilder;
|
||||
use sr_primitives::{generic::DigestItem, traits::{Block as BlockT, DigestFor}};
|
||||
use sp_runtime::{generic::DigestItem, traits::{Block as BlockT, DigestFor}};
|
||||
use network::config::ProtocolConfig;
|
||||
use tokio::runtime::current_thread;
|
||||
use client_api::BlockchainEvents;
|
||||
@@ -540,7 +540,7 @@ fn propose_and_import_block(
|
||||
parent_pre_digest.slot_number() + 1
|
||||
});
|
||||
|
||||
let pre_digest = sr_primitives::generic::Digest {
|
||||
let pre_digest = sp_runtime::generic::Digest {
|
||||
logs: vec![
|
||||
Item::babe_pre_digest(
|
||||
BabePreDigest::Secondary {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
//! Verification for BABE headers.
|
||||
use schnorrkel::vrf::{VRFOutput, VRFProof};
|
||||
use sr_primitives::{traits::Header, traits::DigestItemFor};
|
||||
use sp_runtime::{traits::Header, traits::DigestItemFor};
|
||||
use primitives::{Pair, Public};
|
||||
use babe_primitives::{Epoch, BabePreDigest, CompatibleDigestItem, AuthorityId};
|
||||
use babe_primitives::{AuthoritySignature, SlotNumber, AuthorityIndex, AuthorityPair};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "substrate-consensus-pow"
|
||||
name = "sc-consensus-pow"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
description = "PoW consensus algorithm for substrate"
|
||||
@@ -7,14 +7,14 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0", features = ["derive"] }
|
||||
primitives = { package = "substrate-primitives", path = "../../../primitives/core" }
|
||||
primitives = { package = "sp-core", path = "../../../primitives/core" }
|
||||
sp-blockchain = { path = "../../../primitives/blockchain" }
|
||||
sr-primitives = { path = "../../../primitives/sr-primitives" }
|
||||
client-api = { package = "substrate-client-api", path = "../../api" }
|
||||
block-builder-api = { package = "substrate-block-builder-runtime-api", path = "../../../primitives/block-builder/runtime-api" }
|
||||
inherents = { package = "substrate-inherents", path = "../../../primitives/inherents" }
|
||||
pow-primitives = { package = "substrate-consensus-pow-primitives", path = "../../../primitives/consensus/pow" }
|
||||
consensus-common = { package = "substrate-consensus-common", path = "../../../primitives/consensus/common" }
|
||||
sp-runtime = { path = "../../../primitives/sr-primitives" }
|
||||
client-api = { package = "sc-client-api", path = "../../api" }
|
||||
block-builder-api = { package = "sp-block-builder", path = "../../../primitives/block-builder/runtime-api" }
|
||||
inherents = { package = "sp-inherents", path = "../../../primitives/inherents" }
|
||||
pow-primitives = { package = "sp-consensus-pow", path = "../../../primitives/consensus/pow" }
|
||||
consensus-common = { package = "sp-consensus", path = "../../../primitives/consensus/common" }
|
||||
log = "0.4.8"
|
||||
futures = { version = "0.3.1", features = ["compat"] }
|
||||
sp-timestamp = { path = "../../../primitives/timestamp" }
|
||||
|
||||
@@ -35,9 +35,9 @@ use std::collections::HashMap;
|
||||
use client_api::{BlockOf, backend::AuxStore};
|
||||
use sp_blockchain::{HeaderBackend, ProvideCache, well_known_cache_keys::Id as CacheKeyId};
|
||||
use block_builder_api::BlockBuilder as BlockBuilderApi;
|
||||
use sr_primitives::{Justification, RuntimeString};
|
||||
use sr_primitives::generic::{BlockId, Digest, DigestItem};
|
||||
use sr_primitives::traits::{Block as BlockT, Header as HeaderT, ProvideRuntimeApi};
|
||||
use sp_runtime::{Justification, RuntimeString};
|
||||
use sp_runtime::generic::{BlockId, Digest, DigestItem};
|
||||
use sp_runtime::traits::{Block as BlockT, Header as HeaderT, ProvideRuntimeApi};
|
||||
use sp_timestamp::{TimestampInherentData, InherentError as TIError};
|
||||
use pow_primitives::{Seal, TotalDifficulty, POW_ENGINE_ID};
|
||||
use primitives::H256;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "substrate-consensus-slots"
|
||||
name = "sc-consensus-slots"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
description = "Generic slots-based utilities for consensus"
|
||||
@@ -8,13 +8,13 @@ build = "build.rs"
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0" }
|
||||
client-api = { package = "substrate-client-api", path = "../../api" }
|
||||
primitives = { package = "substrate-primitives", path = "../../../primitives/core" }
|
||||
client-api = { package = "sc-client-api", path = "../../api" }
|
||||
primitives = { package = "sp-core", path = "../../../primitives/core" }
|
||||
sp-blockchain = { path = "../../../primitives/blockchain" }
|
||||
sr-primitives = { path = "../../../primitives/sr-primitives" }
|
||||
substrate-telemetry = { path = "../../telemetry" }
|
||||
consensus_common = { package = "substrate-consensus-common", path = "../../../primitives/consensus/common" }
|
||||
inherents = { package = "substrate-inherents", path = "../../../primitives/inherents" }
|
||||
sp-runtime = { path = "../../../primitives/sr-primitives" }
|
||||
sc-telemetry = { path = "../../telemetry" }
|
||||
consensus_common = { package = "sp-consensus", path = "../../../primitives/consensus/common" }
|
||||
inherents = { package = "sp-inherents", path = "../../../primitives/inherents" }
|
||||
futures = "0.3.1"
|
||||
futures-timer = "2.0"
|
||||
parking_lot = "0.9.0"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
use codec::{Encode, Decode};
|
||||
use client_api::backend::AuxStore;
|
||||
use sp_blockchain::{Result as ClientResult, Error as ClientError};
|
||||
use sr_primitives::traits::Header;
|
||||
use sp_runtime::traits::Header;
|
||||
|
||||
const SLOT_HEADER_MAP_KEY: &[u8] = b"slot_header_map";
|
||||
const SLOT_HEADER_START: &[u8] = b"slot_header_start";
|
||||
@@ -153,7 +153,7 @@ pub fn check_equivocation<C, H, P>(
|
||||
mod test {
|
||||
use primitives::{sr25519, Pair};
|
||||
use primitives::hash::H256;
|
||||
use sr_primitives::testing::{Header as HeaderTest, Digest as DigestTest};
|
||||
use sp_runtime::testing::{Header as HeaderTest, Digest as DigestTest};
|
||||
use test_client;
|
||||
|
||||
use super::{MAX_SLOT_CAPACITY, PRUNING_BOUND, check_equivocation};
|
||||
|
||||
@@ -36,10 +36,10 @@ use futures::{prelude::*, future::{self, Either}};
|
||||
use futures_timer::Delay;
|
||||
use inherents::{InherentData, InherentDataProviders};
|
||||
use log::{debug, error, info, warn};
|
||||
use sr_primitives::generic::BlockId;
|
||||
use sr_primitives::traits::{ApiRef, Block as BlockT, Header, ProvideRuntimeApi};
|
||||
use sp_runtime::generic::BlockId;
|
||||
use sp_runtime::traits::{ApiRef, Block as BlockT, Header, ProvideRuntimeApi};
|
||||
use std::{fmt::Debug, ops::Deref, pin::Pin, sync::Arc, time::{Instant, Duration}};
|
||||
use substrate_telemetry::{telemetry, CONSENSUS_DEBUG, CONSENSUS_WARN, CONSENSUS_INFO};
|
||||
use sc_telemetry::{telemetry, CONSENSUS_DEBUG, CONSENSUS_WARN, CONSENSUS_INFO};
|
||||
use parking_lot::Mutex;
|
||||
use client_api;
|
||||
|
||||
@@ -94,7 +94,7 @@ pub trait SimpleSlotWorker<B: BlockT> {
|
||||
) -> Option<Self::Claim>;
|
||||
|
||||
/// Return the pre digest data to include in a block authored with the given claim.
|
||||
fn pre_digest_data(&self, slot_number: u64, claim: &Self::Claim) -> Vec<sr_primitives::DigestItem<B::Hash>>;
|
||||
fn pre_digest_data(&self, slot_number: u64, claim: &Self::Claim) -> Vec<sp_runtime::DigestItem<B::Hash>>;
|
||||
|
||||
/// Returns a function which produces a `BlockImportParams`.
|
||||
fn block_import_params(&self) -> Box<dyn Fn(
|
||||
@@ -218,7 +218,7 @@ pub trait SimpleSlotWorker<B: BlockT> {
|
||||
// deadline our production to approx. the end of the slot
|
||||
let proposing = proposer.propose(
|
||||
slot_info.inherent_data,
|
||||
sr_primitives::generic::Digest {
|
||||
sp_runtime::generic::Digest {
|
||||
logs,
|
||||
},
|
||||
slot_remaining_duration,
|
||||
@@ -448,7 +448,7 @@ impl<T: Clone> SlotDuration<T> {
|
||||
})
|
||||
}),
|
||||
None => {
|
||||
use sr_primitives::traits::Zero;
|
||||
use sp_runtime::traits::Zero;
|
||||
let genesis_slot_duration =
|
||||
cb(client.runtime_api(), &BlockId::number(Zero::zero()))?;
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
[package]
|
||||
name = "substrate-consensus-uncles"
|
||||
name = "sc-consensus-uncles"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
description = "Generic uncle inclusion utilities for consensus"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
client-api = { package = "substrate-client-api", path = "../../api" }
|
||||
primitives = { package = "substrate-primitives", path = "../../../primitives/core" }
|
||||
sr-primitives = { path = "../../../primitives/sr-primitives" }
|
||||
client-api = { package = "sc-client-api", path = "../../api" }
|
||||
primitives = { package = "sp-core", path = "../../../primitives/core" }
|
||||
sp-runtime = { path = "../../../primitives/sr-primitives" }
|
||||
sp-authorship = { path = "../../../primitives/authorship" }
|
||||
consensus_common = { package = "substrate-consensus-common", path = "../../../primitives/consensus/common" }
|
||||
inherents = { package = "substrate-inherents", path = "../../../primitives/inherents" }
|
||||
consensus_common = { package = "sp-consensus", path = "../../../primitives/consensus/common" }
|
||||
inherents = { package = "sp-inherents", path = "../../../primitives/inherents" }
|
||||
log = "0.4.8"
|
||||
|
||||
@@ -23,7 +23,7 @@ use consensus_common::SelectChain;
|
||||
use inherents::{InherentDataProviders};
|
||||
use log::warn;
|
||||
use client_api::ProvideUncles;
|
||||
use sr_primitives::traits::{Block as BlockT, Header};
|
||||
use sp_runtime::traits::{Block as BlockT, Header};
|
||||
use std::sync::Arc;
|
||||
use sp_authorship;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "substrate-client-db"
|
||||
name = "sc-client-db"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
@@ -12,20 +12,20 @@ kvdb-rocksdb = { version = "0.2", optional = true }
|
||||
kvdb-memorydb = "0.1.2"
|
||||
linked-hash-map = "0.5.2"
|
||||
hash-db = "0.15.2"
|
||||
client-api = { package = "substrate-client-api", path = "../api" }
|
||||
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
|
||||
sr-primitives = { path = "../../primitives/sr-primitives" }
|
||||
client = { package = "substrate-client", path = "../" }
|
||||
state-machine = { package = "substrate-state-machine", path = "../../primitives/state-machine" }
|
||||
client-api = { package = "sc-client-api", path = "../api" }
|
||||
primitives = { package = "sp-core", path = "../../primitives/core" }
|
||||
sp-runtime = { path = "../../primitives/sr-primitives" }
|
||||
client = { package = "sc-client", path = "../" }
|
||||
state-machine = { package = "sp-state-machine", path = "../../primitives/state-machine" }
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0", features = ["derive"] }
|
||||
executor = { package = "substrate-executor", path = "../executor" }
|
||||
state_db = { package = "substrate-state-db", path = "../state-db" }
|
||||
trie = { package = "substrate-trie", path = "../../primitives/trie" }
|
||||
consensus_common = { package = "substrate-consensus-common", path = "../../primitives/consensus/common" }
|
||||
executor = { package = "sc-executor", path = "../executor" }
|
||||
state_db = { package = "sc-state-db", path = "../state-db" }
|
||||
trie = { package = "sp-trie", path = "../../primitives/trie" }
|
||||
consensus_common = { package = "sp-consensus", path = "../../primitives/consensus/common" }
|
||||
sp-blockchain = { path = "../../primitives/blockchain" }
|
||||
|
||||
[dev-dependencies]
|
||||
substrate-keyring = { path = "../../primitives/keyring" }
|
||||
sp-keyring = { path = "../../primitives/keyring" }
|
||||
test-client = { package = "substrate-test-runtime-client", path = "../../test/utils/runtime/client" }
|
||||
env_logger = "0.7.0"
|
||||
quickcheck = "0.9"
|
||||
|
||||
+4
-4
@@ -44,7 +44,7 @@ use std::collections::{BTreeSet, BTreeMap};
|
||||
use log::warn;
|
||||
|
||||
use sp_blockchain::{Error as ClientError, Result as ClientResult};
|
||||
use sr_primitives::traits::{
|
||||
use sp_runtime::traits::{
|
||||
Block as BlockT, NumberFor, Zero, Bounded, CheckedSub
|
||||
};
|
||||
|
||||
@@ -651,7 +651,7 @@ pub fn destroy_fork<Block: BlockT, T: CacheItemT, S: Storage<Block, T>, Tx: Stor
|
||||
|
||||
/// Blockchain related functions.
|
||||
mod chain {
|
||||
use sr_primitives::traits::Header as HeaderT;
|
||||
use sp_runtime::traits::Header as HeaderT;
|
||||
use super::*;
|
||||
|
||||
/// Is the block1 connected both ends of the range.
|
||||
@@ -725,8 +725,8 @@ fn read_forks<Block: BlockT, T: CacheItemT, S: Storage<Block, T>>(
|
||||
#[cfg(test)]
|
||||
pub mod tests {
|
||||
use test_client::runtime::H256;
|
||||
use sr_primitives::testing::{Header, Block as RawBlock, ExtrinsicWrapper};
|
||||
use sr_primitives::traits::Header as HeaderT;
|
||||
use sp_runtime::testing::{Header, Block as RawBlock, ExtrinsicWrapper};
|
||||
use sp_runtime::traits::Header as HeaderT;
|
||||
use crate::cache::list_storage::tests::{DummyStorage, FaultyStorage, DummyTransaction};
|
||||
use super::*;
|
||||
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
//! List-cache storage entries.
|
||||
|
||||
use sp_blockchain::Result as ClientResult;
|
||||
use sr_primitives::traits::{Block as BlockT, NumberFor};
|
||||
use sp_runtime::traits::{Block as BlockT, NumberFor};
|
||||
use codec::{Encode, Decode};
|
||||
|
||||
use crate::cache::{CacheItemT, ComplexBlockId};
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@ use kvdb::{KeyValueDB, DBTransaction};
|
||||
|
||||
use sp_blockchain::{Error as ClientError, Result as ClientResult};
|
||||
use codec::{Encode, Decode};
|
||||
use sr_primitives::generic::BlockId;
|
||||
use sr_primitives::traits::{Block as BlockT, Header as HeaderT, NumberFor};
|
||||
use sp_runtime::generic::BlockId;
|
||||
use sp_runtime::traits::{Block as BlockT, Header as HeaderT, NumberFor};
|
||||
use crate::utils::{self, db_err, meta_keys};
|
||||
|
||||
use crate::cache::{CacheItemT, ComplexBlockId};
|
||||
|
||||
Vendored
+2
-2
@@ -24,8 +24,8 @@ use kvdb::{KeyValueDB, DBTransaction};
|
||||
use client_api::blockchain::{well_known_cache_keys::{self, Id as CacheKeyId}, Cache as BlockchainCache};
|
||||
use sp_blockchain::Result as ClientResult;
|
||||
use codec::{Encode, Decode};
|
||||
use sr_primitives::generic::BlockId;
|
||||
use sr_primitives::traits::{Block as BlockT, Header as HeaderT, NumberFor, Zero};
|
||||
use sp_runtime::generic::BlockId;
|
||||
use sp_runtime::traits::{Block as BlockT, Header as HeaderT, NumberFor, Zero};
|
||||
use crate::utils::{self, COLUMN_META, db_err};
|
||||
|
||||
use self::list_cache::{ListCache, PruningStrategy};
|
||||
|
||||
@@ -53,11 +53,11 @@ use trie::{MemoryDB, PrefixedMemoryDB, prefixed_key};
|
||||
use parking_lot::{Mutex, RwLock};
|
||||
use primitives::{H256, Blake2Hasher, ChangesTrieConfiguration, convert_hash, traits::CodeExecutor};
|
||||
use primitives::storage::well_known_keys;
|
||||
use sr_primitives::{
|
||||
use sp_runtime::{
|
||||
generic::{BlockId, DigestItem}, Justification, StorageOverlay, ChildrenStorageOverlay,
|
||||
BuildStorage,
|
||||
};
|
||||
use sr_primitives::traits::{
|
||||
use sp_runtime::traits::{
|
||||
Block as BlockT, Header as HeaderT, NumberFor, Zero, One, SaturatedConversion
|
||||
};
|
||||
use executor::RuntimeInfo;
|
||||
@@ -1561,8 +1561,8 @@ mod tests {
|
||||
use crate::columns;
|
||||
use client_api::backend::{Backend as BTrait, BlockImportOperation as Op};
|
||||
use client::blockchain::Backend as BLBTrait;
|
||||
use sr_primitives::testing::{Header, Block as RawBlock, ExtrinsicWrapper};
|
||||
use sr_primitives::traits::{Hash, BlakeTwo256};
|
||||
use sp_runtime::testing::{Header, Block as RawBlock, ExtrinsicWrapper};
|
||||
use sp_runtime::traits::{Hash, BlakeTwo256};
|
||||
use state_machine::{TrieMut, TrieDBMut, ChangesTrieRootsStorage, ChangesTrieStorage};
|
||||
use sp_blockchain::{lowest_common_ancestor, tree_route};
|
||||
|
||||
@@ -1593,7 +1593,7 @@ mod tests {
|
||||
changes: Vec<(Vec<u8>, Vec<u8>)>,
|
||||
extrinsics_root: H256,
|
||||
) -> H256 {
|
||||
use sr_primitives::testing::Digest;
|
||||
use sp_runtime::testing::Digest;
|
||||
let (changes_root, changes_trie_update) = prepare_changes(changes);
|
||||
let digest = Digest {
|
||||
logs: vec![
|
||||
|
||||
@@ -36,8 +36,8 @@ use sp_blockchain::{
|
||||
use client::light::blockchain::Storage as LightBlockchainStorage;
|
||||
use codec::{Decode, Encode};
|
||||
use primitives::Blake2Hasher;
|
||||
use sr_primitives::generic::{DigestItem, BlockId};
|
||||
use sr_primitives::traits::{Block as BlockT, Header as HeaderT, Zero, One, NumberFor};
|
||||
use sp_runtime::generic::{DigestItem, BlockId};
|
||||
use sp_runtime::traits::{Block as BlockT, Header as HeaderT, Zero, One, NumberFor};
|
||||
use crate::cache::{DbCacheSync, DbCache, ComplexBlockId, EntryType as CacheEntryType};
|
||||
use crate::utils::{self, meta_keys, Meta, db_err, read_db, block_id_to_lookup_key, read_meta};
|
||||
use crate::DatabaseSettings;
|
||||
@@ -560,8 +560,8 @@ fn cht_key<N: TryInto<u32>>(cht_type: u8, block: N) -> ClientResult<[u8; 5]> {
|
||||
#[cfg(test)]
|
||||
pub(crate) mod tests {
|
||||
use client::cht;
|
||||
use sr_primitives::generic::DigestItem;
|
||||
use sr_primitives::testing::{H256 as Hash, Header, Block as RawBlock, ExtrinsicWrapper};
|
||||
use sp_runtime::generic::DigestItem;
|
||||
use sp_runtime::testing::{H256 as Hash, Header, Block as RawBlock, ExtrinsicWrapper};
|
||||
use sp_blockchain::{lowest_common_ancestor, tree_route};
|
||||
use super::*;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ use std::sync::Arc;
|
||||
use parking_lot::{Mutex, RwLock, RwLockUpgradableReadGuard};
|
||||
use linked_hash_map::{LinkedHashMap, Entry};
|
||||
use hash_db::Hasher;
|
||||
use sr_primitives::traits::{Block as BlockT, Header};
|
||||
use sp_runtime::traits::{Block as BlockT, Header};
|
||||
use primitives::hexdisplay::HexDisplay;
|
||||
use state_machine::{backend::Backend as StateBackend, TrieBackend};
|
||||
use log::trace;
|
||||
@@ -596,7 +596,7 @@ impl<H: Hasher, S: StateBackend<H>, B: BlockT> StateBackend<H> for CachingState<
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use sr_primitives::testing::{H256, Block as RawBlock, ExtrinsicWrapper};
|
||||
use sp_runtime::testing::{H256, Block as RawBlock, ExtrinsicWrapper};
|
||||
use state_machine::backend::InMemory;
|
||||
use primitives::Blake2Hasher;
|
||||
|
||||
@@ -844,7 +844,7 @@ mod qc {
|
||||
use quickcheck::{quickcheck, TestResult, Arbitrary};
|
||||
|
||||
use super::*;
|
||||
use sr_primitives::testing::{H256, Block as RawBlock, ExtrinsicWrapper};
|
||||
use sp_runtime::testing::{H256, Block as RawBlock, ExtrinsicWrapper};
|
||||
use state_machine::backend::InMemory;
|
||||
use primitives::Blake2Hasher;
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ use log::debug;
|
||||
|
||||
use codec::Decode;
|
||||
use trie::DBValue;
|
||||
use sr_primitives::generic::BlockId;
|
||||
use sr_primitives::traits::{
|
||||
use sp_runtime::generic::BlockId;
|
||||
use sp_runtime::traits::{
|
||||
Block as BlockT, Header as HeaderT, Zero,
|
||||
UniqueSaturatedFrom, UniqueSaturatedInto,
|
||||
};
|
||||
@@ -184,7 +184,7 @@ pub fn block_id_to_lookup_key<Block>(
|
||||
id: BlockId<Block>
|
||||
) -> Result<Option<Vec<u8>>, sp_blockchain::Error> where
|
||||
Block: BlockT,
|
||||
::sr_primitives::traits::NumberFor<Block>: UniqueSaturatedFrom<u64> + UniqueSaturatedInto<u64>,
|
||||
::sp_runtime::traits::NumberFor<Block>: UniqueSaturatedFrom<u64> + UniqueSaturatedInto<u64>,
|
||||
{
|
||||
let res = match id {
|
||||
BlockId::Number(n) => db.get(
|
||||
@@ -357,7 +357,7 @@ pub fn read_meta<Block>(db: &dyn KeyValueDB, col_meta: Option<u32>, col_header:
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use sr_primitives::testing::{Block as RawBlock, ExtrinsicWrapper};
|
||||
use sp_runtime::testing::{Block as RawBlock, ExtrinsicWrapper};
|
||||
type Block = RawBlock<ExtrinsicWrapper<u32>>;
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "substrate-executor"
|
||||
name = "sc-executor"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
@@ -7,18 +7,18 @@ edition = "2018"
|
||||
[dependencies]
|
||||
derive_more = "0.99.2"
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0" }
|
||||
runtime_io = { package = "sr-io", path = "../../primitives/sr-io" }
|
||||
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
|
||||
trie = { package = "substrate-trie", path = "../../primitives/trie" }
|
||||
serializer = { package = "substrate-serializer", path = "../../primitives/serializer" }
|
||||
runtime_version = { package = "sr-version", path = "../../primitives/sr-version" }
|
||||
panic-handler = { package = "substrate-panic-handler", path = "../../primitives/panic-handler" }
|
||||
runtime_io = { package = "sp-io", path = "../../primitives/sr-io" }
|
||||
primitives = { package = "sp-core", path = "../../primitives/core" }
|
||||
trie = { package = "sp-trie", path = "../../primitives/trie" }
|
||||
serializer = { package = "sp-serializer", path = "../../primitives/serializer" }
|
||||
runtime_version = { package = "sp-version", path = "../../primitives/sr-version" }
|
||||
panic-handler = { package = "sp-panic-handler", path = "../../primitives/panic-handler" }
|
||||
wasmi = "0.6.2"
|
||||
parity-wasm = "0.41.0"
|
||||
lazy_static = "1.4.0"
|
||||
wasm-interface = { package = "substrate-wasm-interface", path = "../../primitives/wasm-interface" }
|
||||
runtime-interface = { package = "substrate-runtime-interface", path = "../../primitives/runtime-interface" }
|
||||
externalities = { package = "substrate-externalities", path = "../../primitives/externalities" }
|
||||
wasm-interface = { package = "sp-wasm-interface", path = "../../primitives/wasm-interface" }
|
||||
runtime-interface = { package = "sp-runtime-interface", path = "../../primitives/runtime-interface" }
|
||||
externalities = { package = "sp-externalities", path = "../../primitives/externalities" }
|
||||
parking_lot = "0.9.0"
|
||||
log = "0.4.8"
|
||||
libsecp256k1 = "0.3.2"
|
||||
@@ -36,12 +36,12 @@ wasmtime-runtime = { version = "0.8", optional = true }
|
||||
assert_matches = "1.3.0"
|
||||
wabt = "0.9.2"
|
||||
hex-literal = "0.2.1"
|
||||
runtime-test = { package = "substrate-runtime-test", path = "runtime-test" }
|
||||
runtime-test = { package = "sc-runtime-test", path = "runtime-test" }
|
||||
test-runtime = { package = "substrate-test-runtime", path = "../../test/utils/runtime" }
|
||||
runtime-interface = { package = "substrate-runtime-interface", path = "../../primitives/runtime-interface" }
|
||||
client-api = { package = "substrate-client-api", path = "../api" }
|
||||
substrate-offchain = { path = "../offchain/" }
|
||||
state_machine = { package = "substrate-state-machine", path = "../../primitives/state-machine" }
|
||||
runtime-interface = { package = "sp-runtime-interface", path = "../../primitives/runtime-interface" }
|
||||
client-api = { package = "sc-client-api", path = "../api" }
|
||||
sc-offchain = { path = "../offchain/" }
|
||||
state_machine = { package = "sp-state-machine", path = "../../primitives/state-machine" }
|
||||
test-case = "0.3.3"
|
||||
|
||||
[features]
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
[package]
|
||||
name = "substrate-runtime-test"
|
||||
name = "sc-runtime-test"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
build = "build.rs"
|
||||
|
||||
[dependencies]
|
||||
rstd = { package = "sr-std", path = "../../../primitives/sr-std", default-features = false }
|
||||
runtime_io = { package = "sr-io", path = "../../../primitives/sr-io", default-features = false }
|
||||
sandbox = { package = "sr-sandbox", path = "../../../primitives/sr-sandbox", default-features = false }
|
||||
primitives = { package = "substrate-primitives", path = "../../../primitives/core", default-features = false }
|
||||
sr-primitives = { package = "sr-primitives", path = "../../../primitives/sr-primitives", default-features = false }
|
||||
rstd = { package = "sp-std", path = "../../../primitives/sr-std", default-features = false }
|
||||
runtime_io = { package = "sp-io", path = "../../../primitives/sr-io", default-features = false }
|
||||
sandbox = { package = "sp-sandbox", path = "../../../primitives/sr-sandbox", default-features = false }
|
||||
primitives = { package = "sp-core", path = "../../../primitives/core", default-features = false }
|
||||
sp-runtime = { package = "sp-runtime", path = "../../../primitives/sr-primitives", default-features = false }
|
||||
|
||||
[build-dependencies]
|
||||
wasm-builder-runner = { package = "substrate-wasm-builder-runner", path = "../../../client/utils/wasm-builder-runner", version = "1.0.4" }
|
||||
|
||||
@@ -14,7 +14,7 @@ use runtime_io::{
|
||||
crypto::{ed25519_verify, sr25519_verify},
|
||||
};
|
||||
#[cfg(not(feature = "std"))]
|
||||
use sr_primitives::{print, traits::{BlakeTwo256, Hash}};
|
||||
use sp_runtime::{print, traits::{BlakeTwo256, Hash}};
|
||||
#[cfg(not(feature = "std"))]
|
||||
use primitives::{ed25519, sr25519};
|
||||
|
||||
|
||||
@@ -79,13 +79,13 @@ impl_wasm_host_interface! {
|
||||
impl SubstrateExternals where context {
|
||||
ext_malloc(size: WordSize) -> Pointer<u8> {
|
||||
let r = context.allocate_memory(size)?;
|
||||
debug_trace!(target: "sr-io", "malloc {} bytes at {:?}", size, r);
|
||||
debug_trace!(target: "sp-io", "malloc {} bytes at {:?}", size, r);
|
||||
Ok(r)
|
||||
}
|
||||
|
||||
ext_free(addr: Pointer<u8>) {
|
||||
context.deallocate_memory(addr)?;
|
||||
debug_trace!(target: "sr-io", "free {:?}", addr);
|
||||
debug_trace!(target: "sp-io", "free {:?}", addr);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ impl<D: NativeExecutionDispatch> CodeExecutor for NativeExecutor<D> {
|
||||
/// # Example
|
||||
///
|
||||
/// ```
|
||||
/// substrate_executor::native_executor_instance!(
|
||||
/// sc_executor::native_executor_instance!(
|
||||
/// pub MyExecutor,
|
||||
/// test_runtime::api::dispatch,
|
||||
/// test_runtime::native_version,
|
||||
@@ -287,7 +287,7 @@ impl<D: NativeExecutionDispatch> CodeExecutor for NativeExecutor<D> {
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
/// substrate_executor::native_executor_instance!(
|
||||
/// sc_executor::native_executor_instance!(
|
||||
/// pub MyExecutor,
|
||||
/// test_runtime::api::dispatch,
|
||||
/// test_runtime::native_version,
|
||||
|
||||
@@ -206,7 +206,7 @@ impl<'a> Sandbox for FunctionExecutor<'a> {
|
||||
return_val_len: WordSize,
|
||||
state: u32,
|
||||
) -> WResult<u32> {
|
||||
trace!(target: "sr-sandbox", "invoke, instance_idx={}", instance_id);
|
||||
trace!(target: "sp-sandbox", "invoke, instance_idx={}", instance_id);
|
||||
|
||||
// Deserialize arguments and convert them into wasmi types.
|
||||
let args = Vec::<sandbox_primitives::TypedValue>::decode(&mut &args[..])
|
||||
|
||||
@@ -283,7 +283,7 @@ impl<'a> Sandbox for FunctionExecutor<'a> {
|
||||
return_val_len: u32,
|
||||
state: u32,
|
||||
) -> WResult<u32> {
|
||||
trace!(target: "sr-sandbox", "invoke, instance_idx={}", instance_id);
|
||||
trace!(target: "sp-sandbox", "invoke, instance_idx={}", instance_id);
|
||||
|
||||
// Deserialize arguments and convert them into wasmi types.
|
||||
let args = Vec::<sandbox_primitives::TypedValue>::decode(&mut &args[..])
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "substrate-finality-grandpa"
|
||||
name = "sc-finality-grandpa"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
@@ -14,29 +14,29 @@ tokio-executor = "0.1.8"
|
||||
tokio-timer = "0.2.11"
|
||||
rand = "0.7.2"
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0", features = ["derive"] }
|
||||
sr-primitives = { path = "../../primitives/sr-primitives" }
|
||||
consensus_common = { package = "substrate-consensus-common", path = "../../primitives/consensus/common" }
|
||||
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
|
||||
substrate-telemetry = { path = "../telemetry" }
|
||||
keystore = { package = "substrate-keystore", path = "../keystore" }
|
||||
sp-runtime = { path = "../../primitives/sr-primitives" }
|
||||
consensus_common = { package = "sp-consensus", path = "../../primitives/consensus/common" }
|
||||
primitives = { package = "sp-core", path = "../../primitives/core" }
|
||||
sc-telemetry = { path = "../telemetry" }
|
||||
keystore = { package = "sc-keystore", path = "../keystore" }
|
||||
serde_json = "1.0.41"
|
||||
client-api = { package = "substrate-client-api", path = "../api" }
|
||||
client = { package = "substrate-client", path = "../" }
|
||||
inherents = { package = "substrate-inherents", path = "../../primitives/inherents" }
|
||||
client-api = { package = "sc-client-api", path = "../api" }
|
||||
client = { package = "sc-client", path = "../" }
|
||||
inherents = { package = "sp-inherents", path = "../../primitives/inherents" }
|
||||
sp-blockchain = { path = "../../primitives/blockchain" }
|
||||
network = { package = "substrate-network", path = "../network" }
|
||||
network = { package = "sc-network", path = "../network" }
|
||||
sp-finality-tracker = { path = "../../primitives/finality-tracker" }
|
||||
fg_primitives = { package = "substrate-finality-grandpa-primitives", path = "../../primitives/finality-grandpa" }
|
||||
fg_primitives = { package = "sp-finality-granpda", path = "../../primitives/finality-grandpa" }
|
||||
grandpa = { package = "finality-grandpa", version = "0.10.1", features = ["derive-codec"] }
|
||||
|
||||
[dev-dependencies]
|
||||
grandpa = { package = "finality-grandpa", version = "0.10.1", features = ["derive-codec", "test-helpers"] }
|
||||
network = { package = "substrate-network", path = "../network", features = ["test-helpers"] }
|
||||
keyring = { package = "substrate-keyring", path = "../../primitives/keyring" }
|
||||
network = { package = "sc-network", path = "../network", features = ["test-helpers"] }
|
||||
keyring = { package = "sp-keyring", path = "../../primitives/keyring" }
|
||||
test-client = { package = "substrate-test-runtime-client", path = "../../test/utils/runtime/client"}
|
||||
babe_primitives = { package = "substrate-consensus-babe-primitives", path = "../../primitives/consensus/babe" }
|
||||
state_machine = { package = "substrate-state-machine", path = "../../primitives/state-machine" }
|
||||
babe_primitives = { package = "sp-consensus-babe", path = "../../primitives/consensus/babe" }
|
||||
state_machine = { package = "sp-state-machine", path = "../../primitives/state-machine" }
|
||||
env_logger = "0.7.0"
|
||||
tokio = "0.1.22"
|
||||
tempfile = "3.1.0"
|
||||
sr-api = { path = "../../primitives/sr-api" }
|
||||
sp-api = { path = "../../primitives/sr-api" }
|
||||
|
||||
@@ -21,7 +21,7 @@ use parking_lot::RwLock;
|
||||
use grandpa::voter_set::VoterSet;
|
||||
use codec::{Encode, Decode};
|
||||
use log::{debug, info};
|
||||
use substrate_telemetry::{telemetry, CONSENSUS_INFO};
|
||||
use sc_telemetry::{telemetry, CONSENSUS_INFO};
|
||||
use fg_primitives::{AuthorityId, AuthorityList};
|
||||
|
||||
use std::cmp::Ord;
|
||||
|
||||
@@ -23,7 +23,7 @@ use client_api::backend::AuxStore;
|
||||
use sp_blockchain::{Result as ClientResult, Error as ClientError};
|
||||
use fork_tree::ForkTree;
|
||||
use grandpa::round::State as RoundState;
|
||||
use sr_primitives::traits::{Block as BlockT, NumberFor};
|
||||
use sp_runtime::traits::{Block as BlockT, NumberFor};
|
||||
use log::{info, warn};
|
||||
use fg_primitives::{AuthorityList, SetId, RoundNumber};
|
||||
|
||||
|
||||
@@ -82,13 +82,13 @@
|
||||
//!
|
||||
//! We only send polite messages to peers,
|
||||
|
||||
use sr_primitives::traits::{NumberFor, Block as BlockT, Zero};
|
||||
use sp_runtime::traits::{NumberFor, Block as BlockT, Zero};
|
||||
use network::consensus_gossip::{self as network_gossip, MessageIntent, ValidatorContext};
|
||||
use network::{config::Roles, PeerId};
|
||||
use codec::{Encode, Decode};
|
||||
use fg_primitives::AuthorityId;
|
||||
|
||||
use substrate_telemetry::{telemetry, CONSENSUS_DEBUG};
|
||||
use sc_telemetry::{telemetry, CONSENSUS_DEBUG};
|
||||
use log::{trace, debug, warn};
|
||||
use futures::prelude::*;
|
||||
use futures::sync::mpsc;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user