@@ -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
@@ -140,7 +140,7 @@ suite "HTTP polling subscriptions - filter not found":
140
140
141
141
check eventually subscriptions.subscriptionMapping[id] != id
142
142
143
- test " recreated filter can be still unsubscribed using the original id" :
143
+ test " recreated log filter can be still unsubscribed using the original id" :
144
144
let filter = EventFilter (address: Address .example, topics: @ [array [32 , byte ].example])
145
145
let emptyHandler = proc (log: Log ) = discard
146
146
let id = await subscriptions.subscribeLogs (filter, emptyHandler)
@@ -151,3 +151,24 @@ suite "HTTP polling subscriptions - filter not found":
151
151
152
152
check not subscriptions.filters.hasKey id
153
153
check not subscriptions.subscriptionMapping.hasKey id
154
+
155
+ test " filter not found error recreates block filter" :
156
+ let emptyHandler = proc (blck: Block ) = discard
157
+
158
+ check subscriptions.subscriptionMapping.len == 0
159
+ let id = await subscriptions.subscribeBlocks (emptyHandler)
160
+ check subscriptions.subscriptionMapping[id] == id
161
+
162
+ mockServer.invalidateFilter (id)
163
+
164
+ check eventually subscriptions.subscriptionMapping[id] != id
165
+
166
+ test " recreated block filter can be still unsubscribed using the original id" :
167
+ let emptyHandler = proc (blck: Block ) = discard
168
+ let id = await subscriptions.subscribeBlocks (emptyHandler)
169
+ mockServer.invalidateFilter (id)
170
+ check eventually subscriptions.subscriptionMapping[id] != id
171
+
172
+ await subscriptions.unsubscribe (id)
173
+
174
+ check not subscriptions.subscriptionMapping.hasKey id
0 commit comments