eth_subscribe: fix preparing filter (#634)

This commit is contained in:
oke11o
2025-02-19 16:00:01 +01:00
committed by GitHub
parent ddaa30082c
commit 8c1649c48e
2 changed files with 29 additions and 3 deletions

View File

@@ -106,11 +106,14 @@ open class EthereumEgressSubscription(
log.debug("Ignore invalid topic: $topics with error ${t.message}")
emptyList()
}
is Collection<*> -> topics.mapNotNull {
is Collection<*> -> topics.mapNotNull { topic ->
try {
Hex32.from(it.toString())
when (topic) {
is Collection<*> -> topic.firstOrNull()?.toString()?.let { Hex32.from(it) }
else -> topic?.toString()?.let { Hex32.from(it) }
}
} catch (t: Throwable) {
log.debug("Ignore invalid topic: $topics with error ${t.message}")
log.debug("Ignore invalid topic: $topic with error ${t.message}")
null
}
}