Skip to content

Commit

Permalink
refactor(nodebuilder/p2p): Add errors for all methods (#1539)
Browse files Browse the repository at this point in the history
Based on #1429 

Adds an error as a return value for all methods as it is needed for
elevated permission methods.
  • Loading branch information
renaynay committed Dec 23, 2022
1 parent bcaa431 commit 0ab5df6
Show file tree
Hide file tree
Showing 4 changed files with 147 additions and 102 deletions.
4 changes: 2 additions & 2 deletions docs/adr/adr-009-public-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ SyncHead(ctx context.Context) (*header.ExtendedHeader, error)
// Info returns address information about the host.
Info(context.Context) (peer.AddrInfo, error)
// Peers returns all peer IDs used across all inner stores.
Peers(context.Context) []peer.ID
Peers(context.Context) ([]peer.ID, error)
// PeerInfo returns a small slice of information Peerstore has on the
// given peer.
PeerInfo(context.Context, peer.ID) peer.AddrInfo
PeerInfo(context.Context, peer.ID) (peer.AddrInfo, error)

// Connect ensures there is a connection between this host and the peer with
// given peer.
Expand Down
61 changes: 37 additions & 24 deletions nodebuilder/p2p/mocks/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0ab5df6

Please sign in to comment.