-
Notifications
You must be signed in to change notification settings - Fork 323
/
mock_dispatcher.go
176 lines (146 loc) · 6.68 KB
/
mock_dispatcher.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
// Code generated by MockGen. DO NOT EDIT.
// Source: ./dispatcher/dispatcher.go
// Package mock_dispatcher is a generated GoMock package.
package mock_dispatcher
import (
context "context"
gomock "github.com/golang/mock/gomock"
proto "github.com/golang/protobuf/proto"
dispatcher "github.com/iotexproject/iotex-core/dispatcher"
iotexrpc "github.com/iotexproject/iotex-core/protogen/iotexrpc"
iotextypes "github.com/iotexproject/iotex-core/protogen/iotextypes"
go_libp2p_peerstore "github.com/libp2p/go-libp2p-peerstore"
reflect "reflect"
)
// MockSubscriber is a mock of Subscriber interface
type MockSubscriber struct {
ctrl *gomock.Controller
recorder *MockSubscriberMockRecorder
}
// MockSubscriberMockRecorder is the mock recorder for MockSubscriber
type MockSubscriberMockRecorder struct {
mock *MockSubscriber
}
// NewMockSubscriber creates a new mock instance
func NewMockSubscriber(ctrl *gomock.Controller) *MockSubscriber {
mock := &MockSubscriber{ctrl: ctrl}
mock.recorder = &MockSubscriberMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockSubscriber) EXPECT() *MockSubscriberMockRecorder {
return m.recorder
}
// HandleAction mocks base method
func (m *MockSubscriber) HandleAction(arg0 context.Context, arg1 *iotextypes.Action) error {
ret := m.ctrl.Call(m, "HandleAction", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// HandleAction indicates an expected call of HandleAction
func (mr *MockSubscriberMockRecorder) HandleAction(arg0, arg1 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleAction", reflect.TypeOf((*MockSubscriber)(nil).HandleAction), arg0, arg1)
}
// HandleBlock mocks base method
func (m *MockSubscriber) HandleBlock(arg0 context.Context, arg1 *iotextypes.Block) error {
ret := m.ctrl.Call(m, "HandleBlock", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// HandleBlock indicates an expected call of HandleBlock
func (mr *MockSubscriberMockRecorder) HandleBlock(arg0, arg1 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleBlock", reflect.TypeOf((*MockSubscriber)(nil).HandleBlock), arg0, arg1)
}
// HandleBlockSync mocks base method
func (m *MockSubscriber) HandleBlockSync(arg0 context.Context, arg1 *iotextypes.Block) error {
ret := m.ctrl.Call(m, "HandleBlockSync", arg0, arg1)
ret0, _ := ret[0].(error)
return ret0
}
// HandleBlockSync indicates an expected call of HandleBlockSync
func (mr *MockSubscriberMockRecorder) HandleBlockSync(arg0, arg1 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleBlockSync", reflect.TypeOf((*MockSubscriber)(nil).HandleBlockSync), arg0, arg1)
}
// HandleSyncRequest mocks base method
func (m *MockSubscriber) HandleSyncRequest(arg0 context.Context, arg1 go_libp2p_peerstore.PeerInfo, arg2 *iotexrpc.BlockSync) error {
ret := m.ctrl.Call(m, "HandleSyncRequest", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
}
// HandleSyncRequest indicates an expected call of HandleSyncRequest
func (mr *MockSubscriberMockRecorder) HandleSyncRequest(arg0, arg1, arg2 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleSyncRequest", reflect.TypeOf((*MockSubscriber)(nil).HandleSyncRequest), arg0, arg1, arg2)
}
// HandleConsensusMsg mocks base method
func (m *MockSubscriber) HandleConsensusMsg(arg0 *iotexrpc.Consensus) error {
ret := m.ctrl.Call(m, "HandleConsensusMsg", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// HandleConsensusMsg indicates an expected call of HandleConsensusMsg
func (mr *MockSubscriberMockRecorder) HandleConsensusMsg(arg0 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleConsensusMsg", reflect.TypeOf((*MockSubscriber)(nil).HandleConsensusMsg), arg0)
}
// MockDispatcher is a mock of Dispatcher interface
type MockDispatcher struct {
ctrl *gomock.Controller
recorder *MockDispatcherMockRecorder
}
// MockDispatcherMockRecorder is the mock recorder for MockDispatcher
type MockDispatcherMockRecorder struct {
mock *MockDispatcher
}
// NewMockDispatcher creates a new mock instance
func NewMockDispatcher(ctrl *gomock.Controller) *MockDispatcher {
mock := &MockDispatcher{ctrl: ctrl}
mock.recorder = &MockDispatcherMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockDispatcher) EXPECT() *MockDispatcherMockRecorder {
return m.recorder
}
// Start mocks base method
func (m *MockDispatcher) Start(arg0 context.Context) error {
ret := m.ctrl.Call(m, "Start", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Start indicates an expected call of Start
func (mr *MockDispatcherMockRecorder) Start(arg0 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockDispatcher)(nil).Start), arg0)
}
// Stop mocks base method
func (m *MockDispatcher) Stop(arg0 context.Context) error {
ret := m.ctrl.Call(m, "Stop", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Stop indicates an expected call of Stop
func (mr *MockDispatcherMockRecorder) Stop(arg0 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stop", reflect.TypeOf((*MockDispatcher)(nil).Stop), arg0)
}
// AddSubscriber mocks base method
func (m *MockDispatcher) AddSubscriber(arg0 uint32, arg1 dispatcher.Subscriber) {
m.ctrl.Call(m, "AddSubscriber", arg0, arg1)
}
// AddSubscriber indicates an expected call of AddSubscriber
func (mr *MockDispatcherMockRecorder) AddSubscriber(arg0, arg1 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddSubscriber", reflect.TypeOf((*MockDispatcher)(nil).AddSubscriber), arg0, arg1)
}
// HandleBroadcast mocks base method
func (m *MockDispatcher) HandleBroadcast(arg0 context.Context, arg1 uint32, arg2 proto.Message) {
m.ctrl.Call(m, "HandleBroadcast", arg0, arg1, arg2)
}
// HandleBroadcast indicates an expected call of HandleBroadcast
func (mr *MockDispatcherMockRecorder) HandleBroadcast(arg0, arg1, arg2 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleBroadcast", reflect.TypeOf((*MockDispatcher)(nil).HandleBroadcast), arg0, arg1, arg2)
}
// HandleTell mocks base method
func (m *MockDispatcher) HandleTell(arg0 context.Context, arg1 uint32, arg2 go_libp2p_peerstore.PeerInfo, arg3 proto.Message) {
m.ctrl.Call(m, "HandleTell", arg0, arg1, arg2, arg3)
}
// HandleTell indicates an expected call of HandleTell
func (mr *MockDispatcherMockRecorder) HandleTell(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleTell", reflect.TypeOf((*MockDispatcher)(nil).HandleTell), arg0, arg1, arg2, arg3)
}