@@ -16,7 +16,6 @@ import {
1616 startAndConnectLightNode ,
1717 TestContentTopic ,
1818 TestDecoder ,
19- TestDecoder2 ,
2019 TestNetworkConfig ,
2120 TestRoutingInfo ,
2221 totalMsgs
@@ -50,7 +49,6 @@ describe("Waku Store, cursor", function () {
5049 [ 110 , 120 ]
5150 ] . forEach ( ( [ cursorIndex , messageCount ] ) => {
5251 it ( `Passing a valid cursor at ${ cursorIndex } index when there are ${ messageCount } messages` , async function ( ) {
53- console . log ( nwaku ) ;
5452 await sendMessages (
5553 nwaku ,
5654 messageCount ,
@@ -140,11 +138,7 @@ describe("Waku Store, cursor", function () {
140138 ) . to . be . eq ( bytesToUtf8 ( messages [ messages . length - 1 ] . payload ) ) ;
141139 } ) ;
142140
143- it ( "Passing invalid cursor for nwaku > 0.35.1" , async function ( ) {
144- if ( nwaku . version && nwaku . version . minor < 36 ) {
145- this . skip ( ) ;
146- }
147-
141+ it ( "Passing invalid cursor" , async function ( ) {
148142 await sendMessages ( nwaku , totalMsgs , TestContentTopic , TestRoutingInfo ) ;
149143
150144 const messages : DecodedMessage [ ] = [ ] ;
@@ -172,49 +166,7 @@ describe("Waku Store, cursor", function () {
172166 } catch ( err ) {
173167 if (
174168 ! ( err instanceof Error ) ||
175- ! err . message . includes (
176- "Store query failed with status code: 300, description: BAD_RESPONSE: archive error: DIRVER_ERROR: cursor not found"
177- )
178- ) {
179- throw err ;
180- }
181- }
182- } ) ;
183-
184- it ( "Passing cursor with wrong pubsubTopic for nwaku > 0.35.1" , async function ( ) {
185- if ( nwaku . version && nwaku . version . minor < 36 ) {
186- this . skip ( ) ;
187- }
188-
189- await sendMessages (
190- nwaku ,
191- totalMsgs ,
192- TestDecoder . contentTopic ,
193- TestRoutingInfo
194- ) ;
195-
196- const messages : DecodedMessage [ ] = [ ] ;
197- for await ( const page of waku . store . queryGenerator ( [ TestDecoder ] ) ) {
198- for await ( const msg of page ) {
199- messages . push ( msg as DecodedMessage ) ;
200- }
201- }
202- messages [ 5 ] . pubsubTopic = TestDecoder2 . routingInfo . pubsubTopic ;
203- const cursor = waku . store . createCursor ( messages [ 5 ] ) ;
204-
205- try {
206- for await ( const page of waku . store . queryGenerator ( [ TestDecoder ] , {
207- paginationCursor : cursor
208- } ) ) {
209- void page ;
210- }
211- throw new Error ( "Cursor with wrong pubsubtopic was accepted" ) ;
212- } catch ( err ) {
213- if (
214- ! ( err instanceof Error ) ||
215- ! err . message . includes (
216- "Store query failed with status code: 300, description: BAD_RESPONSE: archive error: DIRVER_ERROR: cursor not found"
217- )
169+ ! err . message . includes ( "cursor not found" )
218170 ) {
219171 throw err ;
220172 }
0 commit comments