mirror of
https://github.com/logos-messaging/logos-messaging-go-bindings.git
synced 2026-01-02 14:03:10 +00:00
requiring user to pass context
This commit is contained in:
parent
fe86a6d1f1
commit
0b5ad1d78a
@ -425,9 +425,7 @@ func (w *Waku) DialPeer(address multiaddr.Multiaddr) error {
|
||||
}
|
||||
|
||||
// TODO: change pubsub topic to shard notation everywhere
|
||||
func (w *Waku) RelayPublish(message *pb.WakuMessage, pubsubTopic string) (pb.MessageHash, error) {
|
||||
ctx, cancel := context.WithTimeout(w.ctx, requestTimeout)
|
||||
defer cancel()
|
||||
func (w *Waku) RelayPublish(ctx context.Context, message *pb.WakuMessage, pubsubTopic string) (pb.MessageHash, error) {
|
||||
return w.node.RelayPublish(ctx, message, pubsubTopic)
|
||||
}
|
||||
|
||||
|
||||
@ -457,7 +457,9 @@ func TestRelay(t *testing.T) {
|
||||
}
|
||||
// send message
|
||||
pubsubTopic := FormatWakuRelayTopic(senderNodeWakuConfig.ClusterID, senderNodeWakuConfig.Shards[0])
|
||||
senderNode.RelayPublish(message, pubsubTopic)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), requestTimeout)
|
||||
defer cancel()
|
||||
senderNode.RelayPublish(ctx, message, pubsubTopic)
|
||||
|
||||
wg := sync.WaitGroup{}
|
||||
wg.Add(1)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user