@@ -124,7 +124,7 @@ suite "HTTP polling subscriptions - filter not found":
124
124
await client.close ()
125
125
await mockServer.stop ()
126
126
127
- test " filter not found error recreates filter" :
127
+ test " filter not found error recreates log filter" :
128
128
let filter = EventFilter (address: Address .example, topics: @ [array [32 , byte ].example])
129
129
let emptyHandler = proc (log: Log ) = discard
130
130
@@ -142,7 +142,7 @@ suite "HTTP polling subscriptions - filter not found":
142
142
143
143
check eventually subscriptions.subscriptionMapping[id] != id
144
144
145
- test " recreated filter can be still unsubscribed using the original id" :
145
+ test " recreated log filter can be still unsubscribed using the original id" :
146
146
let filter = EventFilter (address: Address .example, topics: @ [array [32 , byte ].example])
147
147
let emptyHandler = proc (log: Log ) = discard
148
148
let id = await subscriptions.subscribeLogs (filter, emptyHandler)
@@ -153,3 +153,24 @@ suite "HTTP polling subscriptions - filter not found":
153
153
154
154
check not subscriptions.filters.hasKey id
155
155
check not subscriptions.subscriptionMapping.hasKey id
156
+
157
+ test " filter not found error recreates block filter" :
158
+ let emptyHandler = proc (blck: Block ) = discard
159
+
160
+ check subscriptions.subscriptionMapping.len == 0
161
+ let id = await subscriptions.subscribeBlocks (emptyHandler)
162
+ check subscriptions.subscriptionMapping[id] == id
163
+
164
+ mockServer.invalidateFilter (id)
165
+
166
+ check eventually subscriptions.subscriptionMapping[id] != id
167
+
168
+ test " recreated block filter can be still unsubscribed using the original id" :
169
+ let emptyHandler = proc (blck: Block ) = discard
170
+ let id = await subscriptions.subscribeBlocks (emptyHandler)
171
+ mockServer.invalidateFilter (id)
172
+ check eventually subscriptions.subscriptionMapping[id] != id
173
+
174
+ await subscriptions.unsubscribe (id)
175
+
176
+ check not subscriptions.subscriptionMapping.hasKey id
0 commit comments