@@ -66,7 +66,7 @@ describe('SFC', () => {
66
66
} ) ;
67
67
68
68
it ( 'Should revert when sealEpoch not called by node' , async function ( ) {
69
- await expect ( this . sfc . sealEpoch ( [ 1 ] , [ 1 ] , [ 1 ] , [ 1 ] , 0 ) ) . to . be . revertedWithCustomError ( this . sfc , 'NotDriverAuth' ) ;
69
+ await expect ( this . sfc . sealEpoch ( [ 1 ] , [ 1 ] , [ 1 ] , [ 1 ] ) ) . to . be . revertedWithCustomError ( this . sfc , 'NotDriverAuth' ) ;
70
70
} ) ;
71
71
72
72
it ( 'Should revert when SealEpochValidators not called by node' , async function ( ) {
@@ -372,11 +372,11 @@ describe('SFC', () => {
372
372
expect ( await this . sfc . currentEpoch . call ( ) ) . to . equal ( 1 ) ;
373
373
expect ( await this . sfc . currentSealedEpoch ( ) ) . to . equal ( 0 ) ;
374
374
await this . sfc . enableNonNodeCalls ( ) ;
375
- await this . sfc . sealEpoch ( [ 100 , 101 , 102 ] , [ 100 , 101 , 102 ] , [ 100 , 101 , 102 ] , [ 100 , 101 , 102 ] , 0 ) ;
375
+ await this . sfc . sealEpoch ( [ 100 , 101 , 102 ] , [ 100 , 101 , 102 ] , [ 100 , 101 , 102 ] , [ 100 , 101 , 102 ] ) ;
376
376
expect ( await this . sfc . currentEpoch . call ( ) ) . to . equal ( 2 ) ;
377
377
expect ( await this . sfc . currentSealedEpoch ( ) ) . to . equal ( 1 ) ;
378
378
for ( let i = 0 ; i < 4 ; i ++ ) {
379
- await this . sfc . sealEpoch ( [ 100 , 101 , 102 ] , [ 100 , 101 , 102 ] , [ 100 , 101 , 102 ] , [ 100 , 101 , 102 ] , 0 ) ;
379
+ await this . sfc . sealEpoch ( [ 100 , 101 , 102 ] , [ 100 , 101 , 102 ] , [ 100 , 101 , 102 ] , [ 100 , 101 , 102 ] ) ;
380
380
}
381
381
expect ( await this . sfc . currentEpoch . call ( ) ) . to . equal ( 6 ) ;
382
382
expect ( await this . sfc . currentSealedEpoch ( ) ) . to . equal ( 5 ) ;
@@ -385,7 +385,7 @@ describe('SFC', () => {
385
385
it ( 'Should succeed and return endBlock' , async function ( ) {
386
386
const epochNumber = await this . sfc . currentEpoch ( ) ;
387
387
await this . sfc . enableNonNodeCalls ( ) ;
388
- await this . sfc . sealEpoch ( [ 100 , 101 , 102 ] , [ 100 , 101 , 102 ] , [ 100 , 101 , 102 ] , [ 100 , 101 , 102 ] , 0 ) ;
388
+ await this . sfc . sealEpoch ( [ 100 , 101 , 102 ] , [ 100 , 101 , 102 ] , [ 100 , 101 , 102 ] , [ 100 , 101 , 102 ] ) ;
389
389
const lastBlock = await ethers . provider . getBlockNumber ( ) ;
390
390
// endBlock is on second position
391
391
expect ( ( await this . sfc . getEpochSnapshot ( epochNumber ) ) [ 1 ] ) . to . equal ( lastBlock ) ;
@@ -506,79 +506,6 @@ describe('SFC', () => {
506
506
expect ( node . nextValidatorWeights . get ( secondValidatorID ) ) . to . equal ( ethers . parseEther ( '0.6825' ) ) ;
507
507
expect ( node . nextValidatorWeights . get ( thirdValidatorID ) ) . to . equal ( ethers . parseEther ( '0.4' ) ) ;
508
508
} ) ;
509
-
510
- it ( 'Should succeed and balance gas price' , async function ( ) {
511
- const [ validator ] = await ethers . getSigners ( ) ;
512
- await this . sfc . enableNonNodeCalls ( ) ;
513
-
514
- await this . constants . updateGasPriceBalancingCounterweight ( 24 * 60 * 60 ) ;
515
- await this . sfc . rebaseTime ( ) ;
516
-
517
- await this . sfc
518
- . connect ( validator )
519
- . createValidator ( ethers . Wallet . createRandom ( ) . publicKey , { value : ethers . parseEther ( '1' ) } ) ;
520
-
521
- await this . constants . updateTargetGasPowerPerSecond ( 1000 ) ;
522
- await this . sfc . sealEpoch ( [ 1 ] , [ 1 ] , [ 1 ] , [ 1 ] , 1_000 ) ;
523
- await this . sfc . sealEpochValidators ( [ 1 ] ) ;
524
-
525
- expect ( await this . sfc . minGasPrice ( ) ) . to . equal ( 95_000_000_000 ) ;
526
-
527
- await this . sfc . advanceTime ( 1 ) ;
528
- await this . sfc . sealEpoch ( [ 1 ] , [ 1 ] , [ 1 ] , [ 1 ] , 1_000 ) ;
529
- await this . sfc . sealEpochValidators ( [ 1 ] ) ;
530
- expect ( await this . sfc . minGasPrice ( ) ) . to . equal ( 94_999_998_901 ) ;
531
-
532
- await this . sfc . advanceTime ( 2 ) ;
533
- await this . sfc . sealEpoch ( [ 1 ] , [ 1 ] , [ 1 ] , [ 1 ] , 2_000 ) ;
534
- await this . sfc . sealEpochValidators ( [ 1 ] ) ;
535
- expect ( await this . sfc . minGasPrice ( ) ) . to . equal ( 94_999_997_802 ) ;
536
-
537
- await this . sfc . advanceTime ( 1_000 ) ;
538
- await this . sfc . sealEpoch ( [ 1 ] , [ 1 ] , [ 1 ] , [ 1 ] , 1_000_000 ) ;
539
- await this . sfc . sealEpochValidators ( [ 1 ] ) ;
540
- expect ( await this . sfc . minGasPrice ( ) ) . to . equal ( 94_999_996_715 ) ;
541
-
542
- await this . sfc . advanceTime ( 1_000 ) ;
543
- await this . sfc . sealEpoch ( [ 1 ] , [ 1 ] , [ 1 ] , [ 1 ] , 666_666 ) ;
544
- await this . sfc . sealEpochValidators ( [ 1 ] ) ;
545
- expect ( await this . sfc . minGasPrice ( ) ) . to . equal ( 94_637_676_437 ) ;
546
-
547
- await this . sfc . advanceTime ( 1_000 ) ;
548
- await this . sfc . sealEpoch ( [ 1 ] , [ 1 ] , [ 1 ] , [ 1 ] , 1_500_000 ) ;
549
- await this . sfc . sealEpochValidators ( [ 1 ] ) ;
550
- expect ( await this . sfc . minGasPrice ( ) ) . to . equal ( 95_179_080_284 ) ;
551
-
552
- await this . sfc . advanceTime ( 1 ) ;
553
- await this . sfc . sealEpoch ( [ 1 ] , [ 1 ] , [ 1 ] , [ 1 ] , 666 ) ;
554
- await this . sfc . sealEpochValidators ( [ 1 ] ) ;
555
- expect ( await this . sfc . minGasPrice ( ) ) . to . equal ( 95_178_711_617 ) ;
556
-
557
- await this . sfc . advanceTime ( 1 ) ;
558
- await this . sfc . sealEpoch ( [ 1 ] , [ 1 ] , [ 1 ] , [ 1 ] , 1_500 ) ;
559
- await this . sfc . sealEpochValidators ( [ 1 ] ) ;
560
- expect ( await this . sfc . minGasPrice ( ) ) . to . equal ( 95_179_260_762 ) ;
561
-
562
- await this . sfc . advanceTime ( 1_000 ) ;
563
- await this . sfc . sealEpoch ( [ 1 ] , [ 1 ] , [ 1 ] , [ 1 ] , 10_000_000_000 ) ;
564
- await this . sfc . sealEpochValidators ( [ 1 ] ) ;
565
- expect ( await this . sfc . minGasPrice ( ) ) . to . equal ( 99_938_223_800 ) ;
566
-
567
- await this . sfc . advanceTime ( 10_000 ) ;
568
- await this . sfc . sealEpoch ( [ 1 ] , [ 1 ] , [ 1 ] , [ 1 ] , 0 ) ;
569
- await this . sfc . sealEpochValidators ( [ 1 ] ) ;
570
- expect ( await this . sfc . minGasPrice ( ) ) . to . equal ( 94_941_312_610 ) ;
571
-
572
- await this . sfc . advanceTime ( 100 ) ;
573
- await this . sfc . sealEpoch ( [ 1 ] , [ 1 ] , [ 1 ] , [ 1 ] , 200_000 ) ;
574
- await this . sfc . sealEpochValidators ( [ 1 ] ) ;
575
- expect ( await this . sfc . minGasPrice ( ) ) . to . equal ( 95_051_069_157 ) ;
576
-
577
- await this . sfc . advanceTime ( 100 ) ;
578
- await this . sfc . sealEpoch ( [ 1 ] , [ 1 ] , [ 1 ] , [ 1 ] , 50_000 ) ;
579
- await this . sfc . sealEpochValidators ( [ 1 ] ) ;
580
- expect ( await this . sfc . minGasPrice ( ) ) . to . equal ( 94_996_125_793 ) ;
581
- } ) ;
582
509
} ) ;
583
510
584
511
describe ( 'Staking / Sealed Epoch functions' , ( ) => {
@@ -741,7 +668,7 @@ describe('SFC', () => {
741
668
}
742
669
743
670
await this . sfc . advanceTime ( 24 * 60 * 60 ) ;
744
- await this . sfc . sealEpoch ( offlineTimes , offlineBlocks , uptimes , originatedTxsFees , 0 ) ;
671
+ await this . sfc . sealEpoch ( offlineTimes , offlineBlocks , uptimes , originatedTxsFees ) ;
745
672
await this . sfc . sealEpochValidators ( allValidators ) ;
746
673
} ) ;
747
674
@@ -772,7 +699,7 @@ describe('SFC', () => {
772
699
}
773
700
774
701
await this . sfc . advanceTime ( 24 * 60 * 60 ) ;
775
- await this . sfc . sealEpoch ( offlineTimes , offlineBlocks , uptimes , originatedTxsFees , 0 ) ;
702
+ await this . sfc . sealEpoch ( offlineTimes , offlineBlocks , uptimes , originatedTxsFees ) ;
776
703
await this . sfc . sealEpochValidators ( allValidators ) ;
777
704
} ) ;
778
705
@@ -844,7 +771,7 @@ describe('SFC', () => {
844
771
845
772
await this . sfc . advanceTime ( 24 * 60 * 60 ) ;
846
773
await expect (
847
- this . nodeDriverAuth . sealEpoch ( offlineTimes , offlineBlocks , uptimes , originatedTxsFees , 0 ) ,
774
+ this . nodeDriverAuth . sealEpoch ( offlineTimes , offlineBlocks , uptimes , originatedTxsFees ) ,
848
775
) . to . be . revertedWithCustomError ( this . nodeDriverAuth , 'NotDriver' ) ;
849
776
} ) ;
850
777
} ) ;
0 commit comments