@@ -391,10 +391,10 @@ func Test_applyVrfProposerThreshold(t *testing.T) {
391
391
chain .GenerateEmptyBlocks (10 )
392
392
require .Equal (t , 10 , chain .appState .State .EmptyBlocksCount ())
393
393
394
- chain .GenerateBlocks (5 )
394
+ chain .GenerateBlocks (5 , 0 )
395
395
require .Equal (t , 10 , chain .appState .State .EmptyBlocksCount ())
396
396
397
- chain .GenerateBlocks (100 )
397
+ chain .GenerateBlocks (100 , 0 )
398
398
require .Equal (t , 0.5 , chain .appState .State .VrfProposerThreshold ())
399
399
}
400
400
@@ -557,7 +557,7 @@ func Test_Blockchain_OnlineStatusSwitch(t *testing.T) {
557
557
require .NoError (err )
558
558
559
559
// apply pending status switch
560
- chain .GenerateBlocks (1 )
560
+ chain .GenerateBlocks (1 , 0 )
561
561
require .Equal (1 , len (state .State .StatusSwitchAddresses ()))
562
562
require .False (state .IdentityState .IsOnline (addr ))
563
563
@@ -567,26 +567,26 @@ func Test_Blockchain_OnlineStatusSwitch(t *testing.T) {
567
567
require .Error (err , "should not validate tx if switch is already pending" )
568
568
569
569
// switch status to online
570
- chain .GenerateBlocks (3 )
570
+ chain .GenerateBlocks (3 , 0 )
571
571
require .Equal (uint64 (10 ), chain .Head .Height ())
572
572
require .Zero (len (state .State .StatusSwitchAddresses ()))
573
573
require .True (state .IdentityState .IsOnline (addr ))
574
574
require .True (chain .Head .Flags ().HasFlag (types .IdentityUpdate ))
575
575
576
576
// fail to switch online again
577
- chain .GenerateBlocks (5 )
577
+ chain .GenerateBlocks (5 , 0 )
578
578
tx , _ = chain .secStore .SignTx (BuildTx (state , addr , nil , types .OnlineStatusTx , decimal .Zero , decimal .New (20 , 0 ), decimal .Zero , 0 , 0 , attachments .CreateOnlineStatusAttachment (true )))
579
579
err = chain .txpool .AddInternalTx (tx )
580
580
require .Error (err , "should not validate tx if identity already has online status" )
581
581
582
582
// add pending request to switch offline
583
- chain .GenerateBlocks (4 )
583
+ chain .GenerateBlocks (4 , 0 )
584
584
tx , _ = chain .secStore .SignTx (BuildTx (state , addr , nil , types .OnlineStatusTx , decimal .Zero , decimal .New (20 , 0 ), decimal .Zero , 0 , 0 , attachments .CreateOnlineStatusAttachment (false )))
585
585
err = chain .txpool .AddInternalTx (tx )
586
586
require .NoError (err )
587
587
588
588
// switch status to offline
589
- chain .GenerateBlocks (1 )
589
+ chain .GenerateBlocks (1 , 0 )
590
590
require .Equal (uint64 (20 ), chain .Head .Height ())
591
591
require .Zero (len (state .State .StatusSwitchAddresses ()))
592
592
require .False (state .IdentityState .IsOnline (addr ))
@@ -596,33 +596,33 @@ func Test_Blockchain_OnlineStatusSwitch(t *testing.T) {
596
596
tx , _ = chain .secStore .SignTx (BuildTx (state , addr , nil , types .OnlineStatusTx , decimal .Zero , decimal .New (20 , 0 ), decimal .Zero , 0 , 0 , attachments .CreateOnlineStatusAttachment (true )))
597
597
err = chain .txpool .AddInternalTx (tx )
598
598
require .NoError (err )
599
- chain .GenerateBlocks (1 )
599
+ chain .GenerateBlocks (1 , 0 )
600
600
601
601
require .Equal (1 , len (state .State .StatusSwitchAddresses ()))
602
602
603
603
// remove pending request to switch online
604
604
tx , _ = chain .secStore .SignTx (BuildTx (state , addr , nil , types .OnlineStatusTx , decimal .Zero , decimal .New (20 , 0 ), decimal .Zero , 0 , 0 , attachments .CreateOnlineStatusAttachment (false )))
605
605
err = chain .txpool .AddInternalTx (tx )
606
606
require .NoError (err )
607
- chain .GenerateBlocks (1 )
607
+ chain .GenerateBlocks (1 , 0 )
608
608
609
609
require .Zero (len (state .State .StatusSwitchAddresses ()))
610
610
611
611
// 30th block should not update identity statuses, no pending requests
612
- chain .GenerateBlocks (8 )
612
+ chain .GenerateBlocks (8 , 0 )
613
613
require .Equal (uint64 (30 ), chain .Head .Height ())
614
614
require .False (state .IdentityState .IsOnline (addr ))
615
615
require .False (chain .Head .Flags ().HasFlag (types .IdentityUpdate ))
616
616
617
- chain .GenerateBlocks (70 )
617
+ chain .GenerateBlocks (70 , 0 )
618
618
require .Equal (uint64 (100 ), chain .Head .Height ())
619
619
620
620
tx , _ = chain .secStore .SignTx (BuildTx (state , addr , nil , types .OnlineStatusTx , decimal .Zero , decimal .New (20 , 0 ), decimal .Zero , 0 , 0 , attachments .CreateOnlineStatusAttachment (true )))
621
621
err = chain .txpool .AddInternalTx (tx )
622
622
require .Nil (err )
623
623
624
624
// switch status to online
625
- chain .GenerateBlocks (10 )
625
+ chain .GenerateBlocks (10 , 0 )
626
626
627
627
require .True (state .IdentityState .IsOnline (addr ))
628
628
state .State .AddDelayedPenalty (common.Address {0x2 })
@@ -634,7 +634,7 @@ func Test_Blockchain_OnlineStatusSwitch(t *testing.T) {
634
634
tx , _ = chain .secStore .SignTx (BuildTx (state , addr , nil , types .OnlineStatusTx , decimal .Zero , decimal .New (20 , 0 ), decimal .Zero , 0 , 0 , attachments .CreateOnlineStatusAttachment (true )))
635
635
err = chain .txpool .AddInternalTx (tx )
636
636
require .Nil (err )
637
- chain .GenerateBlocks (1 )
637
+ chain .GenerateBlocks (1 , 0 )
638
638
639
639
require .Equal ([]common.Address {{0x2 }, {0x3 }}, state .State .DelayedOfflinePenalties ())
640
640
require .True (state .IdentityState .IsOnline (addr ))
@@ -643,7 +643,7 @@ func Test_Blockchain_OnlineStatusSwitch(t *testing.T) {
643
643
state .State .AddDelayedPenalty (addr )
644
644
state .Commit (nil )
645
645
chain .CommitState ()
646
- chain .GenerateBlocks (10 )
646
+ chain .GenerateBlocks (10 , 0 )
647
647
648
648
require .False (state .IdentityState .IsOnline (addr ))
649
649
require .True (state .State .GetPenalty (addr ).Sign () > 0 )
@@ -695,7 +695,7 @@ func Test_ApplySubmitCeremonyTxs(t *testing.T) {
695
695
err = chain .txpool .AddInternalTx (signed )
696
696
require .NoError (t , err )
697
697
698
- chain .GenerateBlocks (3 )
698
+ chain .GenerateBlocks (3 , 0 )
699
699
700
700
require .True (t , app .State .HasValidationTx (addr , types .SubmitAnswersHashTx ))
701
701
require .False (t , app .State .HasValidationTx (addr , types .SubmitShortAnswersTx ))
@@ -709,7 +709,7 @@ func Test_ApplySubmitCeremonyTxs(t *testing.T) {
709
709
err = chain .txpool .AddInternalTx (signed )
710
710
require .NoError (t , err )
711
711
712
- chain .GenerateBlocks (1 )
712
+ chain .GenerateBlocks (1 , 0 )
713
713
require .True (t , app .State .HasValidationTx (addr , types .SubmitAnswersHashTx ))
714
714
require .True (t , app .State .HasValidationTx (addr , types .EvidenceTx ))
715
715
@@ -736,7 +736,7 @@ func Test_Blockchain_GodAddressInvitesLimit(t *testing.T) {
736
736
receiver := crypto .PubkeyToAddress (keyReceiver .PublicKey )
737
737
tx , _ := chain .secStore .SignTx (BuildTx (state , addr , & receiver , types .InviteTx , decimal .Zero , decimal .New (2 , 0 ), decimal .Zero , 0 , 0 , nil ))
738
738
require .NoError (chain .txpool .AddInternalTx (tx ))
739
- chain .GenerateBlocks (1 )
739
+ chain .GenerateBlocks (1 , 0 )
740
740
}
741
741
742
742
keyReceiver , _ := crypto .GenerateKey ()
@@ -998,18 +998,18 @@ func Test_Delegation(t *testing.T) {
998
998
require .NoError (t , addTx (keys [2 ], types .DelegateTx , 1 , 0 , & pool2 , nil ))
999
999
require .NoError (t , addTx (keys [3 ], types .DelegateTx , 1 , 0 , & pool3 , nil ))
1000
1000
1001
- chain .GenerateBlocks (1 )
1001
+ chain .GenerateBlocks (1 , 0 )
1002
1002
require .ErrorIs (t , validation .InvalidRecipient , addTx (pool3Key , types .DelegateTx , 1 , 0 , & pool3 , nil ))
1003
1003
require .NoError (t , addTx (pool3Key , types .DelegateTx , 1 , 0 , & pool2 , nil ))
1004
1004
1005
- chain .GenerateBlocks (1 )
1005
+ chain .GenerateBlocks (1 , 0 )
1006
1006
1007
1007
require .Len (t , appState .State .Delegations (), 5 )
1008
1008
1009
1009
require .NoError (t , addTx (keys [0 ], types .OnlineStatusTx , 2 , 0 , nil , attachments .CreateOnlineStatusAttachment (false )))
1010
1010
require .NoError (t , addTx (keys [3 ], types .OnlineStatusTx , 2 , 0 , nil , attachments .CreateOnlineStatusAttachment (true )))
1011
1011
1012
- chain .GenerateBlocks (1 )
1012
+ chain .GenerateBlocks (1 , 0 )
1013
1013
chain .GenerateEmptyBlocks (50 )
1014
1014
1015
1015
require .False (t , appState .ValidatorsCache .IsOnlineIdentity (addrs [0 ]))
@@ -1027,7 +1027,7 @@ func Test_Delegation(t *testing.T) {
1027
1027
1028
1028
addr3 := crypto .PubkeyToAddress (keys [3 ].PublicKey )
1029
1029
require .NoError (t , addTx (pool3Key , types .KillDelegatorTx , 2 , 0 , & addr3 , nil ))
1030
- chain .GenerateBlocks (1 )
1030
+ chain .GenerateBlocks (1 , 0 )
1031
1031
1032
1032
require .Equal (t , 0 , appState .ValidatorsCache .PoolSize (pool3 ))
1033
1033
require .False (t , appState .ValidatorsCache .IsPool (pool3 ))
@@ -1042,10 +1042,10 @@ func Test_Delegation(t *testing.T) {
1042
1042
require .NoError (t , addTx (keys [1 ], types .UndelegateTx , 1 , 1 , nil , nil ))
1043
1043
require .NoError (t , addTx (keys [2 ], types .UndelegateTx , 1 , 1 , nil , nil ))
1044
1044
1045
- chain .GenerateBlocks (1 )
1045
+ chain .GenerateBlocks (1 , 0 )
1046
1046
require .Len (t , appState .State .Delegations (), 2 )
1047
1047
1048
- chain .GenerateBlocks (50 )
1048
+ chain .GenerateBlocks (50 , 0 )
1049
1049
require .Len (t , appState .State .Delegations (), 0 )
1050
1050
1051
1051
require .Equal (t , 0 , appState .ValidatorsCache .PoolSize (pool2 ))
0 commit comments