Skip to content

Commit

Permalink
fix: parse shards properly in enr config for non twn (#2633)
Browse files Browse the repository at this point in the history
  • Loading branch information
chaitanyaprem authored Apr 26, 2024
1 parent 2a4c0f1 commit 6e6cb29
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion waku/factory/internal_config.nim
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ proc enrConfiguration*(
let shards: seq[uint16] =
# no shards configured
if conf.shards.len == 0:
toSeq(0 ..< conf.pubsubTopics.len).mapIt(uint16(it))
var shardsLocal = newSeq[uint16]()
let shardsRes = topicsToRelayShards(conf.pubsubTopics)
if shardsRes.isOk() and shardsRes.get().isSome():
shardsLocal = shardsRes.get().get().shardIds
else:
error "failed to parse pubsub topic, please format according to static shard specification",
error = shardsRes.error
shardsLocal

# some shards configured
else:
toSeq(conf.shards.mapIt(uint16(it)))
Expand Down

0 comments on commit 6e6cb29

Please sign in to comment.