Add NotNull quorum for block methods (#265)
This commit is contained in:
@@ -124,20 +124,20 @@ class DefaultEthereumMethods(
|
||||
|
||||
private val possibleNotIndexedMethods = listOf(
|
||||
"eth_getTransactionByHash",
|
||||
"eth_getTransactionReceipt"
|
||||
)
|
||||
|
||||
private val firstValueMethods = listOf(
|
||||
"eth_call",
|
||||
"eth_getTransactionReceipt",
|
||||
"eth_getBlockTransactionCountByHash",
|
||||
"eth_getUncleCountByBlockHash",
|
||||
"eth_getBlockByHash",
|
||||
"eth_getBlockByNumber",
|
||||
"eth_getTransactionByBlockHashAndIndex",
|
||||
"eth_getTransactionByBlockNumberAndIndex",
|
||||
"eth_getUncleByBlockHashAndIndex",
|
||||
"eth_getUncleCountByBlockHash"
|
||||
)
|
||||
|
||||
private val firstValueMethods = listOf(
|
||||
"eth_call",
|
||||
"eth_getStorageAt",
|
||||
"eth_getCode",
|
||||
"eth_getUncleByBlockHashAndIndex",
|
||||
"eth_getLogs",
|
||||
"eth_maxPriorityFeePerGas",
|
||||
"eth_getProof"
|
||||
|
||||
@@ -60,6 +60,7 @@ class EthereumLocalReader(
|
||||
return Mono.empty()
|
||||
}
|
||||
val common = commonRequests(key)
|
||||
?.switchIfEmpty { Mono.just(nullValue to null) }
|
||||
if (common != null) {
|
||||
return common.map { JsonRpcResponse(it.first, null, it.second) }
|
||||
}
|
||||
@@ -88,7 +89,6 @@ class EthereumLocalReader(
|
||||
reader.txByHashAsCont()
|
||||
.read(hash)
|
||||
.map { it.data.json!! to it.upstreamId }
|
||||
.switchIfEmpty { Mono.just(nullValue to null) }
|
||||
}
|
||||
method == "eth_getBlockByHash" -> {
|
||||
if (params.size != 2) {
|
||||
@@ -123,7 +123,6 @@ class EthereumLocalReader(
|
||||
reader.receipts()
|
||||
.read(hash)
|
||||
.map { it.data to it.upstreamId }
|
||||
.switchIfEmpty { Mono.just(nullValue to null) }
|
||||
}
|
||||
else -> null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user