mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 14:37:57 +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
@@ -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(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user