From 8c3595ff943cd17becebb5c64e09b106b4a15339 Mon Sep 17 00:00:00 2001 From: kdeme Date: Tue, 14 Jan 2020 23:12:53 +0100 Subject: [PATCH] Bump vendor/nim-eth and fix changes --- nimbus/rpc/waku.nim | 6 ++++-- nimbus/rpc/whisper.nim | 2 +- vendor/nim-eth | 2 +- wrappers/libnimbus.nim | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/nimbus/rpc/waku.nim b/nimbus/rpc/waku.nim index fb7ed7d62..cad84cda6 100644 --- a/nimbus/rpc/waku.nim +++ b/nimbus/rpc/waku.nim @@ -275,7 +275,7 @@ proc setupWakuRPC*(node: EthereumNode, keys: WhisperKeys, rpcsrv: RpcServer) = if options.allowP2P.isSome(): allowP2P = options.allowP2P.get() - let filter = newFilter(src, privateKey, symKey, topics, powReq, allowP2P) + let filter = initFilter(src, privateKey, symKey, topics, powReq, allowP2P) result = node.subscribeFilter(filter).Identifier # TODO: Should we do this here "automatically" or separate it in another @@ -287,7 +287,9 @@ proc setupWakuRPC*(node: EthereumNode, keys: WhisperKeys, rpcsrv: RpcServer) = if config.wakuMode == WakuChan: try: # TODO: an addTopics call would probably be more useful - waitFor node.setTopics(config.topics.concat(filter.topics)) + let result = waitFor node.setTopics(config.topics.concat(filter.topics)) + if not result: + raise newException(ValueError, "Too many topics") except CatchableError: trace "setTopics error occured" elif config.isLightNode: diff --git a/nimbus/rpc/whisper.nim b/nimbus/rpc/whisper.nim index 0eabbf8d9..24ff6e7c2 100644 --- a/nimbus/rpc/whisper.nim +++ b/nimbus/rpc/whisper.nim @@ -276,7 +276,7 @@ proc setupWhisperRPC*(node: EthereumNode, keys: WhisperKeys, rpcsrv: RpcServer) if options.allowP2P.isSome(): allowP2P = options.allowP2P.get() - let filter = newFilter(src, privateKey, symKey, topics, powReq, allowP2P) + let filter = initFilter(src, privateKey, symKey, topics, powReq, allowP2P) result = node.subscribeFilter(filter).Identifier rpcsrv.rpc("shh_deleteMessageFilter") do(id: Identifier) -> bool: diff --git a/vendor/nim-eth b/vendor/nim-eth index ac30d7f58..b7ebf8ed5 160000 --- a/vendor/nim-eth +++ b/vendor/nim-eth @@ -1 +1 @@ -Subproject commit ac30d7f589963ad33404acbafdd39016a1262a34 +Subproject commit b7ebf8ed54c14884a63f185de1f38a25bc8fbcbc diff --git a/wrappers/libnimbus.nim b/wrappers/libnimbus.nim index e6ea970a9..247a915d9 100644 --- a/wrappers/libnimbus.nim +++ b/wrappers/libnimbus.nim @@ -366,7 +366,7 @@ proc nimbus_subscribe_filter(options: ptr CFilterOptions, except KeyError: return false - let filter = newFilter(src, privateKey, symKey, @[options.topic], + let filter = initFilter(src, privateKey, symKey, @[options.topic], options.minPow, options.allowP2P) proc c_handler(msg: ReceivedMessage) {.gcsafe.} = @@ -437,7 +437,7 @@ proc subscribeChannel( info "Subscribing to channel", channel, topic, symKey - discard node.subscribeFilter(newFilter(symKey = some(symKey), + discard node.subscribeFilter(initFilter(symKey = some(symKey), topics = @[topic]), handler)