From a1edf45fad2eb25cd2bb41cde1434448f79dd91c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rich=CE=9Brd?= Date: Mon, 20 Feb 2023 17:50:36 -0400 Subject: [PATCH] fix: protocolID must be a string in the mobile API (#466) --- library/api.go | 3 +-- mobile/api.go | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/library/api.go b/library/api.go index 33cc4fa2..4199198e 100644 --- a/library/api.go +++ b/library/api.go @@ -9,7 +9,6 @@ import "C" import ( "unsafe" - libp2pProtocol "github.com/libp2p/go-libp2p/core/protocol" mobile "github.com/waku-org/go-waku/mobile" "github.com/waku-org/go-waku/waku/v2/protocol" ) @@ -90,7 +89,7 @@ func waku_listen_addresses() *C.char { // //export waku_add_peer func waku_add_peer(address *C.char, protocolID *C.char) *C.char { - response := mobile.AddPeer(C.GoString(address), libp2pProtocol.ID(C.GoString(protocolID))) + response := mobile.AddPeer(C.GoString(address), C.GoString(protocolID)) return C.CString(response) } diff --git a/mobile/api.go b/mobile/api.go index f3de70b0..6b653f52 100644 --- a/mobile/api.go +++ b/mobile/api.go @@ -321,7 +321,7 @@ func ListenAddresses() string { return PrepareJSONResponse(addresses, nil) } -func AddPeer(address string, protocolID libp2pProtocol.ID) string { +func AddPeer(address string, protocolID string) string { if wakuState.node == nil { return MakeJSONResponse(errWakuNodeNotReady) } @@ -331,7 +331,7 @@ func AddPeer(address string, protocolID libp2pProtocol.ID) string { return MakeJSONResponse(err) } - peerID, err := wakuState.node.AddPeer(ma, protocolID) + peerID, err := wakuState.node.AddPeer(ma, libp2pProtocol.ID(protocolID)) return PrepareJSONResponse(peerID, err) }