fix for latest substrate crate renaming (#641)

* rename crates as appropriate

* Rename to use master - easy to revert, but shows it's working

* Bump runtime version

* Bump version

* Bump Substrate again
This commit is contained in:
Benjamin Kampmann
2019-12-02 16:56:50 +01:00
committed by Gavin Wood
parent 0c1ef33541
commit 7832ad93cd
50 changed files with 1741 additions and 1741 deletions
+2 -2
View File
@@ -19,7 +19,7 @@
use codec::{Encode, Decode};
use polkadot_primitives::Hash;
use polkadot_primitives::parachain::{CollatorId, Id as ParaId, Collation};
use substrate_network::PeerId;
use sc_network::PeerId;
use futures::sync::oneshot;
use std::collections::hash_map::{HashMap, Entry};
@@ -226,7 +226,7 @@ impl CollatorPool {
#[cfg(test)]
mod tests {
use super::*;
use substrate_primitives::crypto::UncheckedInto;
use sp_core::crypto::UncheckedInto;
use polkadot_primitives::parachain::{
CandidateReceipt, BlockData, PoVBlock, HeadData, ConsolidatedIngress,
};
+8 -8
View File
@@ -49,10 +49,10 @@
//! Peers who send information which was not allowed under a recent neighbor packet
//! will be noted as non-beneficial to Substrate's peer-set management utility.
use sr_primitives::{generic::BlockId, traits::ProvideRuntimeApi};
use sp_runtime::{generic::BlockId, traits::ProvideRuntimeApi};
use sp_blockchain::Error as ClientError;
use substrate_network::{config::Roles, PeerId};
use substrate_network::consensus_gossip::{
use sc_network::{config::Roles, PeerId};
use sc_network::consensus_gossip::{
self as network_gossip, ValidationResult as GossipValidationResult,
ValidatorContext, MessageIntent, ConsensusMessage,
};
@@ -78,7 +78,7 @@ mod attestation;
mod message_routing;
/// The engine ID of the polkadot attestation system.
pub const POLKADOT_ENGINE_ID: sr_primitives::ConsensusEngineId = *b"dot1";
pub const POLKADOT_ENGINE_ID: sp_runtime::ConsensusEngineId = *b"dot1";
// arbitrary; in practice this should not be more than 2.
pub(crate) const MAX_CHAIN_HEADS: usize = 5;
@@ -330,7 +330,7 @@ impl NewLeafActions {
pub fn perform(
self,
gossip: &mut dyn crate::GossipService,
ctx: &mut dyn substrate_network::Context<Block>,
ctx: &mut dyn sc_network::Context<Block>,
) {
for action in self.actions {
match action {
@@ -655,12 +655,12 @@ impl<C: ChainContext + ?Sized> network_gossip::Validator<Block> for MessageValid
#[cfg(test)]
mod tests {
use super::*;
use substrate_network::consensus_gossip::Validator as ValidatorT;
use sc_network::consensus_gossip::Validator as ValidatorT;
use std::sync::mpsc;
use parking_lot::Mutex;
use polkadot_primitives::parachain::{CandidateReceipt, HeadData};
use substrate_primitives::crypto::UncheckedInto;
use substrate_primitives::sr25519::{Public as Sr25519Public, Signature as Sr25519Signature};
use sp_core::crypto::UncheckedInto;
use sp_core::sr25519::{Public as Sr25519Public, Signature as Sr25519Signature};
use polkadot_validation::GenericStatement;
use super::message_routing::queue_topic;
+1 -1
View File
@@ -30,7 +30,7 @@
//! a `Candidate` we are aware of. Otherwise, it is possible we could be forced to
//! consider an infinite amount of attestations produced by a misbehaving validator.
use substrate_network::consensus_gossip::{ValidationResult as GossipValidationResult};
use sc_network::consensus_gossip::{ValidationResult as GossipValidationResult};
use polkadot_validation::GenericStatement;
use polkadot_primitives::Hash;
@@ -60,7 +60,7 @@
//! We prune messages that are not un-routed from the view of any leaf and cease
//! to attempt to send them to any peer.
use sr_primitives::traits::{BlakeTwo256, Hash as HashT};
use sp_runtime::traits::{BlakeTwo256, Hash as HashT};
use polkadot_primitives::Hash;
use std::collections::{HashMap, HashSet};
use sp_blockchain::Error as ClientError;
+4 -4
View File
@@ -34,11 +34,11 @@ use polkadot_primitives::parachain::{
Id as ParaId, BlockData, CollatorId, CandidateReceipt, Collation, PoVBlock,
StructuredUnroutedIngress, ValidatorId, OutgoingMessages,
};
use substrate_network::{
use sc_network::{
PeerId, RequestId, Context, StatusMessage as GenericFullStatus,
specialization::NetworkSpecialization as Specialization,
};
use substrate_network::consensus_gossip::{
use sc_network::consensus_gossip::{
self, TopicNotification, MessageRecipient as GossipMessageRecipient, ConsensusMessage,
};
use self::validation::{LiveValidationLeaves, RecentValidatorIds, InsertedRecentKey};
@@ -76,7 +76,7 @@ mod benefit {
type FullStatus = GenericFullStatus<Block>;
/// Specialization of the network service for the polkadot protocol.
pub type PolkadotNetworkService = substrate_network::NetworkService<Block, PolkadotProtocol, Hash>;
pub type PolkadotNetworkService = sc_network::NetworkService<Block, PolkadotProtocol, Hash>;
/// Basic functionality that a network has to fulfill.
pub trait NetworkService: Send + Sync + 'static {
@@ -588,7 +588,7 @@ impl Specialization<Block> for PolkadotProtocol {
let local_status = Status::decode(&mut &status.chain_status[..])
.unwrap_or_else(|_| Status { collating_for: None });
let validator = status.roles.contains(substrate_network::config::Roles::AUTHORITY);
let validator = status.roles.contains(sc_network::config::Roles::AUTHORITY);
let mut peer_info = PeerInfo {
collating_for: local_status.collating_for.clone(),
+1 -1
View File
@@ -128,7 +128,7 @@ impl<C: Clone> LocalCollations<C> {
#[cfg(test)]
mod tests {
use super::*;
use substrate_primitives::crypto::UncheckedInto;
use sp_core::crypto::UncheckedInto;
use polkadot_primitives::parachain::ValidatorId;
#[test]
+1 -1
View File
@@ -23,7 +23,7 @@
//! the `TableRouter` trait from `polkadot-validation`, which is expected to call into a shared statement table
//! and dispatch evaluation work as necessary when new statements come in.
use sr_primitives::traits::{ProvideRuntimeApi, BlakeTwo256, Hash as HashT};
use sp_runtime::traits::{ProvideRuntimeApi, BlakeTwo256, Hash as HashT};
use polkadot_validation::{
SharedTable, TableRouter, SignedStatement, GenericStatement, ParachainWork, Validated
};
+2 -2
View File
@@ -26,9 +26,9 @@ use polkadot_primitives::parachain::{
CandidateReceipt, HeadData, PoVBlock, BlockData, CollatorId, ValidatorId,
StructuredUnroutedIngress
};
use substrate_primitives::crypto::UncheckedInto;
use sp_core::crypto::UncheckedInto;
use codec::Encode;
use substrate_network::{
use sc_network::{
PeerId, Context, config::Roles, message::generic::ConsensusMessage,
specialization::NetworkSpecialization,
};
+7 -7
View File
@@ -19,10 +19,10 @@
#![allow(unused)]
use crate::gossip::GossipMessage;
use substrate_network::Context as NetContext;
use substrate_network::consensus_gossip::TopicNotification;
use substrate_primitives::{NativeOrEncoded, ExecutionContext};
use substrate_keyring::Sr25519Keyring;
use sc_network::Context as NetContext;
use sc_network::consensus_gossip::TopicNotification;
use sp_core::{NativeOrEncoded, ExecutionContext};
use sp_keyring::Sr25519Keyring;
use crate::{GossipService, PolkadotProtocol, NetworkService, GossipMessageStream};
use polkadot_validation::{SharedTable, Network};
@@ -34,8 +34,8 @@ use polkadot_primitives::parachain::{
};
use parking_lot::Mutex;
use sp_blockchain::Result as ClientResult;
use sr_api::{Core, RuntimeVersion, StorageProof, ApiExt};
use sr_primitives::traits::{ApiRef, ProvideRuntimeApi};
use sp_api::{Core, RuntimeVersion, StorageProof, ApiExt};
use sp_runtime::traits::{ApiRef, ProvideRuntimeApi};
use std::collections::HashMap;
use std::sync::Arc;
@@ -401,7 +401,7 @@ impl IngressBuilder {
fn make_table(data: &ApiData, local_key: &Sr25519Keyring, parent_hash: Hash) -> Arc<SharedTable> {
use av_store::Store;
use substrate_primitives::crypto::Pair;
use sp_core::crypto::Pair;
let sr_pair = local_key.pair();
let local_key = polkadot_primitives::parachain::ValidatorPair::from(local_key.pair());
+3 -3
View File
@@ -19,8 +19,8 @@
//! This fulfills the `polkadot_validation::Network` trait, providing a hook to be called
//! each time validation leaf work begins on a new chain head.
use sr_primitives::traits::ProvideRuntimeApi;
use substrate_network::PeerId;
use sp_runtime::traits::ProvideRuntimeApi;
use sc_network::PeerId;
use polkadot_validation::{
Network as ParachainNetwork, SharedTable, Collators, Statement, GenericStatement, SignedStatement,
};
@@ -706,7 +706,7 @@ impl<P: ProvideRuntimeApi + Send, E, N, T> LeafWorkDataFetcher<P, E, N, T> where
#[cfg(test)]
mod tests {
use super::*;
use substrate_primitives::crypto::UncheckedInto;
use sp_core::crypto::UncheckedInto;
#[test]
fn last_keys_works() {