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