-
Notifications
You must be signed in to change notification settings - Fork 264
Expand file tree
/
Copy pathstore.go
More file actions
933 lines (812 loc) · 25.6 KB
/
store.go
File metadata and controls
933 lines (812 loc) · 25.6 KB
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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"context"
"github.com/evstack/ev-node/pkg/store"
"github.com/evstack/ev-node/types"
mock "github.com/stretchr/testify/mock"
)
// NewMockStore creates a new instance of MockStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockStore(t interface {
mock.TestingT
Cleanup(func())
}) *MockStore {
mock := &MockStore{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockStore is an autogenerated mock type for the Store type
type MockStore struct {
mock.Mock
}
type MockStore_Expecter struct {
mock *mock.Mock
}
func (_m *MockStore) EXPECT() *MockStore_Expecter {
return &MockStore_Expecter{mock: &_m.Mock}
}
// Close provides a mock function for the type MockStore
func (_mock *MockStore) Close() error {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for Close")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func() error); ok {
r0 = returnFunc()
} else {
r0 = ret.Error(0)
}
return r0
}
// MockStore_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
type MockStore_Close_Call struct {
*mock.Call
}
// Close is a helper method to define mock.On call
func (_e *MockStore_Expecter) Close() *MockStore_Close_Call {
return &MockStore_Close_Call{Call: _e.mock.On("Close")}
}
func (_c *MockStore_Close_Call) Run(run func()) *MockStore_Close_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockStore_Close_Call) Return(err error) *MockStore_Close_Call {
_c.Call.Return(err)
return _c
}
func (_c *MockStore_Close_Call) RunAndReturn(run func() error) *MockStore_Close_Call {
_c.Call.Return(run)
return _c
}
// GetBlockByHash provides a mock function for the type MockStore
func (_mock *MockStore) GetBlockByHash(ctx context.Context, hash []byte) (*types.SignedHeader, *types.Data, error) {
ret := _mock.Called(ctx, hash)
if len(ret) == 0 {
panic("no return value specified for GetBlockByHash")
}
var r0 *types.SignedHeader
var r1 *types.Data
var r2 error
if returnFunc, ok := ret.Get(0).(func(context.Context, []byte) (*types.SignedHeader, *types.Data, error)); ok {
return returnFunc(ctx, hash)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, []byte) *types.SignedHeader); ok {
r0 = returnFunc(ctx, hash)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.SignedHeader)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, []byte) *types.Data); ok {
r1 = returnFunc(ctx, hash)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*types.Data)
}
}
if returnFunc, ok := ret.Get(2).(func(context.Context, []byte) error); ok {
r2 = returnFunc(ctx, hash)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// MockStore_GetBlockByHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlockByHash'
type MockStore_GetBlockByHash_Call struct {
*mock.Call
}
// GetBlockByHash is a helper method to define mock.On call
// - ctx context.Context
// - hash []byte
func (_e *MockStore_Expecter) GetBlockByHash(ctx interface{}, hash interface{}) *MockStore_GetBlockByHash_Call {
return &MockStore_GetBlockByHash_Call{Call: _e.mock.On("GetBlockByHash", ctx, hash)}
}
func (_c *MockStore_GetBlockByHash_Call) Run(run func(ctx context.Context, hash []byte)) *MockStore_GetBlockByHash_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 []byte
if args[1] != nil {
arg1 = args[1].([]byte)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockStore_GetBlockByHash_Call) Return(signedHeader *types.SignedHeader, data *types.Data, err error) *MockStore_GetBlockByHash_Call {
_c.Call.Return(signedHeader, data, err)
return _c
}
func (_c *MockStore_GetBlockByHash_Call) RunAndReturn(run func(ctx context.Context, hash []byte) (*types.SignedHeader, *types.Data, error)) *MockStore_GetBlockByHash_Call {
_c.Call.Return(run)
return _c
}
// GetBlockData provides a mock function for the type MockStore
func (_mock *MockStore) GetBlockData(ctx context.Context, height uint64) (*types.SignedHeader, *types.Data, error) {
ret := _mock.Called(ctx, height)
if len(ret) == 0 {
panic("no return value specified for GetBlockData")
}
var r0 *types.SignedHeader
var r1 *types.Data
var r2 error
if returnFunc, ok := ret.Get(0).(func(context.Context, uint64) (*types.SignedHeader, *types.Data, error)); ok {
return returnFunc(ctx, height)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, uint64) *types.SignedHeader); ok {
r0 = returnFunc(ctx, height)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.SignedHeader)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, uint64) *types.Data); ok {
r1 = returnFunc(ctx, height)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*types.Data)
}
}
if returnFunc, ok := ret.Get(2).(func(context.Context, uint64) error); ok {
r2 = returnFunc(ctx, height)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// MockStore_GetBlockData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlockData'
type MockStore_GetBlockData_Call struct {
*mock.Call
}
// GetBlockData is a helper method to define mock.On call
// - ctx context.Context
// - height uint64
func (_e *MockStore_Expecter) GetBlockData(ctx interface{}, height interface{}) *MockStore_GetBlockData_Call {
return &MockStore_GetBlockData_Call{Call: _e.mock.On("GetBlockData", ctx, height)}
}
func (_c *MockStore_GetBlockData_Call) Run(run func(ctx context.Context, height uint64)) *MockStore_GetBlockData_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 uint64
if args[1] != nil {
arg1 = args[1].(uint64)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockStore_GetBlockData_Call) Return(signedHeader *types.SignedHeader, data *types.Data, err error) *MockStore_GetBlockData_Call {
_c.Call.Return(signedHeader, data, err)
return _c
}
func (_c *MockStore_GetBlockData_Call) RunAndReturn(run func(ctx context.Context, height uint64) (*types.SignedHeader, *types.Data, error)) *MockStore_GetBlockData_Call {
_c.Call.Return(run)
return _c
}
// GetHeader provides a mock function for the type MockStore
func (_mock *MockStore) GetHeader(ctx context.Context, height uint64) (*types.SignedHeader, error) {
ret := _mock.Called(ctx, height)
if len(ret) == 0 {
panic("no return value specified for GetHeader")
}
var r0 *types.SignedHeader
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, uint64) (*types.SignedHeader, error)); ok {
return returnFunc(ctx, height)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, uint64) *types.SignedHeader); ok {
r0 = returnFunc(ctx, height)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.SignedHeader)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, uint64) error); ok {
r1 = returnFunc(ctx, height)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockStore_GetHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetHeader'
type MockStore_GetHeader_Call struct {
*mock.Call
}
// GetHeader is a helper method to define mock.On call
// - ctx context.Context
// - height uint64
func (_e *MockStore_Expecter) GetHeader(ctx interface{}, height interface{}) *MockStore_GetHeader_Call {
return &MockStore_GetHeader_Call{Call: _e.mock.On("GetHeader", ctx, height)}
}
func (_c *MockStore_GetHeader_Call) Run(run func(ctx context.Context, height uint64)) *MockStore_GetHeader_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 uint64
if args[1] != nil {
arg1 = args[1].(uint64)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockStore_GetHeader_Call) Return(signedHeader *types.SignedHeader, err error) *MockStore_GetHeader_Call {
_c.Call.Return(signedHeader, err)
return _c
}
func (_c *MockStore_GetHeader_Call) RunAndReturn(run func(ctx context.Context, height uint64) (*types.SignedHeader, error)) *MockStore_GetHeader_Call {
_c.Call.Return(run)
return _c
}
// GetMetadata provides a mock function for the type MockStore
func (_mock *MockStore) GetMetadata(ctx context.Context, key string) ([]byte, error) {
ret := _mock.Called(ctx, key)
if len(ret) == 0 {
panic("no return value specified for GetMetadata")
}
var r0 []byte
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]byte, error)); ok {
return returnFunc(ctx, key)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, string) []byte); ok {
r0 = returnFunc(ctx, key)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]byte)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = returnFunc(ctx, key)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockStore_GetMetadata_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMetadata'
type MockStore_GetMetadata_Call struct {
*mock.Call
}
// GetMetadata is a helper method to define mock.On call
// - ctx context.Context
// - key string
func (_e *MockStore_Expecter) GetMetadata(ctx interface{}, key interface{}) *MockStore_GetMetadata_Call {
return &MockStore_GetMetadata_Call{Call: _e.mock.On("GetMetadata", ctx, key)}
}
func (_c *MockStore_GetMetadata_Call) Run(run func(ctx context.Context, key string)) *MockStore_GetMetadata_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockStore_GetMetadata_Call) Return(bytes []byte, err error) *MockStore_GetMetadata_Call {
_c.Call.Return(bytes, err)
return _c
}
func (_c *MockStore_GetMetadata_Call) RunAndReturn(run func(ctx context.Context, key string) ([]byte, error)) *MockStore_GetMetadata_Call {
_c.Call.Return(run)
return _c
}
// GetSignature provides a mock function for the type MockStore
func (_mock *MockStore) GetSignature(ctx context.Context, height uint64) (*types.Signature, error) {
ret := _mock.Called(ctx, height)
if len(ret) == 0 {
panic("no return value specified for GetSignature")
}
var r0 *types.Signature
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, uint64) (*types.Signature, error)); ok {
return returnFunc(ctx, height)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, uint64) *types.Signature); ok {
r0 = returnFunc(ctx, height)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.Signature)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, uint64) error); ok {
r1 = returnFunc(ctx, height)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockStore_GetSignature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSignature'
type MockStore_GetSignature_Call struct {
*mock.Call
}
// GetSignature is a helper method to define mock.On call
// - ctx context.Context
// - height uint64
func (_e *MockStore_Expecter) GetSignature(ctx interface{}, height interface{}) *MockStore_GetSignature_Call {
return &MockStore_GetSignature_Call{Call: _e.mock.On("GetSignature", ctx, height)}
}
func (_c *MockStore_GetSignature_Call) Run(run func(ctx context.Context, height uint64)) *MockStore_GetSignature_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 uint64
if args[1] != nil {
arg1 = args[1].(uint64)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockStore_GetSignature_Call) Return(signature *types.Signature, err error) *MockStore_GetSignature_Call {
_c.Call.Return(signature, err)
return _c
}
func (_c *MockStore_GetSignature_Call) RunAndReturn(run func(ctx context.Context, height uint64) (*types.Signature, error)) *MockStore_GetSignature_Call {
_c.Call.Return(run)
return _c
}
// GetSignatureByHash provides a mock function for the type MockStore
func (_mock *MockStore) GetSignatureByHash(ctx context.Context, hash []byte) (*types.Signature, error) {
ret := _mock.Called(ctx, hash)
if len(ret) == 0 {
panic("no return value specified for GetSignatureByHash")
}
var r0 *types.Signature
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, []byte) (*types.Signature, error)); ok {
return returnFunc(ctx, hash)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, []byte) *types.Signature); ok {
r0 = returnFunc(ctx, hash)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.Signature)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, []byte) error); ok {
r1 = returnFunc(ctx, hash)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockStore_GetSignatureByHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSignatureByHash'
type MockStore_GetSignatureByHash_Call struct {
*mock.Call
}
// GetSignatureByHash is a helper method to define mock.On call
// - ctx context.Context
// - hash []byte
func (_e *MockStore_Expecter) GetSignatureByHash(ctx interface{}, hash interface{}) *MockStore_GetSignatureByHash_Call {
return &MockStore_GetSignatureByHash_Call{Call: _e.mock.On("GetSignatureByHash", ctx, hash)}
}
func (_c *MockStore_GetSignatureByHash_Call) Run(run func(ctx context.Context, hash []byte)) *MockStore_GetSignatureByHash_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 []byte
if args[1] != nil {
arg1 = args[1].([]byte)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockStore_GetSignatureByHash_Call) Return(signature *types.Signature, err error) *MockStore_GetSignatureByHash_Call {
_c.Call.Return(signature, err)
return _c
}
func (_c *MockStore_GetSignatureByHash_Call) RunAndReturn(run func(ctx context.Context, hash []byte) (*types.Signature, error)) *MockStore_GetSignatureByHash_Call {
_c.Call.Return(run)
return _c
}
// GetState provides a mock function for the type MockStore
func (_mock *MockStore) GetState(ctx context.Context) (types.State, error) {
ret := _mock.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for GetState")
}
var r0 types.State
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context) (types.State, error)); ok {
return returnFunc(ctx)
}
if returnFunc, ok := ret.Get(0).(func(context.Context) types.State); ok {
r0 = returnFunc(ctx)
} else {
r0 = ret.Get(0).(types.State)
}
if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = returnFunc(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockStore_GetState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetState'
type MockStore_GetState_Call struct {
*mock.Call
}
// GetState is a helper method to define mock.On call
// - ctx context.Context
func (_e *MockStore_Expecter) GetState(ctx interface{}) *MockStore_GetState_Call {
return &MockStore_GetState_Call{Call: _e.mock.On("GetState", ctx)}
}
func (_c *MockStore_GetState_Call) Run(run func(ctx context.Context)) *MockStore_GetState_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
run(
arg0,
)
})
return _c
}
func (_c *MockStore_GetState_Call) Return(state types.State, err error) *MockStore_GetState_Call {
_c.Call.Return(state, err)
return _c
}
func (_c *MockStore_GetState_Call) RunAndReturn(run func(ctx context.Context) (types.State, error)) *MockStore_GetState_Call {
_c.Call.Return(run)
return _c
}
// GetStateAtHeight provides a mock function for the type MockStore
func (_mock *MockStore) GetStateAtHeight(ctx context.Context, height uint64) (types.State, error) {
ret := _mock.Called(ctx, height)
if len(ret) == 0 {
panic("no return value specified for GetStateAtHeight")
}
var r0 types.State
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, uint64) (types.State, error)); ok {
return returnFunc(ctx, height)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, uint64) types.State); ok {
r0 = returnFunc(ctx, height)
} else {
r0 = ret.Get(0).(types.State)
}
if returnFunc, ok := ret.Get(1).(func(context.Context, uint64) error); ok {
r1 = returnFunc(ctx, height)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockStore_GetStateAtHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStateAtHeight'
type MockStore_GetStateAtHeight_Call struct {
*mock.Call
}
// GetStateAtHeight is a helper method to define mock.On call
// - ctx context.Context
// - height uint64
func (_e *MockStore_Expecter) GetStateAtHeight(ctx interface{}, height interface{}) *MockStore_GetStateAtHeight_Call {
return &MockStore_GetStateAtHeight_Call{Call: _e.mock.On("GetStateAtHeight", ctx, height)}
}
func (_c *MockStore_GetStateAtHeight_Call) Run(run func(ctx context.Context, height uint64)) *MockStore_GetStateAtHeight_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 uint64
if args[1] != nil {
arg1 = args[1].(uint64)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockStore_GetStateAtHeight_Call) Return(state types.State, err error) *MockStore_GetStateAtHeight_Call {
_c.Call.Return(state, err)
return _c
}
func (_c *MockStore_GetStateAtHeight_Call) RunAndReturn(run func(ctx context.Context, height uint64) (types.State, error)) *MockStore_GetStateAtHeight_Call {
_c.Call.Return(run)
return _c
}
// Height provides a mock function for the type MockStore
func (_mock *MockStore) Height(ctx context.Context) (uint64, error) {
ret := _mock.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for Height")
}
var r0 uint64
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context) (uint64, error)); ok {
return returnFunc(ctx)
}
if returnFunc, ok := ret.Get(0).(func(context.Context) uint64); ok {
r0 = returnFunc(ctx)
} else {
r0 = ret.Get(0).(uint64)
}
if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = returnFunc(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockStore_Height_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Height'
type MockStore_Height_Call struct {
*mock.Call
}
// Height is a helper method to define mock.On call
// - ctx context.Context
func (_e *MockStore_Expecter) Height(ctx interface{}) *MockStore_Height_Call {
return &MockStore_Height_Call{Call: _e.mock.On("Height", ctx)}
}
func (_c *MockStore_Height_Call) Run(run func(ctx context.Context)) *MockStore_Height_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
run(
arg0,
)
})
return _c
}
func (_c *MockStore_Height_Call) Return(v uint64, err error) *MockStore_Height_Call {
_c.Call.Return(v, err)
return _c
}
func (_c *MockStore_Height_Call) RunAndReturn(run func(ctx context.Context) (uint64, error)) *MockStore_Height_Call {
_c.Call.Return(run)
return _c
}
// NewBatch provides a mock function for the type MockStore
func (_mock *MockStore) NewBatch(ctx context.Context) (store.Batch, error) {
ret := _mock.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for NewBatch")
}
var r0 store.Batch
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context) (store.Batch, error)); ok {
return returnFunc(ctx)
}
if returnFunc, ok := ret.Get(0).(func(context.Context) store.Batch); ok {
r0 = returnFunc(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(store.Batch)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = returnFunc(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockStore_NewBatch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewBatch'
type MockStore_NewBatch_Call struct {
*mock.Call
}
// NewBatch is a helper method to define mock.On call
// - ctx context.Context
func (_e *MockStore_Expecter) NewBatch(ctx interface{}) *MockStore_NewBatch_Call {
return &MockStore_NewBatch_Call{Call: _e.mock.On("NewBatch", ctx)}
}
func (_c *MockStore_NewBatch_Call) Run(run func(ctx context.Context)) *MockStore_NewBatch_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
run(
arg0,
)
})
return _c
}
func (_c *MockStore_NewBatch_Call) Return(batch store.Batch, err error) *MockStore_NewBatch_Call {
_c.Call.Return(batch, err)
return _c
}
func (_c *MockStore_NewBatch_Call) RunAndReturn(run func(ctx context.Context) (store.Batch, error)) *MockStore_NewBatch_Call {
_c.Call.Return(run)
return _c
}
// Rollback provides a mock function for the type MockStore
func (_mock *MockStore) Rollback(ctx context.Context, height uint64, aggregator bool) error {
ret := _mock.Called(ctx, height, aggregator)
if len(ret) == 0 {
panic("no return value specified for Rollback")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(context.Context, uint64, bool) error); ok {
r0 = returnFunc(ctx, height, aggregator)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockStore_Rollback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Rollback'
type MockStore_Rollback_Call struct {
*mock.Call
}
// Rollback is a helper method to define mock.On call
// - ctx context.Context
// - height uint64
// - aggregator bool
func (_e *MockStore_Expecter) Rollback(ctx interface{}, height interface{}, aggregator interface{}) *MockStore_Rollback_Call {
return &MockStore_Rollback_Call{Call: _e.mock.On("Rollback", ctx, height, aggregator)}
}
func (_c *MockStore_Rollback_Call) Run(run func(ctx context.Context, height uint64, aggregator bool)) *MockStore_Rollback_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 uint64
if args[1] != nil {
arg1 = args[1].(uint64)
}
var arg2 bool
if args[2] != nil {
arg2 = args[2].(bool)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *MockStore_Rollback_Call) Return(err error) *MockStore_Rollback_Call {
_c.Call.Return(err)
return _c
}
func (_c *MockStore_Rollback_Call) RunAndReturn(run func(ctx context.Context, height uint64, aggregator bool) error) *MockStore_Rollback_Call {
_c.Call.Return(run)
return _c
}
// SetMetadata provides a mock function for the type MockStore
func (_mock *MockStore) SetMetadata(ctx context.Context, key string, value []byte) error {
ret := _mock.Called(ctx, key, value)
if len(ret) == 0 {
panic("no return value specified for SetMetadata")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string, []byte) error); ok {
r0 = returnFunc(ctx, key, value)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockStore_SetMetadata_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetMetadata'
type MockStore_SetMetadata_Call struct {
*mock.Call
}
// SetMetadata is a helper method to define mock.On call
// - ctx context.Context
// - key string
// - value []byte
func (_e *MockStore_Expecter) SetMetadata(ctx interface{}, key interface{}, value interface{}) *MockStore_SetMetadata_Call {
return &MockStore_SetMetadata_Call{Call: _e.mock.On("SetMetadata", ctx, key, value)}
}
func (_c *MockStore_SetMetadata_Call) Run(run func(ctx context.Context, key string, value []byte)) *MockStore_SetMetadata_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
var arg2 []byte
if args[2] != nil {
arg2 = args[2].([]byte)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *MockStore_SetMetadata_Call) Return(err error) *MockStore_SetMetadata_Call {
_c.Call.Return(err)
return _c
}
func (_c *MockStore_SetMetadata_Call) RunAndReturn(run func(ctx context.Context, key string, value []byte) error) *MockStore_SetMetadata_Call {
_c.Call.Return(run)
return _c
}
// Sync provides a mock function for the type MockStore
func (_mock *MockStore) Sync(ctx context.Context) error {
ret := _mock.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for Sync")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok {
r0 = returnFunc(ctx)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockStore_Sync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sync'
type MockStore_Sync_Call struct {
*mock.Call
}
// Sync is a helper method to define mock.On call
// - ctx context.Context
func (_e *MockStore_Expecter) Sync(ctx interface{}) *MockStore_Sync_Call {
return &MockStore_Sync_Call{Call: _e.mock.On("Sync", ctx)}
}
func (_c *MockStore_Sync_Call) Run(run func(ctx context.Context)) *MockStore_Sync_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
run(
arg0,
)
})
return _c
}
func (_c *MockStore_Sync_Call) Return(err error) *MockStore_Sync_Call {
_c.Call.Return(err)
return _c
}
func (_c *MockStore_Sync_Call) RunAndReturn(run func(ctx context.Context) error) *MockStore_Sync_Call {
_c.Call.Return(run)
return _c
}