eth_getLogs call selector supports blockHash parameter (#279)

This commit is contained in:
Vyacheslav
2023-08-12 11:15:56 +03:00
committed by GitHub
parent 6766779ddd
commit 6ff75f0e7c
2 changed files with 9 additions and 8 deletions

View File

@@ -116,12 +116,8 @@ class EthereumCallSelector(
return if (blockTag.startsWith("{") && list[pos] is Map<*, *>) {
val obj = list[pos] as Map<*, *>
when {
paramName != null -> {
return if (obj.containsKey(paramName)) {
blockSelectorByTag(obj[paramName].toString(), head)
} else {
Mono.empty()
}
paramName != null && obj.containsKey(paramName) -> {
return blockSelectorByTag(obj[paramName].toString(), head)
}
obj.containsKey("blockNumber") -> {
return blockSelectorByTag(obj["blockNumber"].toString(), head)
@@ -143,7 +139,7 @@ class EthereumCallSelector(
val minHeight: Long? = when (tag) {
"latest" -> head.getCurrentHeight()
"pending" -> null
"earliest" -> 0L // for earliest it doesn't nothing, we expect to have 0 block
"earliest" -> 0L // for earliest it does 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
blockByHash(tag)