@@ -24,7 +24,7 @@ import (
24
24
"github.com/ava-labs/avalanchego/utils/timer/mockable"
25
25
"github.com/ava-labs/avalanchego/vms/avm/block"
26
26
"github.com/ava-labs/avalanchego/vms/avm/metrics"
27
- "github.com/ava-labs/avalanchego/vms/avm/states "
27
+ "github.com/ava-labs/avalanchego/vms/avm/state "
28
28
"github.com/ava-labs/avalanchego/vms/avm/txs"
29
29
"github.com/ava-labs/avalanchego/vms/avm/txs/executor"
30
30
"github.com/ava-labs/avalanchego/vms/avm/txs/mempool"
@@ -153,7 +153,7 @@ func TestBlockVerify(t *testing.T) {
153
153
parentID := ids .GenerateTestID ()
154
154
mockBlock .EXPECT ().Parent ().Return (parentID ).AnyTimes ()
155
155
156
- mockState := states .NewMockState (ctrl )
156
+ mockState := state .NewMockState (ctrl )
157
157
mockState .EXPECT ().GetBlock (parentID ).Return (nil , errTest )
158
158
return & Block {
159
159
Block : mockBlock ,
@@ -186,7 +186,7 @@ func TestBlockVerify(t *testing.T) {
186
186
parentID := ids .GenerateTestID ()
187
187
mockBlock .EXPECT ().Parent ().Return (parentID ).AnyTimes ()
188
188
189
- mockState := states .NewMockState (ctrl )
189
+ mockState := state .NewMockState (ctrl )
190
190
mockParentBlock := block .NewMockBlock (ctrl )
191
191
mockParentBlock .EXPECT ().Height ().Return (blockHeight ) // Should be blockHeight - 1
192
192
mockState .EXPECT ().GetBlock (parentID ).Return (mockParentBlock , nil )
@@ -226,7 +226,7 @@ func TestBlockVerify(t *testing.T) {
226
226
mockParentBlock := block .NewMockBlock (ctrl )
227
227
mockParentBlock .EXPECT ().Height ().Return (blockHeight - 1 )
228
228
229
- mockParentState := states .NewMockDiff (ctrl )
229
+ mockParentState := state .NewMockDiff (ctrl )
230
230
mockParentState .EXPECT ().GetLastAccepted ().Return (parentID )
231
231
mockParentState .EXPECT ().GetTimestamp ().Return (blockTimestamp .Add (1 ))
232
232
@@ -271,7 +271,7 @@ func TestBlockVerify(t *testing.T) {
271
271
mockParentBlock := block .NewMockBlock (ctrl )
272
272
mockParentBlock .EXPECT ().Height ().Return (blockHeight - 1 )
273
273
274
- mockParentState := states .NewMockDiff (ctrl )
274
+ mockParentState := state .NewMockDiff (ctrl )
275
275
mockParentState .EXPECT ().GetLastAccepted ().Return (parentID )
276
276
mockParentState .EXPECT ().GetTimestamp ().Return (blockTimestamp )
277
277
@@ -321,7 +321,7 @@ func TestBlockVerify(t *testing.T) {
321
321
mockParentBlock := block .NewMockBlock (ctrl )
322
322
mockParentBlock .EXPECT ().Height ().Return (blockHeight - 1 )
323
323
324
- mockParentState := states .NewMockDiff (ctrl )
324
+ mockParentState := state .NewMockDiff (ctrl )
325
325
mockParentState .EXPECT ().GetLastAccepted ().Return (parentID )
326
326
mockParentState .EXPECT ().GetTimestamp ().Return (blockTimestamp )
327
327
@@ -399,7 +399,7 @@ func TestBlockVerify(t *testing.T) {
399
399
mockParentBlock := block .NewMockBlock (ctrl )
400
400
mockParentBlock .EXPECT ().Height ().Return (blockHeight - 1 )
401
401
402
- mockParentState := states .NewMockDiff (ctrl )
402
+ mockParentState := state .NewMockDiff (ctrl )
403
403
mockParentState .EXPECT ().GetLastAccepted ().Return (parentID )
404
404
mockParentState .EXPECT ().GetTimestamp ().Return (blockTimestamp )
405
405
@@ -461,7 +461,7 @@ func TestBlockVerify(t *testing.T) {
461
461
mockParentBlock := block .NewMockBlock (ctrl )
462
462
mockParentBlock .EXPECT ().Height ().Return (blockHeight - 1 )
463
463
464
- mockParentState := states .NewMockDiff (ctrl )
464
+ mockParentState := state .NewMockDiff (ctrl )
465
465
mockParentState .EXPECT ().GetLastAccepted ().Return (parentID )
466
466
mockParentState .EXPECT ().GetTimestamp ().Return (blockTimestamp )
467
467
@@ -509,7 +509,7 @@ func TestBlockVerify(t *testing.T) {
509
509
mockParentBlock := block .NewMockBlock (ctrl )
510
510
mockParentBlock .EXPECT ().Height ().Return (blockHeight - 1 )
511
511
512
- mockParentState := states .NewMockDiff (ctrl )
512
+ mockParentState := state .NewMockDiff (ctrl )
513
513
mockParentState .EXPECT ().GetLastAccepted ().Return (parentID )
514
514
mockParentState .EXPECT ().GetTimestamp ().Return (blockTimestamp )
515
515
@@ -616,11 +616,11 @@ func TestBlockAccept(t *testing.T) {
616
616
mempool := mempool .NewMockMempool (ctrl )
617
617
mempool .EXPECT ().Remove (gomock .Any ()).AnyTimes ()
618
618
619
- mockManagerState := states .NewMockState (ctrl )
619
+ mockManagerState := state .NewMockState (ctrl )
620
620
mockManagerState .EXPECT ().CommitBatch ().Return (nil , errTest )
621
621
mockManagerState .EXPECT ().Abort ()
622
622
623
- mockOnAcceptState := states .NewMockDiff (ctrl )
623
+ mockOnAcceptState := state .NewMockDiff (ctrl )
624
624
mockOnAcceptState .EXPECT ().Apply (mockManagerState )
625
625
626
626
return & Block {
@@ -654,7 +654,7 @@ func TestBlockAccept(t *testing.T) {
654
654
mempool := mempool .NewMockMempool (ctrl )
655
655
mempool .EXPECT ().Remove (gomock .Any ()).AnyTimes ()
656
656
657
- mockManagerState := states .NewMockState (ctrl )
657
+ mockManagerState := state .NewMockState (ctrl )
658
658
// Note the returned batch is nil but not used
659
659
// because we mock the call to shared memory
660
660
mockManagerState .EXPECT ().CommitBatch ().Return (nil , nil )
@@ -663,7 +663,7 @@ func TestBlockAccept(t *testing.T) {
663
663
mockSharedMemory := atomic .NewMockSharedMemory (ctrl )
664
664
mockSharedMemory .EXPECT ().Apply (gomock .Any (), gomock .Any ()).Return (errTest )
665
665
666
- mockOnAcceptState := states .NewMockDiff (ctrl )
666
+ mockOnAcceptState := state .NewMockDiff (ctrl )
667
667
mockOnAcceptState .EXPECT ().Apply (mockManagerState )
668
668
669
669
return & Block {
@@ -698,7 +698,7 @@ func TestBlockAccept(t *testing.T) {
698
698
mempool := mempool .NewMockMempool (ctrl )
699
699
mempool .EXPECT ().Remove (gomock .Any ()).AnyTimes ()
700
700
701
- mockManagerState := states .NewMockState (ctrl )
701
+ mockManagerState := state .NewMockState (ctrl )
702
702
// Note the returned batch is nil but not used
703
703
// because we mock the call to shared memory
704
704
mockManagerState .EXPECT ().CommitBatch ().Return (nil , nil )
@@ -707,7 +707,7 @@ func TestBlockAccept(t *testing.T) {
707
707
mockSharedMemory := atomic .NewMockSharedMemory (ctrl )
708
708
mockSharedMemory .EXPECT ().Apply (gomock .Any (), gomock .Any ()).Return (nil )
709
709
710
- mockOnAcceptState := states .NewMockDiff (ctrl )
710
+ mockOnAcceptState := state .NewMockDiff (ctrl )
711
711
mockOnAcceptState .EXPECT ().Apply (mockManagerState )
712
712
713
713
metrics := metrics .NewMockMetrics (ctrl )
@@ -748,7 +748,7 @@ func TestBlockAccept(t *testing.T) {
748
748
mempool := mempool .NewMockMempool (ctrl )
749
749
mempool .EXPECT ().Remove (gomock .Any ()).AnyTimes ()
750
750
751
- mockManagerState := states .NewMockState (ctrl )
751
+ mockManagerState := state .NewMockState (ctrl )
752
752
// Note the returned batch is nil but not used
753
753
// because we mock the call to shared memory
754
754
mockManagerState .EXPECT ().CommitBatch ().Return (nil , nil )
@@ -758,7 +758,7 @@ func TestBlockAccept(t *testing.T) {
758
758
mockSharedMemory := atomic .NewMockSharedMemory (ctrl )
759
759
mockSharedMemory .EXPECT ().Apply (gomock .Any (), gomock .Any ()).Return (nil )
760
760
761
- mockOnAcceptState := states .NewMockDiff (ctrl )
761
+ mockOnAcceptState := state .NewMockDiff (ctrl )
762
762
mockOnAcceptState .EXPECT ().Apply (mockManagerState )
763
763
764
764
metrics := metrics .NewMockMetrics (ctrl )
@@ -859,7 +859,7 @@ func TestBlockReject(t *testing.T) {
859
859
mempool .EXPECT ().Add (validTx ).Return (nil ) // Only add the one that passes verification
860
860
861
861
preferredID := ids .GenerateTestID ()
862
- mockPreferredState := states .NewMockDiff (ctrl )
862
+ mockPreferredState := state .NewMockDiff (ctrl )
863
863
mockPreferredState .EXPECT ().GetLastAccepted ().Return (ids .GenerateTestID ()).AnyTimes ()
864
864
mockPreferredState .EXPECT ().GetTimestamp ().Return (time .Now ()).AnyTimes ()
865
865
@@ -918,7 +918,7 @@ func TestBlockReject(t *testing.T) {
918
918
mempool .EXPECT ().Add (tx2 ).Return (nil )
919
919
920
920
preferredID := ids .GenerateTestID ()
921
- mockPreferredState := states .NewMockDiff (ctrl )
921
+ mockPreferredState := state .NewMockDiff (ctrl )
922
922
mockPreferredState .EXPECT ().GetLastAccepted ().Return (ids .GenerateTestID ()).AnyTimes ()
923
923
mockPreferredState .EXPECT ().GetTimestamp ().Return (time .Now ()).AnyTimes ()
924
924
@@ -1014,7 +1014,7 @@ func TestBlockStatus(t *testing.T) {
1014
1014
mockBlock := block .NewMockBlock (ctrl )
1015
1015
mockBlock .EXPECT ().ID ().Return (blockID ).AnyTimes ()
1016
1016
1017
- mockState := states .NewMockState (ctrl )
1017
+ mockState := state .NewMockState (ctrl )
1018
1018
mockState .EXPECT ().GetBlock (blockID ).Return (nil , nil )
1019
1019
1020
1020
return & Block {
@@ -1034,7 +1034,7 @@ func TestBlockStatus(t *testing.T) {
1034
1034
mockBlock := block .NewMockBlock (ctrl )
1035
1035
mockBlock .EXPECT ().ID ().Return (blockID ).AnyTimes ()
1036
1036
1037
- mockState := states .NewMockState (ctrl )
1037
+ mockState := state .NewMockState (ctrl )
1038
1038
mockState .EXPECT ().GetBlock (blockID ).Return (nil , database .ErrNotFound )
1039
1039
1040
1040
return & Block {
0 commit comments