eth_simulateV1 detector fix (#648)

* eth_simulateV1 detector fix

* remove reth node from detect, fix test
This commit is contained in:
Andrey Bronin
2025-04-03 11:53:17 +03:00
committed by GitHub
parent c0a9f80478
commit 6744e2241c
3 changed files with 5 additions and 5 deletions

View File

@@ -25,7 +25,7 @@ abstract class UpstreamRpcMethodsDetector(
private val availableRegexps =
listOf(
"missing value for required argument ([0-9]+)",
"Invalid params",
// "Invalid params", // todo: uncomment when reth node issue will be fixed
).map { s -> s.toRegex() }
open fun detectRpcMethods(): Mono<Map<String, Boolean>> = detectByMagicMethod().switchIfEmpty(detectByMethod())

View File

@@ -34,7 +34,7 @@ class BasicEthUpstreamRpcMethodsDetector(
setOf(
"eth_getBlockReceipts" to ListParams("latest"),
"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> {

View File

@@ -49,7 +49,7 @@ class BasicEthUpstreamRpcMethodsDetectorTest {
),
)
on {
read(ChainRequest("eth_simulateV1", ListParams(listOf(listOf<Any>()))))
read(ChainRequest("eth_simulateV1", ListParams(listOf())))
} doReturn
Mono.just(
ChainResponse(
@@ -107,7 +107,7 @@ class BasicEthUpstreamRpcMethodsDetectorTest {
),
)
on {
read(ChainRequest("eth_simulateV1", ListParams(listOf(listOf<Any>()))))
read(ChainRequest("eth_simulateV1", ListParams(listOf())))
} doReturn
Mono.just(
ChainResponse(
@@ -166,7 +166,7 @@ class BasicEthUpstreamRpcMethodsDetectorTest {
),
)
on {
read(ChainRequest("eth_simulateV1", ListParams(listOf(listOf<Any>()))))
read(ChainRequest("eth_simulateV1", ListParams(listOf())))
} doReturn
Mono.just(
ChainResponse(