add logs subscription detection fix (#426)

This commit is contained in:
Vyacheslav
2024-02-22 18:08:43 +02:00
committed by GitHub
parent 560eb6c215
commit 8306ceaf63
2 changed files with 14 additions and 1 deletions

View File

@@ -31,7 +31,12 @@ open class EthereumEgressSubscription(
open val logs = ConnectLogs(upstream, scheduler)
override fun getAvailableTopics(): List<String> {
val subs = if (upstream.getCapabilities().contains(Capability.WS_HEAD)) {
listOf(METHOD_NEW_HEADS, METHOD_LOGS)
// we can't use logs without eth_getLogs method available
if (upstream.getMethods().isAvailable("eth_getLogs")) {
listOf(METHOD_NEW_HEADS, METHOD_LOGS)
} else {
listOf(METHOD_NEW_HEADS)
}
} else {
listOf()
}