Skip to content

Commit

Permalink
Linting.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdee committed Oct 25, 2023
1 parent 0ca6acc commit 66b389b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/v1/peers.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var validPeerDirections = map[string]int{"inbound": 1, "outbound": 1}
// validPeerStates are all the accepted options for peer states.
var validPeerStates = map[string]int{"connected": 1, "connecting": 1, "disconnected": 1, "disconnecting": 1}

// MarshalJSON implements json.Marshaler.
func (p *Peer) MarshalJSON() ([]byte, error) {
// make sure we have valid peer states and directions
_, exists := validPeerDirections[p.Direction]
Expand All @@ -50,6 +51,7 @@ func (p *Peer) MarshalJSON() ([]byte, error) {
})
}

// UnmarshalJSON implements json.Unmarshaler.
func (p *Peer) UnmarshalJSON(input []byte) error {
var peerJSON peerJSON

Expand Down
1 change: 1 addition & 0 deletions http/nodepeers.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
apiv1 "github.com/attestantio/go-eth2-client/api/v1"
)

// NodePeers obtains the peers of a node.
func (s *Service) NodePeers(ctx context.Context, opts *api.PeerOpts) (*api.Response[[]*apiv1.Peer], error) {
// all options are considered optional
request := "/eth/v1/node/peers"
Expand Down

0 comments on commit 66b389b

Please sign in to comment.