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

Commit

Permalink
Merge remote-tracking branch 'origin/master' into gpestana/13069-nomi…
Browse files Browse the repository at this point in the history
…nation-staking-rpc-methods
  • Loading branch information
parity-processbot committed Feb 20, 2023
2 parents eb28218 + 76208c8 commit 28b1434
Show file tree
Hide file tree
Showing 15 changed files with 924 additions and 757 deletions.
4 changes: 4 additions & 0 deletions client/authority-discovery/src/worker/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ impl NetworkStateInfo for TestNetwork {
fn external_addresses(&self) -> Vec<Multiaddr> {
self.external_addresses.clone()
}

fn listen_addresses(&self) -> Vec<Multiaddr> {
self.external_addresses.clone()
}
}

struct TestSigner<'a> {
Expand Down
11 changes: 9 additions & 2 deletions client/network/common/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ pub trait NetworkPeers {
/// purposes.
fn deny_unreserved_peers(&self);

/// Adds a `PeerId` and its `Multiaddr` as reserved.
/// Adds a `PeerId` and its `Multiaddr` as reserved for a sync protocol (default peer set).
///
/// Returns an `Err` if the given string is not a valid multiaddress
/// or contains an invalid peer ID (which includes the local peer ID).
fn add_reserved_peer(&self, peer: MultiaddrWithPeerId) -> Result<(), String>;

/// Removes a `PeerId` from the list of reserved peers.
/// Removes a `PeerId` from the list of reserved peers for a sync protocol (default peer set).
fn remove_reserved_peer(&self, peer_id: PeerId);

/// Sets the reserved set of a protocol to the given set of peers.
Expand Down Expand Up @@ -359,6 +359,9 @@ pub trait NetworkStateInfo {
/// Returns the local external addresses.
fn external_addresses(&self) -> Vec<Multiaddr>;

/// Returns the listening addresses (without trailing `/p2p/` with our `PeerId`).
fn listen_addresses(&self) -> Vec<Multiaddr>;

/// Returns the local Peer ID.
fn local_peer_id(&self) -> PeerId;
}
Expand All @@ -372,6 +375,10 @@ where
T::external_addresses(self)
}

fn listen_addresses(&self) -> Vec<Multiaddr> {
T::listen_addresses(self)
}

fn local_peer_id(&self) -> PeerId {
T::local_peer_id(self)
}
Expand Down
Loading

0 comments on commit 28b1434

Please sign in to comment.