github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/fvm/mock/vm.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mock 4 5 import ( 6 fvm "github.com/onflow/flow-go/fvm" 7 flow "github.com/onflow/flow-go/model/flow" 8 9 mock "github.com/stretchr/testify/mock" 10 11 snapshot "github.com/onflow/flow-go/fvm/storage/snapshot" 12 13 storage "github.com/onflow/flow-go/fvm/storage" 14 ) 15 16 // VM is an autogenerated mock type for the VM type 17 type VM struct { 18 mock.Mock 19 } 20 21 // GetAccount provides a mock function with given fields: _a0, _a1, _a2 22 func (_m *VM) GetAccount(_a0 fvm.Context, _a1 flow.Address, _a2 snapshot.StorageSnapshot) (*flow.Account, error) { 23 ret := _m.Called(_a0, _a1, _a2) 24 25 var r0 *flow.Account 26 var r1 error 27 if rf, ok := ret.Get(0).(func(fvm.Context, flow.Address, snapshot.StorageSnapshot) (*flow.Account, error)); ok { 28 return rf(_a0, _a1, _a2) 29 } 30 if rf, ok := ret.Get(0).(func(fvm.Context, flow.Address, snapshot.StorageSnapshot) *flow.Account); ok { 31 r0 = rf(_a0, _a1, _a2) 32 } else { 33 if ret.Get(0) != nil { 34 r0 = ret.Get(0).(*flow.Account) 35 } 36 } 37 38 if rf, ok := ret.Get(1).(func(fvm.Context, flow.Address, snapshot.StorageSnapshot) error); ok { 39 r1 = rf(_a0, _a1, _a2) 40 } else { 41 r1 = ret.Error(1) 42 } 43 44 return r0, r1 45 } 46 47 // NewExecutor provides a mock function with given fields: _a0, _a1, _a2 48 func (_m *VM) NewExecutor(_a0 fvm.Context, _a1 fvm.Procedure, _a2 storage.TransactionPreparer) fvm.ProcedureExecutor { 49 ret := _m.Called(_a0, _a1, _a2) 50 51 var r0 fvm.ProcedureExecutor 52 if rf, ok := ret.Get(0).(func(fvm.Context, fvm.Procedure, storage.TransactionPreparer) fvm.ProcedureExecutor); ok { 53 r0 = rf(_a0, _a1, _a2) 54 } else { 55 if ret.Get(0) != nil { 56 r0 = ret.Get(0).(fvm.ProcedureExecutor) 57 } 58 } 59 60 return r0 61 } 62 63 // Run provides a mock function with given fields: _a0, _a1, _a2 64 func (_m *VM) Run(_a0 fvm.Context, _a1 fvm.Procedure, _a2 snapshot.StorageSnapshot) (*snapshot.ExecutionSnapshot, fvm.ProcedureOutput, error) { 65 ret := _m.Called(_a0, _a1, _a2) 66 67 var r0 *snapshot.ExecutionSnapshot 68 var r1 fvm.ProcedureOutput 69 var r2 error 70 if rf, ok := ret.Get(0).(func(fvm.Context, fvm.Procedure, snapshot.StorageSnapshot) (*snapshot.ExecutionSnapshot, fvm.ProcedureOutput, error)); ok { 71 return rf(_a0, _a1, _a2) 72 } 73 if rf, ok := ret.Get(0).(func(fvm.Context, fvm.Procedure, snapshot.StorageSnapshot) *snapshot.ExecutionSnapshot); ok { 74 r0 = rf(_a0, _a1, _a2) 75 } else { 76 if ret.Get(0) != nil { 77 r0 = ret.Get(0).(*snapshot.ExecutionSnapshot) 78 } 79 } 80 81 if rf, ok := ret.Get(1).(func(fvm.Context, fvm.Procedure, snapshot.StorageSnapshot) fvm.ProcedureOutput); ok { 82 r1 = rf(_a0, _a1, _a2) 83 } else { 84 r1 = ret.Get(1).(fvm.ProcedureOutput) 85 } 86 87 if rf, ok := ret.Get(2).(func(fvm.Context, fvm.Procedure, snapshot.StorageSnapshot) error); ok { 88 r2 = rf(_a0, _a1, _a2) 89 } else { 90 r2 = ret.Error(2) 91 } 92 93 return r0, r1, r2 94 } 95 96 type mockConstructorTestingTNewVM interface { 97 mock.TestingT 98 Cleanup(func()) 99 } 100 101 // NewVM creates a new instance of VM. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 102 func NewVM(t mockConstructorTestingTNewVM) *VM { 103 mock := &VM{} 104 mock.Mock.Test(t) 105 106 t.Cleanup(func() { mock.AssertExpectations(t) }) 107 108 return mock 109 }