From 54cc122801a5e9e434fb54e45490bb0c4aa2c5ce Mon Sep 17 00:00:00 2001 From: Gabriel mermelstein Date: Thu, 6 Jun 2024 16:48:52 +0200 Subject: [PATCH] fix DefaultPubsubTopic computation --- waku/waku_core/topics/pubsub_topic.nim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/waku/waku_core/topics/pubsub_topic.nim b/waku/waku_core/topics/pubsub_topic.nim index d974dd591..fe0e24c56 100644 --- a/waku/waku_core/topics/pubsub_topic.nim +++ b/waku/waku_core/topics/pubsub_topic.nim @@ -26,10 +26,6 @@ const DefaultShardId* = uint16(0) const DefaultClusterId* = uint16(0) const DefaultNsPubsubTopic* = NsPubsubTopic(clusterId: DefaultClusterId, shardId: DefaultShardId) -const DefaultPubsubTopic* = PubsubTopic($DefaultNsPubsubTopic) - -proc staticSharding*(T: type NsPubsubTopic, clusterId, shardId: uint16): T = - return NsPubsubTopic(clusterId: clusterId, shardId: shardId) # Serialization @@ -38,6 +34,11 @@ proc `$`*(topic: NsPubsubTopic): string = ## in the format `/waku/2/rs// return "/waku/2/rs/" & $topic.clusterId & "/" & $topic.shardId +const DefaultPubsubTopic* = $DefaultNsPubsubTopic + +proc staticSharding*(T: type NsPubsubTopic, clusterId, shardId: uint16): T = + return NsPubsubTopic(clusterId: clusterId, shardId: shardId) + # Deserialization const