mirror of https://github.com/waku-org/nwaku.git
fixing redundant funcion types
This commit is contained in:
parent
b161f0a3cb
commit
d5132edfe1
|
@ -41,7 +41,7 @@ const
|
|||
StaticShardingPubsubTopicPrefix = Waku2PubsubTopicPrefix & "/rs"
|
||||
|
||||
proc parseStaticSharding*(
|
||||
T: type NsPubsubTopic, topic: PubsubTopic | string
|
||||
T: type NsPubsubTopic, topic: PubsubTopic
|
||||
): ParsingResult[NsPubsubTopic] =
|
||||
if not topic.startsWith(StaticShardingPubsubTopicPrefix):
|
||||
return err(
|
||||
|
@ -72,9 +72,7 @@ proc parseStaticSharding*(
|
|||
|
||||
ok(NsPubsubTopic.staticSharding(clusterId, shardId))
|
||||
|
||||
proc parse*(
|
||||
T: type NsPubsubTopic, topic: PubsubTopic | string
|
||||
): ParsingResult[NsPubsubTopic] =
|
||||
proc parse*(T: type NsPubsubTopic, topic: PubsubTopic): ParsingResult[NsPubsubTopic] =
|
||||
## Splits a namespaced topic string into its constituent parts.
|
||||
## The topic string has to be in the format `/<application>/<version>/<topic-name>/<encoding>`
|
||||
NsPubsubTopic.parseStaticSharding(topic)
|
||||
|
|
|
@ -85,7 +85,7 @@ func contains*(rs: RelayShards, clusterId, shardId: uint16): bool =
|
|||
func contains*(rs: RelayShards, topic: NsPubsubTopic): bool =
|
||||
return rs.contains(topic.clusterId, topic.shardId)
|
||||
|
||||
func contains*(rs: RelayShards, topic: PubsubTopic | string): bool =
|
||||
func contains*(rs: RelayShards, topic: PubsubTopic): bool =
|
||||
let parseRes = NsPubsubTopic.parse(topic)
|
||||
if parseRes.isErr():
|
||||
return false
|
||||
|
@ -240,7 +240,7 @@ proc containsShard*(r: Record, clusterId, shardId: uint16): bool =
|
|||
proc containsShard*(r: Record, topic: NsPubsubTopic): bool =
|
||||
return containsShard(r, topic.clusterId, topic.shardId)
|
||||
|
||||
proc containsShard*(r: Record, topic: PubsubTopic | string): bool =
|
||||
proc containsShard*(r: Record, topic: PubsubTopic): bool =
|
||||
let parseRes = NsPubsubTopic.parse(topic)
|
||||
if parseRes.isErr():
|
||||
debug "invalid static sharding topic", topic = topic, error = parseRes.error
|
||||
|
|
Loading…
Reference in New Issue