applies review comments

This commit is contained in:
Marcin Czenko 2024-11-28 15:32:55 +01:00
parent 4642545309
commit c0cc437aa2

View File

@ -283,12 +283,11 @@ method subscribeLogs(subscriptions: PollingSubscriptions,
method unsubscribe*(subscriptions: PollingSubscriptions,
id: JsonNode)
{.async.} =
try:
subscriptions.logFilters.del(id)
subscriptions.callbacks.del(id)
if subscriptions.subscriptionMapping.hasKey(id):
let sub = subscriptions.subscriptionMapping[id]
if sub =? subscriptions.subscriptionMapping.?[id]:
subscriptions.subscriptionMapping.del(id)
try:
discard await subscriptions.client.eth_uninstallFilter(sub)
except CancelledError as e:
raise e