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
+2 -2
View File
@@ -75,7 +75,7 @@ impl<Storage: OffchainStorage> OffchainExt for Api<Storage> {
let external_addresses = self.network_state.external_addresses();
let state = NetworkState::new(
self.network_state.peer_id(),
self.network_state.local_peer_id(),
external_addresses,
);
Ok(OpaqueNetworkState::from(state))
@@ -292,7 +292,7 @@ mod tests {
Vec::new()
}
fn peer_id(&self) -> PeerId {
fn local_peer_id(&self) -> PeerId {
PeerId::random()
}
}