github.com/onflow/flow-go@v0.33.17/engine/execution/computation/mock/computation_manager.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mock 4 5 import ( 6 context "context" 7 8 execution "github.com/onflow/flow-go/engine/execution" 9 entity "github.com/onflow/flow-go/module/mempool/entity" 10 11 flow "github.com/onflow/flow-go/model/flow" 12 13 mock "github.com/stretchr/testify/mock" 14 15 snapshot "github.com/onflow/flow-go/fvm/storage/snapshot" 16 ) 17 18 // ComputationManager is an autogenerated mock type for the ComputationManager type 19 type ComputationManager struct { 20 mock.Mock 21 } 22 23 // ComputeBlock provides a mock function with given fields: ctx, parentBlockExecutionResultID, block, _a3 24 func (_m *ComputationManager) ComputeBlock(ctx context.Context, parentBlockExecutionResultID flow.Identifier, block *entity.ExecutableBlock, _a3 snapshot.StorageSnapshot) (*execution.ComputationResult, error) { 25 ret := _m.Called(ctx, parentBlockExecutionResultID, block, _a3) 26 27 var r0 *execution.ComputationResult 28 var r1 error 29 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, *entity.ExecutableBlock, snapshot.StorageSnapshot) (*execution.ComputationResult, error)); ok { 30 return rf(ctx, parentBlockExecutionResultID, block, _a3) 31 } 32 if rf, ok := ret.Get(0).(func(context.Context, flow.Identifier, *entity.ExecutableBlock, snapshot.StorageSnapshot) *execution.ComputationResult); ok { 33 r0 = rf(ctx, parentBlockExecutionResultID, block, _a3) 34 } else { 35 if ret.Get(0) != nil { 36 r0 = ret.Get(0).(*execution.ComputationResult) 37 } 38 } 39 40 if rf, ok := ret.Get(1).(func(context.Context, flow.Identifier, *entity.ExecutableBlock, snapshot.StorageSnapshot) error); ok { 41 r1 = rf(ctx, parentBlockExecutionResultID, block, _a3) 42 } else { 43 r1 = ret.Error(1) 44 } 45 46 return r0, r1 47 } 48 49 // ExecuteScript provides a mock function with given fields: ctx, script, arguments, blockHeader, _a4 50 func (_m *ComputationManager) ExecuteScript(ctx context.Context, script []byte, arguments [][]byte, blockHeader *flow.Header, _a4 snapshot.StorageSnapshot) ([]byte, error) { 51 ret := _m.Called(ctx, script, arguments, blockHeader, _a4) 52 53 var r0 []byte 54 var r1 error 55 if rf, ok := ret.Get(0).(func(context.Context, []byte, [][]byte, *flow.Header, snapshot.StorageSnapshot) ([]byte, error)); ok { 56 return rf(ctx, script, arguments, blockHeader, _a4) 57 } 58 if rf, ok := ret.Get(0).(func(context.Context, []byte, [][]byte, *flow.Header, snapshot.StorageSnapshot) []byte); ok { 59 r0 = rf(ctx, script, arguments, blockHeader, _a4) 60 } else { 61 if ret.Get(0) != nil { 62 r0 = ret.Get(0).([]byte) 63 } 64 } 65 66 if rf, ok := ret.Get(1).(func(context.Context, []byte, [][]byte, *flow.Header, snapshot.StorageSnapshot) error); ok { 67 r1 = rf(ctx, script, arguments, blockHeader, _a4) 68 } else { 69 r1 = ret.Error(1) 70 } 71 72 return r0, r1 73 } 74 75 // GetAccount provides a mock function with given fields: ctx, addr, header, _a3 76 func (_m *ComputationManager) GetAccount(ctx context.Context, addr flow.Address, header *flow.Header, _a3 snapshot.StorageSnapshot) (*flow.Account, error) { 77 ret := _m.Called(ctx, addr, header, _a3) 78 79 var r0 *flow.Account 80 var r1 error 81 if rf, ok := ret.Get(0).(func(context.Context, flow.Address, *flow.Header, snapshot.StorageSnapshot) (*flow.Account, error)); ok { 82 return rf(ctx, addr, header, _a3) 83 } 84 if rf, ok := ret.Get(0).(func(context.Context, flow.Address, *flow.Header, snapshot.StorageSnapshot) *flow.Account); ok { 85 r0 = rf(ctx, addr, header, _a3) 86 } else { 87 if ret.Get(0) != nil { 88 r0 = ret.Get(0).(*flow.Account) 89 } 90 } 91 92 if rf, ok := ret.Get(1).(func(context.Context, flow.Address, *flow.Header, snapshot.StorageSnapshot) error); ok { 93 r1 = rf(ctx, addr, header, _a3) 94 } else { 95 r1 = ret.Error(1) 96 } 97 98 return r0, r1 99 } 100 101 type mockConstructorTestingTNewComputationManager interface { 102 mock.TestingT 103 Cleanup(func()) 104 } 105 106 // NewComputationManager creates a new instance of ComputationManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 107 func NewComputationManager(t mockConstructorTestingTNewComputationManager) *ComputationManager { 108 mock := &ComputationManager{} 109 mock.Mock.Test(t) 110 111 t.Cleanup(func() { mock.AssertExpectations(t) }) 112 113 return mock 114 }