-
Notifications
You must be signed in to change notification settings - Fork 178
/
view.go
171 lines (136 loc) · 3.49 KB
/
view.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
// Code generated by mockery v2.13.1. DO NOT EDIT.
package mock
import (
flow "github.com/onflow/flow-go/model/flow"
mock "github.com/stretchr/testify/mock"
state "github.com/onflow/flow-go/fvm/state"
)
// View is an autogenerated mock type for the View type
type View struct {
mock.Mock
}
// AllRegisters provides a mock function with given fields:
func (_m *View) AllRegisters() []flow.RegisterID {
ret := _m.Called()
var r0 []flow.RegisterID
if rf, ok := ret.Get(0).(func() []flow.RegisterID); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]flow.RegisterID)
}
}
return r0
}
// Delete provides a mock function with given fields: owner, key
func (_m *View) Delete(owner string, key string) error {
ret := _m.Called(owner, key)
var r0 error
if rf, ok := ret.Get(0).(func(string, string) error); ok {
r0 = rf(owner, key)
} else {
r0 = ret.Error(0)
}
return r0
}
// DropDelta provides a mock function with given fields:
func (_m *View) DropDelta() {
_m.Called()
}
// Get provides a mock function with given fields: owner, key
func (_m *View) Get(owner string, key string) ([]byte, error) {
ret := _m.Called(owner, key)
var r0 []byte
if rf, ok := ret.Get(0).(func(string, string) []byte); ok {
r0 = rf(owner, key)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]byte)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(string, string) error); ok {
r1 = rf(owner, key)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MergeView provides a mock function with given fields: child
func (_m *View) MergeView(child state.View) error {
ret := _m.Called(child)
var r0 error
if rf, ok := ret.Get(0).(func(state.View) error); ok {
r0 = rf(child)
} else {
r0 = ret.Error(0)
}
return r0
}
// NewChild provides a mock function with given fields:
func (_m *View) NewChild() state.View {
ret := _m.Called()
var r0 state.View
if rf, ok := ret.Get(0).(func() state.View); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(state.View)
}
}
return r0
}
// RegisterUpdates provides a mock function with given fields:
func (_m *View) RegisterUpdates() ([]flow.RegisterID, [][]byte) {
ret := _m.Called()
var r0 []flow.RegisterID
if rf, ok := ret.Get(0).(func() []flow.RegisterID); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]flow.RegisterID)
}
}
var r1 [][]byte
if rf, ok := ret.Get(1).(func() [][]byte); ok {
r1 = rf()
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).([][]byte)
}
}
return r0, r1
}
// Set provides a mock function with given fields: owner, key, value
func (_m *View) Set(owner string, key string, value []byte) error {
ret := _m.Called(owner, key, value)
var r0 error
if rf, ok := ret.Get(0).(func(string, string, []byte) error); ok {
r0 = rf(owner, key, value)
} else {
r0 = ret.Error(0)
}
return r0
}
// Touch provides a mock function with given fields: owner, key
func (_m *View) Touch(owner string, key string) error {
ret := _m.Called(owner, key)
var r0 error
if rf, ok := ret.Get(0).(func(string, string) error); ok {
r0 = rf(owner, key)
} else {
r0 = ret.Error(0)
}
return r0
}
type mockConstructorTestingTNewView interface {
mock.TestingT
Cleanup(func())
}
// NewView creates a new instance of View. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewView(t mockConstructorTestingTNewView) *View {
mock := &View{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}