@@ -553,7 +553,7 @@ func Test_Blockchain_OnlineStatusSwitch(t *testing.T) {
553
553
554
554
// add pending request to switch online
555
555
tx , _ := chain .secStore .SignTx (BuildTx (state , addr , nil , types .OnlineStatusTx , decimal .Zero , decimal .New (20 , 0 ), decimal .Zero , 0 , 0 , attachments .CreateOnlineStatusAttachment (true )))
556
- err := chain .txpool .Add (tx )
556
+ err := chain .txpool .AddInternalTx (tx )
557
557
require .NoError (err )
558
558
559
559
// apply pending status switch
@@ -563,7 +563,7 @@ func Test_Blockchain_OnlineStatusSwitch(t *testing.T) {
563
563
564
564
// fail to switch online again
565
565
tx , _ = chain .secStore .SignTx (BuildTx (state , addr , nil , types .OnlineStatusTx , decimal .Zero , decimal .New (20 , 0 ), decimal .Zero , 0 , 0 , attachments .CreateOnlineStatusAttachment (true )))
566
- err = chain .txpool .Add (tx )
566
+ err = chain .txpool .AddInternalTx (tx )
567
567
require .Error (err , "should not validate tx if switch is already pending" )
568
568
569
569
// switch status to online
@@ -576,13 +576,13 @@ func Test_Blockchain_OnlineStatusSwitch(t *testing.T) {
576
576
// fail to switch online again
577
577
chain .GenerateBlocks (5 )
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
- err = chain .txpool .Add (tx )
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
583
chain .GenerateBlocks (4 )
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
- err = chain .txpool .Add (tx )
585
+ err = chain .txpool .AddInternalTx (tx )
586
586
require .NoError (err )
587
587
588
588
// switch status to offline
@@ -594,15 +594,15 @@ func Test_Blockchain_OnlineStatusSwitch(t *testing.T) {
594
594
595
595
// add pending request to switch offline
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
- err = chain .txpool .Add (tx )
597
+ err = chain .txpool .AddInternalTx (tx )
598
598
require .NoError (err )
599
599
chain .GenerateBlocks (1 )
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
- err = chain .txpool .Add (tx )
605
+ err = chain .txpool .AddInternalTx (tx )
606
606
require .NoError (err )
607
607
chain .GenerateBlocks (1 )
608
608
@@ -618,7 +618,7 @@ func Test_Blockchain_OnlineStatusSwitch(t *testing.T) {
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
- err = chain .txpool .Add (tx )
621
+ err = chain .txpool .AddInternalTx (tx )
622
622
require .Nil (err )
623
623
624
624
// switch status to online
@@ -632,7 +632,7 @@ func Test_Blockchain_OnlineStatusSwitch(t *testing.T) {
632
632
chain .CommitState ()
633
633
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
- err = chain .txpool .Add (tx )
635
+ err = chain .txpool .AddInternalTx (tx )
636
636
require .Nil (err )
637
637
chain .GenerateBlocks (1 )
638
638
@@ -692,7 +692,7 @@ func Test_ApplySubmitCeremonyTxs(t *testing.T) {
692
692
693
693
signed , err := types .SignTx (tx , key )
694
694
require .NoError (t , err )
695
- err = chain .txpool .Add (signed )
695
+ err = chain .txpool .AddInternalTx (signed )
696
696
require .NoError (t , err )
697
697
698
698
chain .GenerateBlocks (3 )
@@ -706,7 +706,7 @@ func Test_ApplySubmitCeremonyTxs(t *testing.T) {
706
706
Payload : []byte {0x1 },
707
707
}
708
708
signed , _ = types .SignTx (tx , key )
709
- err = chain .txpool .Add (signed )
709
+ err = chain .txpool .AddInternalTx (signed )
710
710
require .NoError (t , err )
711
711
712
712
chain .GenerateBlocks (1 )
@@ -720,7 +720,7 @@ func Test_ApplySubmitCeremonyTxs(t *testing.T) {
720
720
}
721
721
signed , _ = types .SignTx (tx , key )
722
722
723
- err = chain .txpool .Add (signed )
723
+ err = chain .txpool .AddInternalTx (signed )
724
724
require .True (t , err == validation .DuplicatedTx )
725
725
}
726
726
@@ -735,14 +735,14 @@ func Test_Blockchain_GodAddressInvitesLimit(t *testing.T) {
735
735
keyReceiver , _ := crypto .GenerateKey ()
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
- require .NoError (chain .txpool .Add (tx ))
738
+ require .NoError (chain .txpool .AddInternalTx (tx ))
739
739
chain .GenerateBlocks (1 )
740
740
}
741
741
742
742
keyReceiver , _ := crypto .GenerateKey ()
743
743
receiver := crypto .PubkeyToAddress (keyReceiver .PublicKey )
744
744
tx , _ := chain .secStore .SignTx (BuildTx (state , addr , & receiver , types .InviteTx , decimal .Zero , decimal .New (2 , 0 ), decimal .Zero , 0 , 0 , nil ))
745
- require .Equal (validation .InsufficientInvites , chain .txpool .Add (tx ), "we should not issue invite if we exceed limit" )
745
+ require .Equal (validation .InsufficientInvites , chain .txpool .AddInternalTx (tx ), "we should not issue invite if we exceed limit" )
746
746
}
747
747
748
748
func Test_setNewIdentitiesAttributes (t * testing.T ) {
@@ -990,7 +990,7 @@ func Test_Delegation(t *testing.T) {
990
990
Payload : payload ,
991
991
}
992
992
signedTx , _ := types .SignTx (tx , key )
993
- return txpool .Add (signedTx )
993
+ return txpool .AddInternalTx (signedTx )
994
994
}
995
995
996
996
require .NoError (t , addTx (keys [0 ], types .DelegateTx , 1 , 0 , & pool1 , nil ))
0 commit comments