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
+1 -1
View File
@@ -27,7 +27,7 @@ use libp2p::kad::record;
use libp2p::swarm::{NetworkBehaviourAction, NetworkBehaviourEventProcess};
use libp2p::core::{nodes::Substream, muxing::StreamMuxerBox};
use log::{debug, warn};
use sr_primitives::traits::Block as BlockT;
use sp_runtime::traits::Block as BlockT;
use std::iter;
use void;
+3 -3
View File
@@ -20,9 +20,9 @@ use client::Client as SubstrateClient;
use sp_blockchain::Error;
use client_api::{ChangesProof, StorageProof, ClientInfo, CallExecutor};
use consensus::{BlockImport, BlockStatus, Error as ConsensusError};
use sr_primitives::traits::{Block as BlockT, Header as HeaderT};
use sr_primitives::generic::{BlockId};
use sr_primitives::Justification;
use sp_runtime::traits::{Block as BlockT, Header as HeaderT};
use sp_runtime::generic::{BlockId};
use sp_runtime::Justification;
use primitives::{H256, Blake2Hasher, storage::StorageKey};
/// Local client abstraction for the network.
+2 -2
View File
@@ -27,7 +27,7 @@ use crate::on_demand_layer::OnDemand;
use crate::service::{ExHashT, TransactionPool};
use bitflags::bitflags;
use consensus::{block_validation::BlockAnnounceValidator, import_queue::ImportQueue};
use sr_primitives::traits::{Block as BlockT};
use sp_runtime::traits::{Block as BlockT};
use libp2p::identity::{Keypair, ed25519};
use libp2p::wasm_ext;
use libp2p::{PeerId, Multiaddr, multiaddr};
@@ -171,7 +171,7 @@ impl ProtocolId {
/// # Example
///
/// ```
/// # use substrate_network::{Multiaddr, PeerId, config::parse_str_addr};
/// # use sc_network::{Multiaddr, PeerId, config::parse_str_addr};
/// let (peer_id, addr) = parse_str_addr(
/// "/ip4/198.51.100.19/tcp/30333/p2p/QmSk5HQbn6LhUwDiNMseVUjuRYhEtYj4aUZ6WfWoGURpdV"
/// ).unwrap();
+3 -3
View File
@@ -118,7 +118,7 @@
//! if necessary and open a unique substream for Substrate-based communications. If the PSM decides
//! that we should disconnect a node, then that substream is closed.
//!
//! For more information about the PSM, see the *substrate-peerset* crate.
//! For more information about the PSM, see the *sc-peerset* crate.
//!
//! Note that at the moment there is no mechanism in place to solve the issues that arise where the
//! two sides of a connection open the unique substream simultaneously. In order to not run into
@@ -151,7 +151,7 @@
//!
//! # Usage
//!
//! Using the `substrate-network` crate is done through the [`NetworkWorker`] struct. Create this
//! Using the `sc-network` crate is done through the [`NetworkWorker`] struct. Create this
//! struct by passing a [`config::Params`], then poll it as if it was a `Future`. You can extract an
//! `Arc<NetworkService>` from the `NetworkWorker`, which can be shared amongst multiple places
//! in order to give orders to the networking.
@@ -202,7 +202,7 @@ pub use on_demand_layer::{OnDemand, RemoteResponse};
// Used by the `construct_simple_protocol!` macro.
#[doc(hidden)]
pub use sr_primitives::traits::Block as BlockT;
pub use sp_runtime::traits::Block as BlockT;
use libp2p::core::ConnectedPoint;
use serde::{Deserialize, Serialize};
@@ -26,7 +26,7 @@ use sp_blockchain::Error as ClientError;
use client_api::{Fetcher, FetchChecker, RemoteHeaderRequest,
RemoteCallRequest, RemoteReadRequest, RemoteChangesRequest,
RemoteReadChildRequest, RemoteBodyRequest};
use sr_primitives::traits::{Block as BlockT, Header as HeaderT, NumberFor};
use sp_runtime::traits::{Block as BlockT, Header as HeaderT, NumberFor};
/// Implements the `Fetcher` trait of the client. Makes it possible for the light client to perform
/// network requests for some state.
+3 -3
View File
@@ -31,11 +31,11 @@ use consensus::{
import_queue::{BlockImportResult, BlockImportError, IncomingBlock, Origin}
};
use codec::{Decode, Encode};
use sr_primitives::{generic::BlockId, ConsensusEngineId, Justification};
use sr_primitives::traits::{
use sp_runtime::{generic::BlockId, ConsensusEngineId, Justification};
use sp_runtime::traits::{
Block as BlockT, Header as HeaderT, NumberFor, One, Zero, CheckedSub
};
use sr_arithmetic::traits::SaturatedConversion;
use sp_arithmetic::traits::SaturatedConversion;
use message::{BlockAnnounce, BlockAttributes, Direction, FromBlock, Message, RequestId};
use message::generic::{Message as GenericMessage, ConsensusMessage};
use consensus_gossip::{ConsensusGossip, MessageRecipient as GossipMessageRecipient};
@@ -51,8 +51,8 @@ use log::{trace, debug};
use futures03::channel::mpsc;
use lru::LruCache;
use libp2p::PeerId;
use sr_primitives::traits::{Block as BlockT, Hash, HashFor};
use sr_primitives::ConsensusEngineId;
use sp_runtime::traits::{Block as BlockT, Hash, HashFor};
use sp_runtime::ConsensusEngineId;
pub use crate::message::generic::{Message, ConsensusMessage};
use crate::protocol::Context;
use crate::config::Roles;
@@ -632,7 +632,7 @@ impl<B: BlockT> Validator<B> for DiscardAll {
#[cfg(test)]
mod tests {
use std::sync::Arc;
use sr_primitives::testing::{H256, Block as RawBlock, ExtrinsicWrapper};
use sp_runtime::testing::{H256, Block as RawBlock, ExtrinsicWrapper};
use futures03::executor::block_on_stream;
use super::*;
@@ -32,7 +32,7 @@ use client_api::{FetchChecker, RemoteHeaderRequest,
use crate::message::{self, BlockAttributes, Direction, FromBlock, RequestId};
use libp2p::PeerId;
use crate::config::Roles;
use sr_primitives::traits::{Block as BlockT, Header as HeaderT, NumberFor};
use sp_runtime::traits::{Block as BlockT, Header as HeaderT, NumberFor};
/// Remote request timeout.
const REQUEST_TIMEOUT: Duration = Duration::from_secs(15);
@@ -676,7 +676,7 @@ pub mod tests {
use std::sync::Arc;
use std::time::Instant;
use futures::{Future, sync::oneshot};
use sr_primitives::traits::{Block as BlockT, NumberFor, Header as HeaderT};
use sp_runtime::traits::{Block as BlockT, NumberFor, Header as HeaderT};
use sp_blockchain::{Error as ClientError, Result as ClientResult};
use client_api::{FetchChecker, RemoteHeaderRequest,
ChangesProof, RemoteCallRequest, RemoteReadRequest,
@@ -17,7 +17,7 @@
//! Network packet message types. These get serialized and put into the lower level protocol payload.
use bitflags::bitflags;
use sr_primitives::{ConsensusEngineId, traits::{Block as BlockT, Header as HeaderT}};
use sp_runtime::{ConsensusEngineId, traits::{Block as BlockT, Header as HeaderT}};
use codec::{Encode, Decode, Input, Output, Error};
pub use self::generic::{
BlockAnnounce, RemoteCallRequest, RemoteReadRequest,
@@ -138,7 +138,7 @@ pub struct RemoteReadResponse {
/// Generic types.
pub mod generic {
use codec::{Encode, Decode, Input, Output};
use sr_primitives::Justification;
use sp_runtime::Justification;
use crate::config::Roles;
use super::{
RemoteReadResponse, Transactions, Direction,
@@ -20,7 +20,7 @@ pub use crate::protocol::event::{DhtEvent, Event};
use crate::protocol::Context;
use libp2p::PeerId;
use sr_primitives::traits::Block as BlockT;
use sp_runtime::traits::Block as BlockT;
/// A specialization of the substrate network protocol. Handles events and sends messages.
pub trait NetworkSpecialization<B: BlockT>: Send + Sync + 'static {
@@ -43,7 +43,7 @@ use either::Either;
use extra_requests::ExtraRequests;
use libp2p::PeerId;
use log::{debug, trace, warn, info, error};
use sr_primitives::{
use sp_runtime::{
Justification,
generic::BlockId,
traits::{Block as BlockT, Header, NumberFor, Zero, One, CheckedSub, SaturatedConversion}
@@ -21,7 +21,7 @@ use std::collections::{HashMap, BTreeMap};
use std::collections::hash_map::Entry;
use log::trace;
use libp2p::PeerId;
use sr_primitives::traits::{Block as BlockT, NumberFor, One};
use sp_runtime::traits::{Block as BlockT, NumberFor, One};
use crate::message;
/// Block data with origin.
@@ -215,7 +215,7 @@ impl<B: BlockT> BlockCollection<B> {
mod test {
use super::{BlockCollection, BlockData, BlockRangeState};
use crate::{message, PeerId};
use sr_primitives::testing::{Block as RawBlock, ExtrinsicWrapper};
use sp_runtime::testing::{Block as RawBlock, ExtrinsicWrapper};
use primitives::H256;
type Block = RawBlock<ExtrinsicWrapper<u64>>;
@@ -19,7 +19,7 @@ use crate::protocol::sync::{PeerSync, PeerSyncState};
use fork_tree::ForkTree;
use libp2p::PeerId;
use log::{debug, warn};
use sr_primitives::traits::{Block as BlockT, NumberFor, Zero};
use sp_runtime::traits::{Block as BlockT, NumberFor, Zero};
use std::collections::{HashMap, HashSet, VecDeque};
use std::time::{Duration, Instant};
+3 -3
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
//! Main entry point of the substrate-network crate.
//! Main entry point of the sc-network crate.
//!
//! There are two main structs in this module: [`NetworkWorker`] and [`NetworkService`].
//! The [`NetworkWorker`] *is* the network and implements the `Future` trait. It must be polled in
@@ -38,7 +38,7 @@ use libp2p::core::{transport::boxed::Boxed, muxing::StreamMuxerBox};
use libp2p::swarm::NetworkBehaviour;
use parking_lot::Mutex;
use peerset::PeersetHandle;
use sr_primitives::{traits::{Block as BlockT, NumberFor}, ConsensusEngineId};
use sp_runtime::{traits::{Block as BlockT, NumberFor}, ConsensusEngineId};
use crate::{behaviour::{Behaviour, BehaviourOut}, config::{parse_str_addr, parse_addr}};
use crate::{NetworkState, NetworkStateNotConnectedPeer, NetworkStatePeer};
@@ -607,7 +607,7 @@ pub trait NetworkStateInfo {
impl<B, S, H> NetworkStateInfo for NetworkService<B, S, H>
where
B: sr_primitives::traits::Block,
B: sp_runtime::traits::Block,
S: NetworkSpecialization<B>,
H: ExHashT,
{
@@ -22,7 +22,7 @@ use consensus::import_queue::{
};
use test_client::{self, prelude::*};
use test_client::runtime::{Block, Hash};
use sr_primitives::generic::BlockId;
use sp_runtime::generic::BlockId;
use super::*;
fn prepare_good_block() -> (TestClient, Hash, u64, PeerId, IncomingBlock<Block>) {
+3 -3
View File
@@ -55,9 +55,9 @@ use libp2p::PeerId;
use parking_lot::Mutex;
use primitives::H256;
use crate::protocol::{Context, ProtocolConfig};
use sr_primitives::generic::{BlockId, OpaqueDigestItemId};
use sr_primitives::traits::{Block as BlockT, Header, NumberFor};
use sr_primitives::Justification;
use sp_runtime::generic::{BlockId, OpaqueDigestItemId};
use sp_runtime::traits::{Block as BlockT, Header, NumberFor};
use sp_runtime::Justification;
use crate::service::TransactionPool;
use crate::specialization::NetworkSpecialization;
use test_client::{self, AccountKeyring};