mirror of https://github.com/status-im/go-waku.git
fix: protocolID must be a string in the mobile API (#466)
This commit is contained in:
parent
54005c8733
commit
a1edf45fad
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue