Return eth_call to available methods (#251)
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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" | _
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user