-
Notifications
You must be signed in to change notification settings - Fork 629
/
state_interfacer.go
149 lines (119 loc) · 5.2 KB
/
state_interfacer.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
// Code generated by mockery. DO NOT EDIT.
package mock_l1_check_block
import (
context "context"
mock "github.com/stretchr/testify/mock"
pgx "github.com/jackc/pgx/v4"
state "github.com/0xPolygonHermez/zkevm-node/state"
)
// StateInterfacer is an autogenerated mock type for the StateInterfacer type
type StateInterfacer struct {
mock.Mock
}
type StateInterfacer_Expecter struct {
mock *mock.Mock
}
func (_m *StateInterfacer) EXPECT() *StateInterfacer_Expecter {
return &StateInterfacer_Expecter{mock: &_m.Mock}
}
// GetFirstUncheckedBlock provides a mock function with given fields: ctx, fromBlockNumber, dbTx
func (_m *StateInterfacer) GetFirstUncheckedBlock(ctx context.Context, fromBlockNumber uint64, dbTx pgx.Tx) (*state.Block, error) {
ret := _m.Called(ctx, fromBlockNumber, dbTx)
if len(ret) == 0 {
panic("no return value specified for GetFirstUncheckedBlock")
}
var r0 *state.Block
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) (*state.Block, error)); ok {
return rf(ctx, fromBlockNumber, dbTx)
}
if rf, ok := ret.Get(0).(func(context.Context, uint64, pgx.Tx) *state.Block); ok {
r0 = rf(ctx, fromBlockNumber, dbTx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*state.Block)
}
}
if rf, ok := ret.Get(1).(func(context.Context, uint64, pgx.Tx) error); ok {
r1 = rf(ctx, fromBlockNumber, dbTx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// StateInterfacer_GetFirstUncheckedBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFirstUncheckedBlock'
type StateInterfacer_GetFirstUncheckedBlock_Call struct {
*mock.Call
}
// GetFirstUncheckedBlock is a helper method to define mock.On call
// - ctx context.Context
// - fromBlockNumber uint64
// - dbTx pgx.Tx
func (_e *StateInterfacer_Expecter) GetFirstUncheckedBlock(ctx interface{}, fromBlockNumber interface{}, dbTx interface{}) *StateInterfacer_GetFirstUncheckedBlock_Call {
return &StateInterfacer_GetFirstUncheckedBlock_Call{Call: _e.mock.On("GetFirstUncheckedBlock", ctx, fromBlockNumber, dbTx)}
}
func (_c *StateInterfacer_GetFirstUncheckedBlock_Call) Run(run func(ctx context.Context, fromBlockNumber uint64, dbTx pgx.Tx)) *StateInterfacer_GetFirstUncheckedBlock_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint64), args[2].(pgx.Tx))
})
return _c
}
func (_c *StateInterfacer_GetFirstUncheckedBlock_Call) Return(_a0 *state.Block, _a1 error) *StateInterfacer_GetFirstUncheckedBlock_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *StateInterfacer_GetFirstUncheckedBlock_Call) RunAndReturn(run func(context.Context, uint64, pgx.Tx) (*state.Block, error)) *StateInterfacer_GetFirstUncheckedBlock_Call {
_c.Call.Return(run)
return _c
}
// UpdateCheckedBlockByNumber provides a mock function with given fields: ctx, blockNumber, newCheckedStatus, dbTx
func (_m *StateInterfacer) UpdateCheckedBlockByNumber(ctx context.Context, blockNumber uint64, newCheckedStatus bool, dbTx pgx.Tx) error {
ret := _m.Called(ctx, blockNumber, newCheckedStatus, dbTx)
if len(ret) == 0 {
panic("no return value specified for UpdateCheckedBlockByNumber")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, uint64, bool, pgx.Tx) error); ok {
r0 = rf(ctx, blockNumber, newCheckedStatus, dbTx)
} else {
r0 = ret.Error(0)
}
return r0
}
// StateInterfacer_UpdateCheckedBlockByNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateCheckedBlockByNumber'
type StateInterfacer_UpdateCheckedBlockByNumber_Call struct {
*mock.Call
}
// UpdateCheckedBlockByNumber is a helper method to define mock.On call
// - ctx context.Context
// - blockNumber uint64
// - newCheckedStatus bool
// - dbTx pgx.Tx
func (_e *StateInterfacer_Expecter) UpdateCheckedBlockByNumber(ctx interface{}, blockNumber interface{}, newCheckedStatus interface{}, dbTx interface{}) *StateInterfacer_UpdateCheckedBlockByNumber_Call {
return &StateInterfacer_UpdateCheckedBlockByNumber_Call{Call: _e.mock.On("UpdateCheckedBlockByNumber", ctx, blockNumber, newCheckedStatus, dbTx)}
}
func (_c *StateInterfacer_UpdateCheckedBlockByNumber_Call) Run(run func(ctx context.Context, blockNumber uint64, newCheckedStatus bool, dbTx pgx.Tx)) *StateInterfacer_UpdateCheckedBlockByNumber_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(uint64), args[2].(bool), args[3].(pgx.Tx))
})
return _c
}
func (_c *StateInterfacer_UpdateCheckedBlockByNumber_Call) Return(_a0 error) *StateInterfacer_UpdateCheckedBlockByNumber_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *StateInterfacer_UpdateCheckedBlockByNumber_Call) RunAndReturn(run func(context.Context, uint64, bool, pgx.Tx) error) *StateInterfacer_UpdateCheckedBlockByNumber_Call {
_c.Call.Return(run)
return _c
}
// NewStateInterfacer creates a new instance of StateInterfacer. 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 NewStateInterfacer(t interface {
mock.TestingT
Cleanup(func())
}) *StateInterfacer {
mock := &StateInterfacer{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}