@@ -380,7 +380,8 @@ pub(crate) mod tests {
380
380
use sp_runtime:: { key_types:: DUMMY , testing:: UintAuthorityId , BuildStorage } ;
381
381
use sp_state_machine:: BasicExternalities ;
382
382
383
- use frame_support:: traits:: { KeyOwnerProofSystem , OnInitialize } ;
383
+ use frame_support:: traits:: { Hooks , KeyOwnerProofSystem , OnInitialize } ;
384
+ use frame_system:: pallet_prelude:: BlockNumberFor ;
384
385
385
386
type Historical = Pallet < Test > ;
386
387
@@ -399,6 +400,9 @@ pub(crate) mod tests {
399
400
pallet_session:: GenesisConfig :: < Test > { keys, ..Default :: default ( ) }
400
401
. assimilate_storage ( & mut t)
401
402
. unwrap ( ) ;
403
+ BasicExternalities :: execute_with_storage ( & mut t, || {
404
+ <Session as Hooks < BlockNumberFor < Test > > >:: on_genesis ( ) ;
405
+ } ) ;
402
406
sp_io:: TestExternalities :: new ( t)
403
407
}
404
408
@@ -409,7 +413,7 @@ pub(crate) mod tests {
409
413
force_new_session ( ) ;
410
414
411
415
System :: set_block_number ( 1 ) ;
412
- Session :: on_initialize ( 1 ) ;
416
+ < Session as OnInitialize < BlockNumberFor < Test > > > :: on_initialize ( 1 ) ;
413
417
414
418
let encoded_key_1 = UintAuthorityId ( 1 ) . encode ( ) ;
415
419
let proof = Historical :: prove ( ( DUMMY , & encoded_key_1[ ..] ) ) . unwrap ( ) ;
@@ -421,7 +425,7 @@ pub(crate) mod tests {
421
425
force_new_session ( ) ;
422
426
423
427
System :: set_block_number ( 2 ) ;
424
- Session :: on_initialize ( 2 ) ;
428
+ < Session as OnInitialize < BlockNumberFor < Test > > > :: on_initialize ( 2 ) ;
425
429
426
430
assert ! ( Historical :: historical_root( proof. session) . is_some( ) ) ;
427
431
assert ! ( Session :: current_index( ) > proof. session) ;
@@ -433,7 +437,7 @@ pub(crate) mod tests {
433
437
434
438
force_new_session ( ) ;
435
439
System :: set_block_number ( 3 ) ;
436
- Session :: on_initialize ( 3 ) ;
440
+ < Session as OnInitialize < BlockNumberFor < Test > > > :: on_initialize ( 3 ) ;
437
441
} ) ;
438
442
}
439
443
@@ -445,7 +449,7 @@ pub(crate) mod tests {
445
449
force_new_session ( ) ;
446
450
447
451
System :: set_block_number ( i) ;
448
- Session :: on_initialize ( i) ;
452
+ < Session as OnInitialize < BlockNumberFor < Test > > > :: on_initialize ( i) ;
449
453
}
450
454
451
455
assert_eq ! ( <StoredRange <Test >>:: get( ) , Some ( ( 0 , 100 ) ) ) ;
@@ -475,7 +479,7 @@ pub(crate) mod tests {
475
479
force_new_session ( ) ;
476
480
477
481
System :: set_block_number ( i) ;
478
- Session :: on_initialize ( i) ;
482
+ < Session as OnInitialize < BlockNumberFor < Test > > > :: on_initialize ( i) ;
479
483
}
480
484
481
485
assert_eq ! ( <StoredRange <Test >>:: get( ) , Some ( ( 100 , 200 ) ) ) ;
0 commit comments