Added support of eth_uninstallFilter

This commit is contained in:
a10zn8
2022-11-11 17:48:35 +04:00
parent 21cc04ae71
commit a559416e9d
3 changed files with 11 additions and 3 deletions

View File

@@ -255,7 +255,10 @@ open class NativeCall(
}
private fun getRequestDecorator(method: String): RequestDecorator =
if (method == "eth_getFilterChanges") GetFilterUpdatesDecorator() else NoneRequestDecorator()
if (method == "eth_getFilterChanges" || method == "eth_uninstallFilter")
GetFilterUpdatesDecorator()
else
NoneRequestDecorator()
private fun getResultDecorator(method: String): ResultDecorator =
if (CreateFilterDecorator.createFilterMethods.contains(method)) CreateFilterDecorator() else NoneResultDecorator()
@@ -378,7 +381,11 @@ open class NativeCall(
companion object {
const val quoteCode = '"'.code.toByte()
val createFilterMethods = listOf("eth_getFilterChanges", "eth_newFilter", "eth_newBlockFilter")
val createFilterMethods = listOf(
"eth_getFilterChanges",
"eth_newFilter",
"eth_newBlockFilter"
)
}
override fun processResult(result: QuorumRpcReader.Result): ByteArray {
val bytes = result.value

View File

@@ -75,6 +75,7 @@ class DefaultEthereumMethods(
"eth_newFilter",
"eth_newBlockFilter",
"eth_newPendingTransactionFilter",
"eth_uninstallFilter"
)
private val allowedMethods = anyResponseMethods + firstValueMethods + specialMethods + headVerifiedMethods + filterMethods

View File

@@ -57,7 +57,7 @@ class EthereumCallSelector(
return blockTagSelector(params, 1, head)
} else if (method == "eth_getStorageAt") {
return blockTagSelector(params, 2, head)
} else if (method == "eth_getFilterChanges") {
} else if (method == "eth_getFilterChanges" || method == "eth_uninstallFilter") {
return sameUpstreamMatcher(params)
}
return Mono.empty()