-
Notifications
You must be signed in to change notification settings - Fork 49
/
store.go
232 lines (199 loc) · 8.41 KB
/
store.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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/onflow/flow-emulator/storage (interfaces: Store)
//
// Generated by this command:
//
// mockgen -destination=storage/mocks/store.go -package=mocks github.com/onflow/flow-emulator/storage Store
//
// Package mocks is a generated GoMock package.
package mocks
import (
context "context"
reflect "reflect"
types "github.com/onflow/flow-emulator/types"
snapshot "github.com/onflow/flow-go/fvm/storage/snapshot"
flow "github.com/onflow/flow-go/model/flow"
gomock "go.uber.org/mock/gomock"
)
// MockStore is a mock of Store interface.
type MockStore struct {
ctrl *gomock.Controller
recorder *MockStoreMockRecorder
}
// MockStoreMockRecorder is the mock recorder for MockStore.
type MockStoreMockRecorder struct {
mock *MockStore
}
// NewMockStore creates a new mock instance.
func NewMockStore(ctrl *gomock.Controller) *MockStore {
mock := &MockStore{ctrl: ctrl}
mock.recorder = &MockStoreMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockStore) EXPECT() *MockStoreMockRecorder {
return m.recorder
}
// BlockByHeight mocks base method.
func (m *MockStore) BlockByHeight(arg0 context.Context, arg1 uint64) (*flow.Block, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "BlockByHeight", arg0, arg1)
ret0, _ := ret[0].(*flow.Block)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// BlockByHeight indicates an expected call of BlockByHeight.
func (mr *MockStoreMockRecorder) BlockByHeight(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockByHeight", reflect.TypeOf((*MockStore)(nil).BlockByHeight), arg0, arg1)
}
// BlockByID mocks base method.
func (m *MockStore) BlockByID(arg0 context.Context, arg1 flow.Identifier) (*flow.Block, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "BlockByID", arg0, arg1)
ret0, _ := ret[0].(*flow.Block)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// BlockByID indicates an expected call of BlockByID.
func (mr *MockStoreMockRecorder) BlockByID(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockByID", reflect.TypeOf((*MockStore)(nil).BlockByID), arg0, arg1)
}
// CollectionByID mocks base method.
func (m *MockStore) CollectionByID(arg0 context.Context, arg1 flow.Identifier) (flow.LightCollection, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CollectionByID", arg0, arg1)
ret0, _ := ret[0].(flow.LightCollection)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// CollectionByID indicates an expected call of CollectionByID.
func (mr *MockStoreMockRecorder) CollectionByID(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CollectionByID", reflect.TypeOf((*MockStore)(nil).CollectionByID), arg0, arg1)
}
// CommitBlock mocks base method.
func (m *MockStore) CommitBlock(arg0 context.Context, arg1 flow.Block, arg2 []*flow.LightCollection, arg3 map[flow.Identifier]*flow.TransactionBody, arg4 map[flow.Identifier]*types.StorableTransactionResult, arg5 *snapshot.ExecutionSnapshot, arg6 []flow.Event) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CommitBlock", arg0, arg1, arg2, arg3, arg4, arg5, arg6)
ret0, _ := ret[0].(error)
return ret0
}
// CommitBlock indicates an expected call of CommitBlock.
func (mr *MockStoreMockRecorder) CommitBlock(arg0, arg1, arg2, arg3, arg4, arg5, arg6 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CommitBlock", reflect.TypeOf((*MockStore)(nil).CommitBlock), arg0, arg1, arg2, arg3, arg4, arg5, arg6)
}
// EventsByHeight mocks base method.
func (m *MockStore) EventsByHeight(arg0 context.Context, arg1 uint64, arg2 string) ([]flow.Event, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "EventsByHeight", arg0, arg1, arg2)
ret0, _ := ret[0].([]flow.Event)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// EventsByHeight indicates an expected call of EventsByHeight.
func (mr *MockStoreMockRecorder) EventsByHeight(arg0, arg1, arg2 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EventsByHeight", reflect.TypeOf((*MockStore)(nil).EventsByHeight), arg0, arg1, arg2)
}
// LatestBlock mocks base method.
func (m *MockStore) LatestBlock(arg0 context.Context) (flow.Block, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LatestBlock", arg0)
ret0, _ := ret[0].(flow.Block)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LatestBlock indicates an expected call of LatestBlock.
func (mr *MockStoreMockRecorder) LatestBlock(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LatestBlock", reflect.TypeOf((*MockStore)(nil).LatestBlock), arg0)
}
// LatestBlockHeight mocks base method.
func (m *MockStore) LatestBlockHeight(arg0 context.Context) (uint64, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LatestBlockHeight", arg0)
ret0, _ := ret[0].(uint64)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LatestBlockHeight indicates an expected call of LatestBlockHeight.
func (mr *MockStoreMockRecorder) LatestBlockHeight(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LatestBlockHeight", reflect.TypeOf((*MockStore)(nil).LatestBlockHeight), arg0)
}
// LedgerByHeight mocks base method.
func (m *MockStore) LedgerByHeight(arg0 context.Context, arg1 uint64) (snapshot.StorageSnapshot, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LedgerByHeight", arg0, arg1)
ret0, _ := ret[0].(snapshot.StorageSnapshot)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LedgerByHeight indicates an expected call of LedgerByHeight.
func (mr *MockStoreMockRecorder) LedgerByHeight(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LedgerByHeight", reflect.TypeOf((*MockStore)(nil).LedgerByHeight), arg0, arg1)
}
// Start mocks base method.
func (m *MockStore) Start() error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Start")
ret0, _ := ret[0].(error)
return ret0
}
// Start indicates an expected call of Start.
func (mr *MockStoreMockRecorder) Start() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockStore)(nil).Start))
}
// Stop mocks base method.
func (m *MockStore) Stop() {
m.ctrl.T.Helper()
m.ctrl.Call(m, "Stop")
}
// Stop indicates an expected call of Stop.
func (mr *MockStoreMockRecorder) Stop() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stop", reflect.TypeOf((*MockStore)(nil).Stop))
}
// StoreBlock mocks base method.
func (m *MockStore) StoreBlock(arg0 context.Context, arg1 *flow.Block) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "StoreBlock", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// StoreBlock indicates an expected call of StoreBlock.
func (mr *MockStoreMockRecorder) StoreBlock(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StoreBlock", reflect.TypeOf((*MockStore)(nil).StoreBlock), arg0, arg1)
}
// TransactionByID mocks base method.
func (m *MockStore) TransactionByID(arg0 context.Context, arg1 flow.Identifier) (flow.TransactionBody, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "TransactionByID", arg0, arg1)
ret0, _ := ret[0].(flow.TransactionBody)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// TransactionByID indicates an expected call of TransactionByID.
func (mr *MockStoreMockRecorder) TransactionByID(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TransactionByID", reflect.TypeOf((*MockStore)(nil).TransactionByID), arg0, arg1)
}
// TransactionResultByID mocks base method.
func (m *MockStore) TransactionResultByID(arg0 context.Context, arg1 flow.Identifier) (types.StorableTransactionResult, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "TransactionResultByID", arg0, arg1)
ret0, _ := ret[0].(types.StorableTransactionResult)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// TransactionResultByID indicates an expected call of TransactionResultByID.
func (mr *MockStoreMockRecorder) TransactionResultByID(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TransactionResultByID", reflect.TypeOf((*MockStore)(nil).TransactionResultByID), arg0, arg1)
}