Use sc_network::NetworkStateInfo instead of implementing redundant traits (#4436)

* Implement local_peer_id for gossip

* refactor local_peer_id

* fix

* reset gossip

* Update tests.rs

* fix ci

* fix review

* fix Cargo.lock

* fix Cargo.lock
This commit is contained in:
Weiliang Li
2019-12-25 00:17:19 +09:00
committed by Gavin Wood
parent 901dff5d14
commit fe587c72ec
8 changed files with 397 additions and 381 deletions
@@ -45,8 +45,7 @@ struct TestNetwork {
}
impl sc_network_gossip::Network<Block> for TestNetwork {
fn event_stream(&self)
-> Box<dyn futures::Stream<Item = NetworkEvent, Error = ()> + Send> {
fn event_stream(&self) -> Box<dyn futures::Stream<Item = NetworkEvent, Error = ()> + Send> {
let (tx, rx) = mpsc::unbounded();
let _ = self.sender.unbounded_send(Event::EventStream(tx));
Box::new(rx)