Skip to content

Commit a1edf45

Browse files
fix: protocolID must be a string in the mobile API (#466)
1 parent 54005c8 commit a1edf45

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

library/api.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import "C"
99
import (
1010
"unsafe"
1111

12-
libp2pProtocol "github.com/libp2p/go-libp2p/core/protocol"
1312
mobile "github.com/waku-org/go-waku/mobile"
1413
"github.com/waku-org/go-waku/waku/v2/protocol"
1514
)
@@ -90,7 +89,7 @@ func waku_listen_addresses() *C.char {
9089
//
9190
//export waku_add_peer
9291
func waku_add_peer(address *C.char, protocolID *C.char) *C.char {
93-
response := mobile.AddPeer(C.GoString(address), libp2pProtocol.ID(C.GoString(protocolID)))
92+
response := mobile.AddPeer(C.GoString(address), C.GoString(protocolID))
9493
return C.CString(response)
9594
}
9695

mobile/api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ func ListenAddresses() string {
321321
return PrepareJSONResponse(addresses, nil)
322322
}
323323

324-
func AddPeer(address string, protocolID libp2pProtocol.ID) string {
324+
func AddPeer(address string, protocolID string) string {
325325
if wakuState.node == nil {
326326
return MakeJSONResponse(errWakuNodeNotReady)
327327
}
@@ -331,7 +331,7 @@ func AddPeer(address string, protocolID libp2pProtocol.ID) string {
331331
return MakeJSONResponse(err)
332332
}
333333

334-
peerID, err := wakuState.node.AddPeer(ma, protocolID)
334+
peerID, err := wakuState.node.AddPeer(ma, libp2pProtocol.ID(protocolID))
335335
return PrepareJSONResponse(peerID, err)
336336
}
337337

0 commit comments

Comments
 (0)