-
Notifications
You must be signed in to change notification settings - Fork 179
/
executor.go
91 lines (73 loc) · 2.87 KB
/
executor.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
// Code generated by mockery v2.21.4. DO NOT EDIT.
package mock
import (
context "context"
flow "github.com/onflow/flow-go/model/flow"
mock "github.com/stretchr/testify/mock"
snapshot "github.com/onflow/flow-go/fvm/storage/snapshot"
)
// Executor is an autogenerated mock type for the Executor type
type Executor struct {
mock.Mock
}
// ExecuteScript provides a mock function with given fields: ctx, script, arguments, blockHeader, _a4
func (_m *Executor) ExecuteScript(ctx context.Context, script []byte, arguments [][]byte, blockHeader *flow.Header, _a4 snapshot.StorageSnapshot) ([]byte, uint64, error) {
ret := _m.Called(ctx, script, arguments, blockHeader, _a4)
var r0 []byte
var r1 uint64
var r2 error
if rf, ok := ret.Get(0).(func(context.Context, []byte, [][]byte, *flow.Header, snapshot.StorageSnapshot) ([]byte, uint64, 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) uint64); ok {
r1 = rf(ctx, script, arguments, blockHeader, _a4)
} else {
r1 = ret.Get(1).(uint64)
}
if rf, ok := ret.Get(2).(func(context.Context, []byte, [][]byte, *flow.Header, snapshot.StorageSnapshot) error); ok {
r2 = rf(ctx, script, arguments, blockHeader, _a4)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// GetAccount provides a mock function with given fields: ctx, addr, header, _a3
func (_m *Executor) 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 mockConstructorTestingTNewExecutor interface {
mock.TestingT
Cleanup(func())
}
// NewExecutor creates a new instance of Executor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewExecutor(t mockConstructorTestingTNewExecutor) *Executor {
mock := &Executor{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}