github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/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, uint64, error) { 51 ret := _m.Called(ctx, script, arguments, blockHeader, _a4) 52 53 var r0 []byte 54 var r1 uint64 55 var r2 error 56 if rf, ok := ret.Get(0).(func(context.Context, []byte, [][]byte, *flow.Header, snapshot.StorageSnapshot) ([]byte, uint64, error)); ok { 57 return rf(ctx, script, arguments, blockHeader, _a4) 58 } 59 if rf, ok := ret.Get(0).(func(context.Context, []byte, [][]byte, *flow.Header, snapshot.StorageSnapshot) []byte); ok { 60 r0 = rf(ctx, script, arguments, blockHeader, _a4) 61 } else { 62 if ret.Get(0) != nil { 63 r0 = ret.Get(0).([]byte) 64 } 65 } 66 67 if rf, ok := ret.Get(1).(func(context.Context, []byte, [][]byte, *flow.Header, snapshot.StorageSnapshot) uint64); ok { 68 r1 = rf(ctx, script, arguments, blockHeader, _a4) 69 } else { 70 r1 = ret.Get(1).(uint64) 71 } 72 73 if rf, ok := ret.Get(2).(func(context.Context, []byte, [][]byte, *flow.Header, snapshot.StorageSnapshot) error); ok { 74 r2 = rf(ctx, script, arguments, blockHeader, _a4) 75 } else { 76 r2 = ret.Error(2) 77 } 78 79 return r0, r1, r2 80 } 81 82 // GetAccount provides a mock function with given fields: ctx, addr, header, _a3 83 func (_m *ComputationManager) GetAccount(ctx context.Context, addr flow.Address, header *flow.Header, _a3 snapshot.StorageSnapshot) (*flow.Account, error) { 84 ret := _m.Called(ctx, addr, header, _a3) 85 86 var r0 *flow.Account 87 var r1 error 88 if rf, ok := ret.Get(0).(func(context.Context, flow.Address, *flow.Header, snapshot.StorageSnapshot) (*flow.Account, error)); ok { 89 return rf(ctx, addr, header, _a3) 90 } 91 if rf, ok := ret.Get(0).(func(context.Context, flow.Address, *flow.Header, snapshot.StorageSnapshot) *flow.Account); ok { 92 r0 = rf(ctx, addr, header, _a3) 93 } else { 94 if ret.Get(0) != nil { 95 r0 = ret.Get(0).(*flow.Account) 96 } 97 } 98 99 if rf, ok := ret.Get(1).(func(context.Context, flow.Address, *flow.Header, snapshot.StorageSnapshot) error); ok { 100 r1 = rf(ctx, addr, header, _a3) 101 } else { 102 r1 = ret.Error(1) 103 } 104 105 return r0, r1 106 } 107 108 type mockConstructorTestingTNewComputationManager interface { 109 mock.TestingT 110 Cleanup(func()) 111 } 112 113 // 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. 114 func NewComputationManager(t mockConstructorTestingTNewComputationManager) *ComputationManager { 115 mock := &ComputationManager{} 116 mock.Mock.Test(t) 117 118 t.Cleanup(func() { mock.AssertExpectations(t) }) 119 120 return mock 121 }