@@ -166,7 +166,7 @@ mod tests {
166
166
167
167
#[ tokio:: test]
168
168
async fn test_parse_expected_nothing_strictly_above_block_number_threshold ( ) {
169
- let until_block_number = 10 ;
169
+ let until_block_number = BlockNumber ( 10 ) ;
170
170
let chain_reader = Arc :: new ( Mutex :: new ( FakeChainReader :: new ( vec ! [
171
171
ChainBlockNextAction :: RollForward {
172
172
parsed_block: ScannedBlock :: new(
@@ -224,16 +224,16 @@ mod tests {
224
224
async fn test_parse_expected_multiple_rollforwards_below_block_number_threshold ( ) {
225
225
let chain_reader = Arc :: new ( Mutex :: new ( FakeChainReader :: new ( vec ! [
226
226
ChainBlockNextAction :: RollForward {
227
- parsed_block: ScannedBlock :: new( "hash-1" , 1 , 10 , Vec :: <& str >:: new( ) ) ,
227
+ parsed_block: ScannedBlock :: new( "hash-1" , BlockNumber ( 1 ) , 10 , Vec :: <& str >:: new( ) ) ,
228
228
} ,
229
229
ChainBlockNextAction :: RollForward {
230
- parsed_block: ScannedBlock :: new( "hash-2" , 2 , 20 , Vec :: <& str >:: new( ) ) ,
230
+ parsed_block: ScannedBlock :: new( "hash-2" , BlockNumber ( 2 ) , 20 , Vec :: <& str >:: new( ) ) ,
231
231
} ,
232
232
] ) ) ) ;
233
233
let mut block_streamer = ChainReaderBlockStreamer :: try_new (
234
234
chain_reader,
235
235
None ,
236
- 100 ,
236
+ BlockNumber ( 100 ) ,
237
237
MAX_ROLL_FORWARDS_PER_POLL ,
238
238
TestLogger :: stdout ( ) ,
239
239
)
@@ -244,8 +244,8 @@ mod tests {
244
244
245
245
assert_eq ! (
246
246
Some ( ChainScannedBlocks :: RollForwards ( vec![
247
- ScannedBlock :: new( "hash-1" , 1 , 10 , Vec :: <& str >:: new( ) ) ,
248
- ScannedBlock :: new( "hash-2" , 2 , 20 , Vec :: <& str >:: new( ) )
247
+ ScannedBlock :: new( "hash-1" , BlockNumber ( 1 ) , 10 , Vec :: <& str >:: new( ) ) ,
248
+ ScannedBlock :: new( "hash-2" , BlockNumber ( 2 ) , 20 , Vec :: <& str >:: new( ) )
249
249
] ) ) ,
250
250
scanned_blocks,
251
251
) ;
@@ -255,19 +255,19 @@ mod tests {
255
255
async fn test_parse_expected_maximum_rollforwards_retrieved_per_poll ( ) {
256
256
let chain_reader = Arc :: new ( Mutex :: new ( FakeChainReader :: new ( vec ! [
257
257
ChainBlockNextAction :: RollForward {
258
- parsed_block: ScannedBlock :: new( "hash-1" , 1 , 10 , Vec :: <& str >:: new( ) ) ,
258
+ parsed_block: ScannedBlock :: new( "hash-1" , BlockNumber ( 1 ) , 10 , Vec :: <& str >:: new( ) ) ,
259
259
} ,
260
260
ChainBlockNextAction :: RollForward {
261
- parsed_block: ScannedBlock :: new( "hash-2" , 2 , 20 , Vec :: <& str >:: new( ) ) ,
261
+ parsed_block: ScannedBlock :: new( "hash-2" , BlockNumber ( 2 ) , 20 , Vec :: <& str >:: new( ) ) ,
262
262
} ,
263
263
ChainBlockNextAction :: RollForward {
264
- parsed_block: ScannedBlock :: new( "hash-3" , 3 , 30 , Vec :: <& str >:: new( ) ) ,
264
+ parsed_block: ScannedBlock :: new( "hash-3" , BlockNumber ( 3 ) , 30 , Vec :: <& str >:: new( ) ) ,
265
265
} ,
266
266
] ) ) ) ;
267
267
let mut block_streamer = ChainReaderBlockStreamer :: try_new (
268
268
chain_reader,
269
269
None ,
270
- 100 ,
270
+ BlockNumber ( 100 ) ,
271
271
MAX_ROLL_FORWARDS_PER_POLL ,
272
272
TestLogger :: stdout ( ) ,
273
273
)
@@ -278,8 +278,8 @@ mod tests {
278
278
let scanned_blocks = block_streamer. poll_next ( ) . await . expect ( "poll_next failed" ) ;
279
279
assert_eq ! (
280
280
Some ( ChainScannedBlocks :: RollForwards ( vec![
281
- ScannedBlock :: new( "hash-1" , 1 , 10 , Vec :: <& str >:: new( ) ) ,
282
- ScannedBlock :: new( "hash-2" , 2 , 20 , Vec :: <& str >:: new( ) )
281
+ ScannedBlock :: new( "hash-1" , BlockNumber ( 1 ) , 10 , Vec :: <& str >:: new( ) ) ,
282
+ ScannedBlock :: new( "hash-2" , BlockNumber ( 2 ) , 20 , Vec :: <& str >:: new( ) )
283
283
] ) ) ,
284
284
scanned_blocks,
285
285
) ;
@@ -288,7 +288,7 @@ mod tests {
288
288
assert_eq ! (
289
289
Some ( ChainScannedBlocks :: RollForwards ( vec![ ScannedBlock :: new(
290
290
"hash-3" ,
291
- 3 ,
291
+ BlockNumber ( 3 ) ,
292
292
30 ,
293
293
Vec :: <& str >:: new( )
294
294
) , ] ) ) ,
@@ -306,8 +306,8 @@ mod tests {
306
306
] ) ) ) ;
307
307
let mut block_streamer = ChainReaderBlockStreamer :: try_new (
308
308
chain_reader,
309
- Some ( ChainPoint :: new ( 100 , 10 , "hash-123" ) ) ,
310
- 1 ,
309
+ Some ( ChainPoint :: new ( 100 , BlockNumber ( 10 ) , "hash-123" ) ) ,
310
+ BlockNumber ( 1 ) ,
311
311
MAX_ROLL_FORWARDS_PER_POLL ,
312
312
TestLogger :: stdout ( ) ,
313
313
)
@@ -327,7 +327,7 @@ mod tests {
327
327
let mut block_streamer = ChainReaderBlockStreamer :: try_new (
328
328
chain_reader,
329
329
None ,
330
- 1 ,
330
+ BlockNumber ( 1 ) ,
331
331
MAX_ROLL_FORWARDS_PER_POLL ,
332
332
TestLogger :: stdout ( ) ,
333
333
)
@@ -347,20 +347,25 @@ mod tests {
347
347
) {
348
348
let chain_reader = Arc :: new ( Mutex :: new ( FakeChainReader :: new ( vec ! [
349
349
ChainBlockNextAction :: RollForward {
350
- parsed_block: ScannedBlock :: new( "hash-8" , 80 , 8 , Vec :: <& str >:: new( ) ) ,
350
+ parsed_block: ScannedBlock :: new( "hash-8" , BlockNumber ( 80 ) , 8 , Vec :: <& str >:: new( ) ) ,
351
351
} ,
352
352
ChainBlockNextAction :: RollForward {
353
- parsed_block: ScannedBlock :: new( "hash-9" , 90 , 9 , Vec :: <& str >:: new( ) ) ,
353
+ parsed_block: ScannedBlock :: new( "hash-9" , BlockNumber ( 90 ) , 9 , Vec :: <& str >:: new( ) ) ,
354
354
} ,
355
355
ChainBlockNextAction :: RollForward {
356
- parsed_block: ScannedBlock :: new( "hash-10" , 100 , 10 , Vec :: <& str >:: new( ) ) ,
356
+ parsed_block: ScannedBlock :: new(
357
+ "hash-10" ,
358
+ BlockNumber ( 100 ) ,
359
+ 10 ,
360
+ Vec :: <& str >:: new( ) ,
361
+ ) ,
357
362
} ,
358
363
ChainBlockNextAction :: RollBackward { slot_number: 9 } ,
359
364
] ) ) ) ;
360
365
let mut block_streamer = ChainReaderBlockStreamer :: try_new (
361
366
chain_reader,
362
367
None ,
363
- 1000 ,
368
+ BlockNumber ( 1000 ) ,
364
369
MAX_ROLL_FORWARDS_PER_POLL ,
365
370
TestLogger :: stdout ( ) ,
366
371
)
@@ -371,8 +376,8 @@ mod tests {
371
376
372
377
assert_eq ! (
373
378
Some ( ChainScannedBlocks :: RollForwards ( vec![
374
- ScannedBlock :: new( "hash-8" , 80 , 8 , Vec :: <& str >:: new( ) ) ,
375
- ScannedBlock :: new( "hash-9" , 90 , 9 , Vec :: <& str >:: new( ) )
379
+ ScannedBlock :: new( "hash-8" , BlockNumber ( 80 ) , 8 , Vec :: <& str >:: new( ) ) ,
380
+ ScannedBlock :: new( "hash-9" , BlockNumber ( 90 ) , 9 , Vec :: <& str >:: new( ) )
376
381
] ) ) ,
377
382
scanned_blocks,
378
383
) ;
@@ -383,17 +388,17 @@ mod tests {
383
388
) {
384
389
let chain_reader = Arc :: new ( Mutex :: new ( FakeChainReader :: new ( vec ! [
385
390
ChainBlockNextAction :: RollForward {
386
- parsed_block: ScannedBlock :: new( "hash-8" , 80 , 8 , Vec :: <& str >:: new( ) ) ,
391
+ parsed_block: ScannedBlock :: new( "hash-8" , BlockNumber ( 80 ) , 8 , Vec :: <& str >:: new( ) ) ,
387
392
} ,
388
393
ChainBlockNextAction :: RollForward {
389
- parsed_block: ScannedBlock :: new( "hash-9" , 90 , 9 , Vec :: <& str >:: new( ) ) ,
394
+ parsed_block: ScannedBlock :: new( "hash-9" , BlockNumber ( 90 ) , 9 , Vec :: <& str >:: new( ) ) ,
390
395
} ,
391
396
ChainBlockNextAction :: RollBackward { slot_number: 3 } ,
392
397
] ) ) ) ;
393
398
let mut block_streamer = ChainReaderBlockStreamer :: try_new (
394
399
chain_reader,
395
400
None ,
396
- 1000 ,
401
+ BlockNumber ( 1000 ) ,
397
402
MAX_ROLL_FORWARDS_PER_POLL ,
398
403
TestLogger :: stdout ( ) ,
399
404
)
@@ -411,7 +416,7 @@ mod tests {
411
416
let mut block_streamer = ChainReaderBlockStreamer :: try_new (
412
417
chain_reader,
413
418
None ,
414
- 1 ,
419
+ BlockNumber ( 1 ) ,
415
420
MAX_ROLL_FORWARDS_PER_POLL ,
416
421
TestLogger :: stdout ( ) ,
417
422
)
0 commit comments