Skip to content

Commit

Permalink
fix: protocolID must be a string in the mobile API (#466)
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-ramos authored Feb 20, 2023
1 parent 54005c8 commit a1edf45
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
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

0 comments on commit a1edf45

Please sign in to comment.