Return eth_call to available methods (#251)

This commit is contained in:
KirillPamPam
2023-07-18 12:53:16 +04:00
committed by GitHub
parent ea332fb522
commit e074a21e16
2 changed files with 34 additions and 1 deletions

View File

@@ -82,6 +82,7 @@ class DefaultEthereumMethods(
)
private val firstValueMethods = listOf(
"eth_call",
"eth_getBlockTransactionCountByHash",
"eth_getUncleCountByBlockHash",
"eth_getBlockByHash",
@@ -148,7 +149,6 @@ class DefaultEthereumMethods(
possibleNotIndexedMethods.contains(method) -> NotNullQuorum()
specialMethods.contains(method) -> {
when (method) {
"eth_call" -> AlwaysQuorum()
"eth_getTransactionCount" -> AlwaysQuorum()
"eth_getBalance" -> AlwaysQuorum()
"eth_sendRawTransaction" -> BroadcastQuorum()

View File

@@ -87,4 +87,37 @@ class DefaultEthereumMethodsSpec extends Specification {
then:
act.isEmpty()
}
def "Default eth methods are available"() {
setup:
def methods = new DefaultEthereumMethods(Chain.ETHEREUM__MAINNET)
expect:
methods.isAvailable(method)
where:
method | _
"eth_gasPrice" | _
"eth_estimateGas" | _
"eth_getBlockTransactionCountByHash" | _
"eth_getUncleCountByBlockHash" | _
"eth_getBlockByHash" | _
"eth_getBlockByNumber" | _
"eth_getTransactionByBlockHashAndIndex" | _
"eth_getTransactionByBlockNumberAndIndex" | _
"eth_getStorageAt" | _
"eth_getCode" | _
"eth_getUncleByBlockHashAndIndex" | _
"eth_getLogs" | _
"eth_maxPriorityFeePerGas" | _
"eth_getTransactionByHash" | _
"eth_getTransactionReceipt" | _
"eth_call" | _
"eth_getTransactionCount" | _
"eth_blockNumber" | _
"eth_getBalance" | _
"eth_sendRawTransaction" | _
"eth_getBlockTransactionCountByNumber" | _
"eth_getUncleCountByBlockNumber" | _
"eth_getUncleByBlockNumberAndIndex" | _
"eth_feeHistory" | _
}
}