diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/LogsOracle.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/LogsOracle.kt index 98b16d08..26623baa 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/LogsOracle.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/LogsOracle.kt @@ -33,24 +33,12 @@ class LogsOracle( } fun estimate( - limit: Long?, fromBlock: Long, toBlock: Long, address: List, topics: List>, - ): Mono { - return Mono.fromCallable { - try { - val estimate = db.Query(limit, fromBlock, toBlock, address, topics) - "{\"total\":$estimate,\"overflow\":false}" - } catch (e: org.drpc.logsoracle.LogsOracle.LogsOracleException) { - if (e.isQueryOverflow()) { - "{\"total\":\"-1\",\"overflow\":true}" - } else { - throw e - } - } - } + ): Mono { + return Mono.fromCallable { db.Query(fromBlock, toBlock, address, topics) } .subscribeOn(scheduler) } } diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumLocalReader.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumLocalReader.kt index 1612611c..8fc1b0d2 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumLocalReader.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumLocalReader.kt @@ -183,10 +183,6 @@ class EthereumLocalReader( val req = params[0] as LinkedHashMap - val limit = try { req.get("limit") as Integer? } catch (_: IllegalArgumentException) { - throw RpcException(RpcResponseError.CODE_INVALID_METHOD_PARAMS, "Invalid 'limit' parameter") - } - val fromBlock = try { parseBlockRef(req.get("fromBlock") as String?) } catch (_: IllegalArgumentException) { throw RpcException(RpcResponseError.CODE_INVALID_METHOD_PARAMS, "Invalid 'fromBlock' parameter") } @@ -221,8 +217,8 @@ class EthereumLocalReader( throw RpcException(RpcResponseError.CODE_INVALID_METHOD_PARAMS, "Invalid 'topics' parameter") } - return logsOracle.estimate(limit?.toLong() ?: null, fromBlock, toBlock, address, topics) - .map { it.toByteArray() to null } + return logsOracle.estimate(fromBlock, toBlock, address, topics) + .map { "{\"result\":$it}".toByteArray() to null } } private fun parseBlockRef(blockRef: String?): Long { diff --git a/src/main/resources/LogsOracle.jar b/src/main/resources/LogsOracle.jar index 7eae43c4..b2a7d2d1 100644 Binary files a/src/main/resources/LogsOracle.jar and b/src/main/resources/LogsOracle.jar differ