From 1d8445b3c37be23264265a44fafc49fe7a0472b4 Mon Sep 17 00:00:00 2001 From: Termina1 Date: Wed, 2 Aug 2023 16:23:44 +0300 Subject: [PATCH] allow pending block tag for block tag methods --- .../emeraldpay/dshackle/upstream/calls/EthereumCallSelector.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/EthereumCallSelector.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/EthereumCallSelector.kt index 3dd456df..78d85f04 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/EthereumCallSelector.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/EthereumCallSelector.kt @@ -142,6 +142,7 @@ class EthereumCallSelector( private fun blockSelectorByTag(tag: String, head: Head): Mono { val minHeight: Long? = when (tag) { "latest" -> head.getCurrentHeight() + "pending" -> null "earliest" -> 0L // for earliest it doesn't nothing, we expect to have 0 block else -> if (tag.startsWith("0x") || tag.toLongOrNull() != null) { return if (tag.length == 66) { // 32-byte hash is represented as 0x + 64 characters