eth_simulateV1 detector fix (#648)
* eth_simulateV1 detector fix * remove reth node from detect, fix test
This commit is contained in:
@@ -25,7 +25,7 @@ abstract class UpstreamRpcMethodsDetector(
|
|||||||
private val availableRegexps =
|
private val availableRegexps =
|
||||||
listOf(
|
listOf(
|
||||||
"missing value for required argument ([0-9]+)",
|
"missing value for required argument ([0-9]+)",
|
||||||
"Invalid params",
|
// "Invalid params", // todo: uncomment when reth node issue will be fixed
|
||||||
).map { s -> s.toRegex() }
|
).map { s -> s.toRegex() }
|
||||||
|
|
||||||
open fun detectRpcMethods(): Mono<Map<String, Boolean>> = detectByMagicMethod().switchIfEmpty(detectByMethod())
|
open fun detectRpcMethods(): Mono<Map<String, Boolean>> = detectByMagicMethod().switchIfEmpty(detectByMethod())
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class BasicEthUpstreamRpcMethodsDetector(
|
|||||||
setOf(
|
setOf(
|
||||||
"eth_getBlockReceipts" to ListParams("latest"),
|
"eth_getBlockReceipts" to ListParams("latest"),
|
||||||
"trace_callMany" to ListParams(listOf(listOf<Any>())),
|
"trace_callMany" to ListParams(listOf(listOf<Any>())),
|
||||||
"eth_simulateV1" to ListParams(listOf(listOf<Any>())),
|
"eth_simulateV1" to ListParams(listOf()),
|
||||||
)
|
)
|
||||||
|
|
||||||
private fun parseRpcModules(data: ByteArray): Map<String, Boolean> {
|
private fun parseRpcModules(data: ByteArray): Map<String, Boolean> {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class BasicEthUpstreamRpcMethodsDetectorTest {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
on {
|
on {
|
||||||
read(ChainRequest("eth_simulateV1", ListParams(listOf(listOf<Any>()))))
|
read(ChainRequest("eth_simulateV1", ListParams(listOf())))
|
||||||
} doReturn
|
} doReturn
|
||||||
Mono.just(
|
Mono.just(
|
||||||
ChainResponse(
|
ChainResponse(
|
||||||
@@ -107,7 +107,7 @@ class BasicEthUpstreamRpcMethodsDetectorTest {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
on {
|
on {
|
||||||
read(ChainRequest("eth_simulateV1", ListParams(listOf(listOf<Any>()))))
|
read(ChainRequest("eth_simulateV1", ListParams(listOf())))
|
||||||
} doReturn
|
} doReturn
|
||||||
Mono.just(
|
Mono.just(
|
||||||
ChainResponse(
|
ChainResponse(
|
||||||
@@ -166,7 +166,7 @@ class BasicEthUpstreamRpcMethodsDetectorTest {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
on {
|
on {
|
||||||
read(ChainRequest("eth_simulateV1", ListParams(listOf(listOf<Any>()))))
|
read(ChainRequest("eth_simulateV1", ListParams(listOf())))
|
||||||
} doReturn
|
} doReturn
|
||||||
Mono.just(
|
Mono.just(
|
||||||
ChainResponse(
|
ChainResponse(
|
||||||
|
|||||||
Reference in New Issue
Block a user