From 069d66ed6d01db0a6c7ff21157b55a27a7d30a61 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Tue, 26 Jul 2022 13:49:10 -0400 Subject: [PATCH] fix: get_waku_v2_admin_v1_peers response --- waku/v2/rpc/admin.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/waku/v2/rpc/admin.go b/waku/v2/rpc/admin.go index d1db0409..2eebdd2f 100644 --- a/waku/v2/rpc/admin.go +++ b/waku/v2/rpc/admin.go @@ -26,14 +26,12 @@ type PeersArgs struct { } type PeerReply struct { - Multiaddr string `json:"mutliaddr,omitempty"` + Multiaddr string `json:"multiaddr,omitempty"` Protocol string `json:"protocol,omitempty"` Connected bool `json:"connected,omitempty"` } -type PeersReply struct { - Peers []PeerReply `json:"peers,omitempty"` -} +type PeersReply []PeerReply func (a *AdminService) PostV1Peers(req *http.Request, args *PeersArgs, reply *SuccessReply) error { for _, peer := range args.Peers { @@ -70,7 +68,7 @@ func (a *AdminService) GetV1Peers(req *http.Request, args *GetPeersArgs, reply * if !isWakuProtocol(proto) { continue } - reply.Peers = append(reply.Peers, PeerReply{ + *reply = append(*reply, PeerReply{ Multiaddr: addr.String(), Protocol: proto, Connected: peer.Connected,