fix(build): Fix build after `nwaku` pkg bump

This commit is contained in:
Emil Ivanichkov 2024-03-05 10:44:50 +02:00 committed by Emil Ivanichkov
parent 6831b73f13
commit 93de2f4792
5 changed files with 39 additions and 15 deletions

View File

@ -71,7 +71,7 @@ proc exampleJSWaku(rng: ref HmacDrbgContext) {.async.} =
initiatorHSResult.nametagsOutbound)
let wakuMsg = encodePayloadV2(payload, contentTopic)
await node.publish(some(pubSubTopic), wakuMsg.get)
discard await node.publish(some(pubSubTopic), wakuMsg.get)
notice "Sending real message", payload = payload.messageNametag
await sleepAsync(100)
i = i - 1
@ -85,7 +85,7 @@ proc exampleJSWaku(rng: ref HmacDrbgContext) {.async.} =
initiatorHSResult.nametagsOutbound)
wakuMessage1 = encodePayloadV2(payload1, contentTopic)
notice "Sending first message"
await node.publish(some(pubSubTopic), wakuMessage1.get)
discard await node.publish(some(pubSubTopic), wakuMessage1.get)
let
lostMessage1 = @[(byte)1, 5, 5, 5]
@ -105,7 +105,7 @@ proc exampleJSWaku(rng: ref HmacDrbgContext) {.async.} =
initiatorHSResult.nametagsOutbound)
wakuMessage2 = encodePayloadV2(payload2, contentTopic)
notice "Sending second message"
await node.publish(some(pubSubTopic), wakuMessage2.get)
discard await node.publish(some(pubSubTopic), wakuMessage2.get)
let
lostMessage3 = @[(byte)3, 5, 5, 5]
@ -115,7 +115,7 @@ proc exampleJSWaku(rng: ref HmacDrbgContext) {.async.} =
await sleepAsync(10000)
notice "Sending first lost message"
await node.publish(some(pubSubTopic), wakuLostMessage1.get)
discard await node.publish(some(pubSubTopic), wakuLostMessage1.get)
let
message3 = @[(byte)3, 42, 42, 42]
@ -123,15 +123,15 @@ proc exampleJSWaku(rng: ref HmacDrbgContext) {.async.} =
initiatorHSResult.nametagsOutbound)
wakuMessage3 = encodePayloadV2(payload3, contentTopic)
notice "Sending third message"
await node.publish(some(pubSubTopic), wakuMessage3.get)
discard await node.publish(some(pubSubTopic), wakuMessage3.get)
await sleepAsync(10000)
notice "Sending second lost message"
await node.publish(some(pubSubTopic), wakuLostMessage2.get)
discard await node.publish(some(pubSubTopic), wakuLostMessage2.get)
await sleepAsync(1000)
notice "Sending third lost message"
await node.publish(some(pubSubTopic), wakuLostMessage3.get)
discard await node.publish(some(pubSubTopic), wakuLostMessage3.get)
when isMainModule:

View File

@ -60,7 +60,7 @@ proc exampleNwakuAgentA(rng: ref HmacDrbgContext) {.async.} =
agentAHSResult.nametagsOutbound)
wakuMessage1 = encodePayloadV2(payload1, contentTopic)
notice "Sending first message"
await node.publish(some(pubSubTopic), wakuMessage1.get)
discard await node.publish(some(pubSubTopic), wakuMessage1.get)
let
lostMessage1 = @[(byte)1, 5, 5, 5]
@ -80,7 +80,7 @@ proc exampleNwakuAgentA(rng: ref HmacDrbgContext) {.async.} =
agentAHSResult.nametagsOutbound)
wakuMessage2 = encodePayloadV2(payload2, contentTopic)
notice "Sending second message"
await node.publish(some(pubSubTopic), wakuMessage2.get)
discard await node.publish(some(pubSubTopic), wakuMessage2.get)
let
lostMessage3 = @[(byte)3, 5, 5, 5]
@ -90,7 +90,7 @@ proc exampleNwakuAgentA(rng: ref HmacDrbgContext) {.async.} =
await sleepAsync(10000)
notice "Sending first lost message"
await node.publish(some(pubSubTopic), wakuLostMessage1.get)
discard await node.publish(some(pubSubTopic), wakuLostMessage1.get)
let
message3 = @[(byte)3, 42, 42, 42]
@ -98,15 +98,15 @@ proc exampleNwakuAgentA(rng: ref HmacDrbgContext) {.async.} =
agentAHSResult.nametagsOutbound)
wakuMessage3 = encodePayloadV2(payload3, contentTopic)
notice "Sending third message"
await node.publish(some(pubSubTopic), wakuMessage3.get)
discard await node.publish(some(pubSubTopic), wakuMessage3.get)
await sleepAsync(10000)
notice "Sending second lost message"
await node.publish(some(pubSubTopic), wakuLostMessage2.get)
discard await node.publish(some(pubSubTopic), wakuLostMessage2.get)
await sleepAsync(1000)
notice "Sending third lost message"
await node.publish(some(pubSubTopic), wakuLostMessage3.get)
discard await node.publish(some(pubSubTopic), wakuLostMessage3.get)
when isMainModule:
let rng = crypto.newRng()

View File

@ -107,7 +107,7 @@ proc publishHandShakeInitiatorMsg*(node: WakuNode,
contentTopic: ContentTopic,
message: WakuMessage) {.async.} =
notice "Publishing handshake initiator message", step = 1
await node.publish(some(pubSubTopic), message)
discard await node.publish(some(pubSubTopic), message)
notice "Published handshake initiator message",
step = 1,
psTopic = pubSubTopic,
@ -168,7 +168,7 @@ proc publishHandShakeMsg*(node: WakuNode,
message: WakuMessage,
step: int) {.async.} =
notice "Publishing handshake message for step:", step = step
await node.publish(some(pubSubTopic), message)
discard await node.publish(some(pubSubTopic), message)
notice "Published handshake message for step:", step = step,
psTopic = pubSubTopic,
contentTopic = contentTopic,

View File

@ -9,6 +9,7 @@ import
import
waku/[waku_core, waku_node, waku_enr, waku_discv5],
waku/factory/builder,
waku/node/peer_manager,
waku/common/[logging, protobuf]

23
scripts/x.sh Normal file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Navigate to the directory containing the repositories
cd nimble_develop
# Loop through each folder
for repo in */; do
# Navigate into the repository
cd "$repo"
# Check if it's a Git repository
if [ -d .git ]; then
echo "Repository: $repo"
git rev-parse HEAD
git fetch
echo
else
echo "$repo is not a Git repository"
fi
# Return to the parent directory
cd ..
done