@@ -161,7 +161,7 @@ func TestBlockVerify(t *testing.T) {
161
161
parentID := ids .GenerateTestID ()
162
162
mockBlock .EXPECT ().Parent ().Return (parentID ).AnyTimes ()
163
163
164
- mockState := statemock .NewState (ctrl )
164
+ mockState := statemock .NewMockInterface (ctrl )
165
165
mockState .EXPECT ().GetBlock (parentID ).Return (nil , errTest )
166
166
return & Block {
167
167
Block : mockBlock ,
@@ -195,7 +195,7 @@ func TestBlockVerify(t *testing.T) {
195
195
parentID := ids .GenerateTestID ()
196
196
mockBlock .EXPECT ().Parent ().Return (parentID ).AnyTimes ()
197
197
198
- mockState := statemock .NewState (ctrl )
198
+ mockState := statemock .NewMockInterface (ctrl )
199
199
mockParentBlock := block .NewMockBlock (ctrl )
200
200
mockParentBlock .EXPECT ().Height ().Return (blockHeight ) // Should be blockHeight - 1
201
201
mockState .EXPECT ().GetBlock (parentID ).Return (mockParentBlock , nil )
@@ -626,7 +626,7 @@ func TestBlockAccept(t *testing.T) {
626
626
mempool , err := mempool .New ("" , prometheus .NewRegistry (), nil )
627
627
require .NoError (t , err )
628
628
629
- mockManagerState := statemock .NewState (ctrl )
629
+ mockManagerState := statemock .NewMockInterface (ctrl )
630
630
mockManagerState .EXPECT ().CommitBatch ().Return (nil , errTest )
631
631
mockManagerState .EXPECT ().Abort ()
632
632
@@ -660,7 +660,7 @@ func TestBlockAccept(t *testing.T) {
660
660
mempool , err := mempool .New ("" , prometheus .NewRegistry (), nil )
661
661
require .NoError (t , err )
662
662
663
- mockManagerState := statemock .NewState (ctrl )
663
+ mockManagerState := statemock .NewMockInterface (ctrl )
664
664
// Note the returned batch is nil but not used
665
665
// because we mock the call to shared memory
666
666
mockManagerState .EXPECT ().CommitBatch ().Return (nil , nil )
@@ -699,7 +699,7 @@ func TestBlockAccept(t *testing.T) {
699
699
mempool , err := mempool .New ("" , prometheus .NewRegistry (), nil )
700
700
require .NoError (t , err )
701
701
702
- mockManagerState := statemock .NewState (ctrl )
702
+ mockManagerState := statemock .NewMockInterface (ctrl )
703
703
// Note the returned batch is nil but not used
704
704
// because we mock the call to shared memory
705
705
mockManagerState .EXPECT ().CommitBatch ().Return (nil , nil )
@@ -744,12 +744,12 @@ func TestBlockAccept(t *testing.T) {
744
744
mempool , err := mempool .New ("" , prometheus .NewRegistry (), nil )
745
745
require .NoError (t , err )
746
746
747
- mockManagerState := statemock .NewState (ctrl )
747
+ mockManagerState := statemock .NewMockInterface (ctrl )
748
748
// Note the returned batch is nil but not used
749
749
// because we mock the call to shared memory
750
750
mockManagerState .EXPECT ().CommitBatch ().Return (nil , nil )
751
751
mockManagerState .EXPECT ().Abort ()
752
- mockManagerState .EXPECT ().Checksum () .Return (ids .Empty )
752
+ mockManagerState .EXPECT ().Checksum (gomock . Any ()) .Return (ids .Empty , nil )
753
753
754
754
mockSharedMemory := atomicmock .NewSharedMemory (ctrl )
755
755
mockSharedMemory .EXPECT ().Apply (gomock .Any (), gomock .Any ()).Return (nil )
@@ -851,7 +851,7 @@ func TestBlockReject(t *testing.T) {
851
851
require .NoError (t , err )
852
852
853
853
lastAcceptedID := ids .GenerateTestID ()
854
- mockState := statemock .NewState (ctrl )
854
+ mockState := statemock .NewMockInterface (ctrl )
855
855
mockState .EXPECT ().GetLastAccepted ().Return (lastAcceptedID ).AnyTimes ()
856
856
mockState .EXPECT ().GetTimestamp ().Return (time .Now ()).AnyTimes ()
857
857
@@ -904,7 +904,7 @@ func TestBlockReject(t *testing.T) {
904
904
require .NoError (t , err )
905
905
906
906
lastAcceptedID := ids .GenerateTestID ()
907
- mockState := statemock .NewState (ctrl )
907
+ mockState := statemock .NewMockInterface (ctrl )
908
908
mockState .EXPECT ().GetLastAccepted ().Return (lastAcceptedID ).AnyTimes ()
909
909
mockState .EXPECT ().GetTimestamp ().Return (time .Now ()).AnyTimes ()
910
910
0 commit comments