mirror of https://github.com/waku-org/nwaku.git
refactor(relay): simplify relay publish jsonrpc api
This commit is contained in:
parent
028efc8547
commit
b84c54bbcb
|
@ -364,8 +364,7 @@ proc publish*(node: WakuNode, topic: PubsubTopic, message: WakuMessage) {.async,
|
|||
|
||||
trace "publish", topic=topic, contentTopic=message.contentTopic
|
||||
|
||||
let data = message.encode().buffer
|
||||
discard await node.wakuRelay.publish(topic, data)
|
||||
discard await node.wakuRelay.publish(topic, message)
|
||||
|
||||
proc startRelay*(node: WakuNode) {.async.} =
|
||||
## Setup and start relay protocol
|
||||
|
|
|
@ -147,10 +147,10 @@ method publish*(w: WakuRelay, pubsubTopic: PubsubTopic, message: WakuMessage|seq
|
|||
|
||||
var data: seq[byte]
|
||||
when message is WakuMessage:
|
||||
data = message.encode()
|
||||
data = message.encode().buffer
|
||||
else:
|
||||
data = message
|
||||
|
||||
return await procCall GossipSub(w).publish(pubsubTopic, message)
|
||||
return await procCall GossipSub(w).publish(pubsubTopic, data)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue