@@ -124,25 +124,25 @@ 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
131
- check subscriptions.filters .len == 0
131
+ check subscriptions.logFilters .len == 0
132
132
check subscriptions.subscriptionMapping.len == 0
133
133
134
134
let id = await subscriptions.subscribeLogs (filter, emptyHandler)
135
135
136
- check subscriptions.filters [id] == filter
136
+ check subscriptions.logFilters [id] == filter
137
137
check subscriptions.subscriptionMapping[id] == id
138
- check subscriptions.filters .len == 1
138
+ check subscriptions.logFilters .len == 1
139
139
check subscriptions.subscriptionMapping.len == 1
140
140
141
141
mockServer.invalidateFilter (id)
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)
@@ -151,5 +151,26 @@ suite "HTTP polling subscriptions - filter not found":
151
151
152
152
await subscriptions.unsubscribe (id)
153
153
154
- check not subscriptions.filters.hasKey id
154
+ check not subscriptions.logFilters.hasKey id
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
+
155
176
check not subscriptions.subscriptionMapping.hasKey id
0 commit comments