Skip to content

Commit

Permalink
implementing feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmer committed Oct 24, 2024
1 parent 9db0c1e commit eb1fa68
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/test_waku_enr.nim
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ suite "Waku ENR - Capabilities bitfield":
let recordRes = builder.build()

## Then
check recordRes.isOk()
assert recordRes.isOk(), $recordRes.error
let record = recordRes.tryGet()

let codecs = record.getCapabilitiesCodecs()
Expand Down
2 changes: 1 addition & 1 deletion tests/waku_core/test_peers.nim
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ suite "Waku Core - Peers":
let recordRes = builder.build()

## Then
check recordRes.isOk()
assert recordRes.isOk(), $recordRes.error
let record = recordRes.tryGet()

let remotePeerInfoRes = record.toRemotePeerInfo()
Expand Down
10 changes: 8 additions & 2 deletions waku/factory/node_factory.nim
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,19 @@ proc startNode*(
return err("failed to start waku node: " & getCurrentExceptionMsg())

# Connect to configured static nodes
if conf.relay and conf.staticnodes.len > 0:
if conf.staticnodes.len > 0:
if not conf.relay:
return err("waku relay (--relay=true) should be set when configuring staticnodes")
try:
await connectToNodes(node, conf.staticnodes, "static")
except CatchableError:
return err("failed to connect to static nodes: " & getCurrentExceptionMsg())

if conf.relay and dynamicBootstrapNodes.len > 0:
if dynamicBootstrapNodes.len > 0:
if not conf.relay:
return err(
"waku relay (--relay=true) should be set when configuring dynamicBootstrapNodes"
)
info "Connecting to dynamic bootstrap peers"
try:
await connectToNodes(node, dynamicBootstrapNodes, "dynamic bootstrap")
Expand Down

0 comments on commit eb1fa68

Please sign in to comment.