This repository has been archived by the owner on Feb 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 724
/
Copy pathmock_worker.go
170 lines (136 loc) · 5.01 KB
/
mock_worker.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
// Code generated by mockery v2.32.0. DO NOT EDIT.
package sequencer
import (
context "context"
big "math/big"
common "github.com/ethereum/go-ethereum/common"
mock "github.com/stretchr/testify/mock"
state "github.com/0xPolygonHermez/zkevm-node/state"
types "github.com/ethereum/go-ethereum/core/types"
)
// WorkerMock is an autogenerated mock type for the workerInterface type
type WorkerMock struct {
mock.Mock
}
// AddForcedTx provides a mock function with given fields: txHash, addr
func (_m *WorkerMock) AddForcedTx(txHash common.Hash, addr common.Address) {
_m.Called(txHash, addr)
}
// AddPendingTxToStore provides a mock function with given fields: txHash, addr
func (_m *WorkerMock) AddPendingTxToStore(txHash common.Hash, addr common.Address) {
_m.Called(txHash, addr)
}
// AddTxTracker provides a mock function with given fields: ctx, txTracker
func (_m *WorkerMock) AddTxTracker(ctx context.Context, txTracker *TxTracker) (*TxTracker, error) {
ret := _m.Called(ctx, txTracker)
var r0 *TxTracker
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *TxTracker) (*TxTracker, error)); ok {
return rf(ctx, txTracker)
}
if rf, ok := ret.Get(0).(func(context.Context, *TxTracker) *TxTracker); ok {
r0 = rf(ctx, txTracker)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*TxTracker)
}
}
if rf, ok := ret.Get(1).(func(context.Context, *TxTracker) error); ok {
r1 = rf(ctx, txTracker)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DeleteForcedTx provides a mock function with given fields: txHash, addr
func (_m *WorkerMock) DeleteForcedTx(txHash common.Hash, addr common.Address) {
_m.Called(txHash, addr)
}
// DeletePendingTxToStore provides a mock function with given fields: txHash, addr
func (_m *WorkerMock) DeletePendingTxToStore(txHash common.Hash, addr common.Address) {
_m.Called(txHash, addr)
}
// DeleteTx provides a mock function with given fields: txHash, from
func (_m *WorkerMock) DeleteTx(txHash common.Hash, from common.Address) {
_m.Called(txHash, from)
}
// GetBestFittingTx provides a mock function with given fields: resources
func (_m *WorkerMock) GetBestFittingTx(resources state.BatchResources) *TxTracker {
ret := _m.Called(resources)
var r0 *TxTracker
if rf, ok := ret.Get(0).(func(state.BatchResources) *TxTracker); ok {
r0 = rf(resources)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*TxTracker)
}
}
return r0
}
// HandleL2Reorg provides a mock function with given fields: txHashes
func (_m *WorkerMock) HandleL2Reorg(txHashes []common.Hash) {
_m.Called(txHashes)
}
// MoveTxToNotReady provides a mock function with given fields: txHash, from, actualNonce, actualBalance
func (_m *WorkerMock) MoveTxToNotReady(txHash common.Hash, from common.Address, actualNonce *uint64, actualBalance *big.Int) []*TxTracker {
ret := _m.Called(txHash, from, actualNonce, actualBalance)
var r0 []*TxTracker
if rf, ok := ret.Get(0).(func(common.Hash, common.Address, *uint64, *big.Int) []*TxTracker); ok {
r0 = rf(txHash, from, actualNonce, actualBalance)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*TxTracker)
}
}
return r0
}
// NewTxTracker provides a mock function with given fields: tx, counters, ip
func (_m *WorkerMock) NewTxTracker(tx types.Transaction, counters state.ZKCounters, ip string) (*TxTracker, error) {
ret := _m.Called(tx, counters, ip)
var r0 *TxTracker
var r1 error
if rf, ok := ret.Get(0).(func(types.Transaction, state.ZKCounters, string) (*TxTracker, error)); ok {
return rf(tx, counters, ip)
}
if rf, ok := ret.Get(0).(func(types.Transaction, state.ZKCounters, string) *TxTracker); ok {
r0 = rf(tx, counters, ip)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*TxTracker)
}
}
if rf, ok := ret.Get(1).(func(types.Transaction, state.ZKCounters, string) error); ok {
r1 = rf(tx, counters, ip)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// UpdateAfterSingleSuccessfulTxExecution provides a mock function with given fields: from, touchedAddresses
func (_m *WorkerMock) UpdateAfterSingleSuccessfulTxExecution(from common.Address, touchedAddresses map[common.Address]*state.InfoReadWrite) []*TxTracker {
ret := _m.Called(from, touchedAddresses)
var r0 []*TxTracker
if rf, ok := ret.Get(0).(func(common.Address, map[common.Address]*state.InfoReadWrite) []*TxTracker); ok {
r0 = rf(from, touchedAddresses)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*TxTracker)
}
}
return r0
}
// UpdateTxZKCounters provides a mock function with given fields: txHash, from, ZKCounters
func (_m *WorkerMock) UpdateTxZKCounters(txHash common.Hash, from common.Address, ZKCounters state.ZKCounters) {
_m.Called(txHash, from, ZKCounters)
}
// NewWorkerMock creates a new instance of WorkerMock. 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 NewWorkerMock(t interface {
mock.TestingT
Cleanup(func())
}) *WorkerMock {
mock := &WorkerMock{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}