Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: protocolID must be a string in the mobile API #466

Merged
merged 1 commit into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions library/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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)
}

Expand Down
4 changes: 2 additions & 2 deletions mobile/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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)
}

Expand Down