From dbccecc5621256e8f69422d9b6a5539f0551eaa8 Mon Sep 17 00:00:00 2001 From: Sanaz Taheri Boshrooyeh <35961250+staheri14@users.noreply.github.com> Date: Fri, 21 Jan 2022 10:55:36 -0800 Subject: [PATCH] Resolves naming conflict (#821) * resolves namespace conflicts * moves pubsub import under compiler flag --- waku/v2/node/wakunode2.nim | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/waku/v2/node/wakunode2.nim b/waku/v2/node/wakunode2.nim index 0aed623c0..8ca23a2ac 100644 --- a/waku/v2/node/wakunode2.nim +++ b/waku/v2/node/wakunode2.nim @@ -37,6 +37,7 @@ export when defined(rln): import libp2p/protocols/pubsub/rpc/messages, + libp2p/protocols/pubsub/pubsub, web3, ../protocol/waku_rln_relay/[rln, waku_rln_relay_utils] @@ -463,7 +464,7 @@ when defined(rln): ## this procedure is a thin wrapper for the pubsub addValidator method ## it sets message validator on the given pubsubTopic, the validator will check that ## all the messages published in the pubsubTopic have a valid zero-knowledge proof - proc validator(topic: string, message: messages.Message): Future[ValidationResult] {.async.} = + proc validator(topic: string, message: messages.Message): Future[pubsub.ValidationResult] {.async.} = let msg = WakuMessage.init(message.data) if msg.isOk(): let @@ -473,21 +474,21 @@ when defined(rln): case validationRes: of Valid: info "message validity is verified, relaying:", wakumessage=wakumessage - return ValidationResult.Accept + return pubsub.ValidationResult.Accept of Invalid: info "message validity could not be verified, discarding:", wakumessage=wakumessage - return ValidationResult.Reject + return pubsub.ValidationResult.Reject of Spam: info "A spam message is found! yay! discarding:", wakumessage=wakumessage - return ValidationResult.Reject + return pubsub.ValidationResult.Reject # set a validator for the supplied pubsubTopic let pb = PubSub(node.wakuRelay) pb.addValidator(pubsubTopic, validator) proc mountRlnRelay*(node: WakuNode, ethClientAddrOpt: Option[string] = none(string), - ethAccAddrOpt: Option[Address] = none(Address), - memContractAddOpt: Option[Address] = none(Address), + ethAccAddrOpt: Option[web3.Address] = none(web3.Address), + memContractAddOpt: Option[web3.Address] = none(web3.Address), groupOpt: Option[seq[IDCommitment]] = none(seq[IDCommitment]), memKeyPairOpt: Option[MembershipKeyPair] = none(MembershipKeyPair), memIndexOpt: Option[MembershipIndex] = none(MembershipIndex), @@ -528,8 +529,8 @@ when defined(rln): var ethClientAddr: string - ethAccAddr: Address - memContractAdd: Address + ethAccAddr: web3.Address + memContractAdd: web3.Address if onchainMode: ethClientAddr = ethClientAddrOpt.get() ethAccAddr = ethAccAddrOpt.get()