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:
Benjamin Kampmann
2019-12-02 11:23:53 +01:00
committed by GitHub
parent 40f6d05a4c
commit 927e13c13a
468 changed files with 3383 additions and 3271 deletions
+32 -32
View File
@@ -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",
]
+3 -3
View File
@@ -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"),
+1 -1
View File
@@ -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() {
+1 -1
View File
@@ -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.
+5 -5
View File
@@ -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 {
+8 -8
View File
@@ -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(()))
+2 -2
View File
@@ -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;
+13 -13
View File
@@ -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(),
};