Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Undo networking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
expenses committed Jun 2, 2020
1 parent 829ede3 commit 4256d83
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 1 addition & 2 deletions network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ exit-future = "0.2.0"
futures-timer = "2.0"
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" }
wasm-timer = "0.2.4"

[dev-dependencies]

sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "master" }
1 change: 1 addition & 0 deletions network/src/legacy/gossip/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ pub struct NewLeafActions {
}

impl NewLeafActions {
#[cfg(test)]
pub fn new() -> Self {
NewLeafActions { actions: Vec::new() }
}
Expand Down
5 changes: 4 additions & 1 deletion network/src/protocol/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ pub const POLKADOT_PROTOCOL_NAME: &[u8] = b"/polkadot/1";

pub use crate::legacy::gossip::ChainContext;

pub mod tests;
#[cfg(test)]
mod tests;

// Messages from the service API or network adapter.
enum ServiceToWorkerMsg {
Expand Down Expand Up @@ -118,6 +119,7 @@ enum ServiceToWorkerMsg {
/// Used in tests to ensure that all other messages sent from the same
/// thread have been flushed. Also executes arbitrary logic with the protocl
/// handler.
#[cfg(test)]
Synchronize(Box<dyn FnOnce(&mut ProtocolHandler) + Send>),
}

Expand Down Expand Up @@ -1006,6 +1008,7 @@ impl<Api, Sp, Gossip> Worker<Api, Sp, Gossip> where

let _ = sender.send(checked_messages);
}
#[cfg(test)]
ServiceToWorkerMsg::Synchronize(callback) => {
(callback)(&mut self.protocol_handler)
}
Expand Down
2 changes: 1 addition & 1 deletion network/src/protocol/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct Recorded {
type GossipStreamEntry = (mpsc::UnboundedReceiver<TopicNotification>, oneshot::Sender<()>);

#[derive(Default, Clone)]
pub struct MockGossip {
struct MockGossip {
inner: Arc<Mutex<HashMap<Hash, GossipStreamEntry>>>,
gossip_messages: Arc<Mutex<HashMap<Hash, GossipMessage>>>,
}
Expand Down

0 comments on commit 4256d83

Please sign in to comment.