mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-07 16:33:08 +00:00
fix: parse shards properly in enr config for non twn (#2633)
This commit is contained in:
parent
ebcabd8ed0
commit
e3a515d86a
@ -32,7 +32,15 @@ proc enrConfiguration*(
|
|||||||
let shards: seq[uint16] =
|
let shards: seq[uint16] =
|
||||||
# no shards configured
|
# no shards configured
|
||||||
if conf.shards.len == 0:
|
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
|
# some shards configured
|
||||||
else:
|
else:
|
||||||
toSeq(conf.shards.mapIt(uint16(it)))
|
toSeq(conf.shards.mapIt(uint16(it)))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user