Skip to content

Commit 7282a04

Browse files
committed
Fix beaconCommitteeSelections non-pointer argument and nodePeerCount (#12)
* Fix non-pointer argument * Fix node peer counts
1 parent 166bf8c commit 7282a04

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

http/beaconcommitteeselections.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525

2626
// BeaconCommitteeSelections submits beacon committee selections.
2727
func (s *Service) BeaconCommitteeSelections(ctx context.Context,
28-
opts api.BeaconCommitteeSelectionsOpts,
28+
opts *api.BeaconCommitteeSelectionsOpts,
2929
) (
3030
*api.Response[[]*apiv1.BeaconCommitteeSelection],
3131
error,

http/nodepeercount.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
)
2424

2525
// NodePeerCount obtains the peer count of a node.
26-
func (s *Service) NodePeerCount(ctx context.Context, opts *api.NodePeerCountOpts) (*api.Response[[]*apiv1.Peer], error) {
26+
func (s *Service) NodePeerCount(ctx context.Context, opts *api.NodePeerCountOpts) (*api.Response[*apiv1.PeerCount], error) {
2727
if err := s.assertIsActive(ctx); err != nil {
2828
return nil, err
2929
}
@@ -39,12 +39,12 @@ func (s *Service) NodePeerCount(ctx context.Context, opts *api.NodePeerCountOpts
3939
if httpResponse.contentType != ContentTypeJSON {
4040
return nil, fmt.Errorf("unexpected content type %v (expected JSON)", httpResponse.contentType)
4141
}
42-
data, meta, err := decodeJSONResponse(bytes.NewReader(httpResponse.body), []*apiv1.Peer{})
42+
data, meta, err := decodeJSONResponse(bytes.NewReader(httpResponse.body), &apiv1.PeerCount{})
4343
if err != nil {
4444
return nil, err
4545
}
4646

47-
return &api.Response[[]*apiv1.Peer]{
47+
return &api.Response[*apiv1.PeerCount]{
4848
Data: data,
4949
Metadata: meta,
5050
}, nil

0 commit comments

Comments
 (0)