github.com/aergoio/aergo@v1.3.1/p2p/p2pmock/mock_remotepeer.go (about) 1 // Code generated by MockGen. DO NOT EDIT. 2 // Source: remotepeer.go 3 4 // Package p2pmock is a generated GoMock package. 5 package p2pmock 6 7 import ( 8 p2pcommon "github.com/aergoio/aergo/p2p/p2pcommon" 9 types "github.com/aergoio/aergo/types" 10 gomock "github.com/golang/mock/gomock" 11 network "github.com/libp2p/go-libp2p-core/network" 12 reflect "reflect" 13 time "time" 14 ) 15 16 // MockPeerFactory is a mock of PeerFactory interface 17 type MockPeerFactory struct { 18 ctrl *gomock.Controller 19 recorder *MockPeerFactoryMockRecorder 20 } 21 22 // MockPeerFactoryMockRecorder is the mock recorder for MockPeerFactory 23 type MockPeerFactoryMockRecorder struct { 24 mock *MockPeerFactory 25 } 26 27 // NewMockPeerFactory creates a new mock instance 28 func NewMockPeerFactory(ctrl *gomock.Controller) *MockPeerFactory { 29 mock := &MockPeerFactory{ctrl: ctrl} 30 mock.recorder = &MockPeerFactoryMockRecorder{mock} 31 return mock 32 } 33 34 // EXPECT returns an object that allows the caller to indicate expected use 35 func (m *MockPeerFactory) EXPECT() *MockPeerFactoryMockRecorder { 36 return m.recorder 37 } 38 39 // CreateRemotePeer mocks base method 40 func (m *MockPeerFactory) CreateRemotePeer(meta p2pcommon.PeerMeta, seq uint32, status *types.Status, stream network.Stream, rw p2pcommon.MsgReadWriter) p2pcommon.RemotePeer { 41 m.ctrl.T.Helper() 42 ret := m.ctrl.Call(m, "CreateRemotePeer", meta, seq, status, stream, rw) 43 ret0, _ := ret[0].(p2pcommon.RemotePeer) 44 return ret0 45 } 46 47 // CreateRemotePeer indicates an expected call of CreateRemotePeer 48 func (mr *MockPeerFactoryMockRecorder) CreateRemotePeer(meta, seq, status, stream, rw interface{}) *gomock.Call { 49 mr.mock.ctrl.T.Helper() 50 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRemotePeer", reflect.TypeOf((*MockPeerFactory)(nil).CreateRemotePeer), meta, seq, status, stream, rw) 51 } 52 53 // MockRemotePeer is a mock of RemotePeer interface 54 type MockRemotePeer struct { 55 ctrl *gomock.Controller 56 recorder *MockRemotePeerMockRecorder 57 } 58 59 // MockRemotePeerMockRecorder is the mock recorder for MockRemotePeer 60 type MockRemotePeerMockRecorder struct { 61 mock *MockRemotePeer 62 } 63 64 // NewMockRemotePeer creates a new mock instance 65 func NewMockRemotePeer(ctrl *gomock.Controller) *MockRemotePeer { 66 mock := &MockRemotePeer{ctrl: ctrl} 67 mock.recorder = &MockRemotePeerMockRecorder{mock} 68 return mock 69 } 70 71 // EXPECT returns an object that allows the caller to indicate expected use 72 func (m *MockRemotePeer) EXPECT() *MockRemotePeerMockRecorder { 73 return m.recorder 74 } 75 76 // ID mocks base method 77 func (m *MockRemotePeer) ID() types.PeerID { 78 m.ctrl.T.Helper() 79 ret := m.ctrl.Call(m, "ID") 80 ret0, _ := ret[0].(types.PeerID) 81 return ret0 82 } 83 84 // ID indicates an expected call of ID 85 func (mr *MockRemotePeerMockRecorder) ID() *gomock.Call { 86 mr.mock.ctrl.T.Helper() 87 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ID", reflect.TypeOf((*MockRemotePeer)(nil).ID)) 88 } 89 90 // Meta mocks base method 91 func (m *MockRemotePeer) Meta() p2pcommon.PeerMeta { 92 m.ctrl.T.Helper() 93 ret := m.ctrl.Call(m, "Meta") 94 ret0, _ := ret[0].(p2pcommon.PeerMeta) 95 return ret0 96 } 97 98 // Meta indicates an expected call of Meta 99 func (mr *MockRemotePeerMockRecorder) Meta() *gomock.Call { 100 mr.mock.ctrl.T.Helper() 101 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Meta", reflect.TypeOf((*MockRemotePeer)(nil).Meta)) 102 } 103 104 // ManageNumber mocks base method 105 func (m *MockRemotePeer) ManageNumber() uint32 { 106 m.ctrl.T.Helper() 107 ret := m.ctrl.Call(m, "ManageNumber") 108 ret0, _ := ret[0].(uint32) 109 return ret0 110 } 111 112 // ManageNumber indicates an expected call of ManageNumber 113 func (mr *MockRemotePeerMockRecorder) ManageNumber() *gomock.Call { 114 mr.mock.ctrl.T.Helper() 115 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ManageNumber", reflect.TypeOf((*MockRemotePeer)(nil).ManageNumber)) 116 } 117 118 // Name mocks base method 119 func (m *MockRemotePeer) Name() string { 120 m.ctrl.T.Helper() 121 ret := m.ctrl.Call(m, "Name") 122 ret0, _ := ret[0].(string) 123 return ret0 124 } 125 126 // Name indicates an expected call of Name 127 func (mr *MockRemotePeerMockRecorder) Name() *gomock.Call { 128 mr.mock.ctrl.T.Helper() 129 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockRemotePeer)(nil).Name)) 130 } 131 132 // Version mocks base method 133 func (m *MockRemotePeer) Version() string { 134 m.ctrl.T.Helper() 135 ret := m.ctrl.Call(m, "Version") 136 ret0, _ := ret[0].(string) 137 return ret0 138 } 139 140 // Version indicates an expected call of Version 141 func (mr *MockRemotePeerMockRecorder) Version() *gomock.Call { 142 mr.mock.ctrl.T.Helper() 143 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Version", reflect.TypeOf((*MockRemotePeer)(nil).Version)) 144 } 145 146 // Role mocks base method 147 func (m *MockRemotePeer) Role() p2pcommon.PeerRole { 148 m.ctrl.T.Helper() 149 ret := m.ctrl.Call(m, "Role") 150 ret0, _ := ret[0].(p2pcommon.PeerRole) 151 return ret0 152 } 153 154 // Role indicates an expected call of Role 155 func (mr *MockRemotePeerMockRecorder) Role() *gomock.Call { 156 mr.mock.ctrl.T.Helper() 157 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Role", reflect.TypeOf((*MockRemotePeer)(nil).Role)) 158 } 159 160 // ChangeRole mocks base method 161 func (m *MockRemotePeer) ChangeRole(role p2pcommon.PeerRole) { 162 m.ctrl.T.Helper() 163 m.ctrl.Call(m, "ChangeRole", role) 164 } 165 166 // ChangeRole indicates an expected call of ChangeRole 167 func (mr *MockRemotePeerMockRecorder) ChangeRole(role interface{}) *gomock.Call { 168 mr.mock.ctrl.T.Helper() 169 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChangeRole", reflect.TypeOf((*MockRemotePeer)(nil).ChangeRole), role) 170 } 171 172 // AddMessageHandler mocks base method 173 func (m *MockRemotePeer) AddMessageHandler(subProtocol p2pcommon.SubProtocol, handler p2pcommon.MessageHandler) { 174 m.ctrl.T.Helper() 175 m.ctrl.Call(m, "AddMessageHandler", subProtocol, handler) 176 } 177 178 // AddMessageHandler indicates an expected call of AddMessageHandler 179 func (mr *MockRemotePeerMockRecorder) AddMessageHandler(subProtocol, handler interface{}) *gomock.Call { 180 mr.mock.ctrl.T.Helper() 181 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddMessageHandler", reflect.TypeOf((*MockRemotePeer)(nil).AddMessageHandler), subProtocol, handler) 182 } 183 184 // State mocks base method 185 func (m *MockRemotePeer) State() types.PeerState { 186 m.ctrl.T.Helper() 187 ret := m.ctrl.Call(m, "State") 188 ret0, _ := ret[0].(types.PeerState) 189 return ret0 190 } 191 192 // State indicates an expected call of State 193 func (mr *MockRemotePeerMockRecorder) State() *gomock.Call { 194 mr.mock.ctrl.T.Helper() 195 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "State", reflect.TypeOf((*MockRemotePeer)(nil).State)) 196 } 197 198 // LastStatus mocks base method 199 func (m *MockRemotePeer) LastStatus() *types.LastBlockStatus { 200 m.ctrl.T.Helper() 201 ret := m.ctrl.Call(m, "LastStatus") 202 ret0, _ := ret[0].(*types.LastBlockStatus) 203 return ret0 204 } 205 206 // LastStatus indicates an expected call of LastStatus 207 func (mr *MockRemotePeerMockRecorder) LastStatus() *gomock.Call { 208 mr.mock.ctrl.T.Helper() 209 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastStatus", reflect.TypeOf((*MockRemotePeer)(nil).LastStatus)) 210 } 211 212 // RunPeer mocks base method 213 func (m *MockRemotePeer) RunPeer() { 214 m.ctrl.T.Helper() 215 m.ctrl.Call(m, "RunPeer") 216 } 217 218 // RunPeer indicates an expected call of RunPeer 219 func (mr *MockRemotePeerMockRecorder) RunPeer() *gomock.Call { 220 mr.mock.ctrl.T.Helper() 221 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunPeer", reflect.TypeOf((*MockRemotePeer)(nil).RunPeer)) 222 } 223 224 // Stop mocks base method 225 func (m *MockRemotePeer) Stop() { 226 m.ctrl.T.Helper() 227 m.ctrl.Call(m, "Stop") 228 } 229 230 // Stop indicates an expected call of Stop 231 func (mr *MockRemotePeerMockRecorder) Stop() *gomock.Call { 232 mr.mock.ctrl.T.Helper() 233 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stop", reflect.TypeOf((*MockRemotePeer)(nil).Stop)) 234 } 235 236 // SendMessage mocks base method 237 func (m *MockRemotePeer) SendMessage(msg p2pcommon.MsgOrder) { 238 m.ctrl.T.Helper() 239 m.ctrl.Call(m, "SendMessage", msg) 240 } 241 242 // SendMessage indicates an expected call of SendMessage 243 func (mr *MockRemotePeerMockRecorder) SendMessage(msg interface{}) *gomock.Call { 244 mr.mock.ctrl.T.Helper() 245 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessage", reflect.TypeOf((*MockRemotePeer)(nil).SendMessage), msg) 246 } 247 248 // SendAndWaitMessage mocks base method 249 func (m *MockRemotePeer) SendAndWaitMessage(msg p2pcommon.MsgOrder, ttl time.Duration) error { 250 m.ctrl.T.Helper() 251 ret := m.ctrl.Call(m, "SendAndWaitMessage", msg, ttl) 252 ret0, _ := ret[0].(error) 253 return ret0 254 } 255 256 // SendAndWaitMessage indicates an expected call of SendAndWaitMessage 257 func (mr *MockRemotePeerMockRecorder) SendAndWaitMessage(msg, ttl interface{}) *gomock.Call { 258 mr.mock.ctrl.T.Helper() 259 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendAndWaitMessage", reflect.TypeOf((*MockRemotePeer)(nil).SendAndWaitMessage), msg, ttl) 260 } 261 262 // PushTxsNotice mocks base method 263 func (m *MockRemotePeer) PushTxsNotice(txHashes []types.TxID) { 264 m.ctrl.T.Helper() 265 m.ctrl.Call(m, "PushTxsNotice", txHashes) 266 } 267 268 // PushTxsNotice indicates an expected call of PushTxsNotice 269 func (mr *MockRemotePeerMockRecorder) PushTxsNotice(txHashes interface{}) *gomock.Call { 270 mr.mock.ctrl.T.Helper() 271 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PushTxsNotice", reflect.TypeOf((*MockRemotePeer)(nil).PushTxsNotice), txHashes) 272 } 273 274 // ConsumeRequest mocks base method 275 func (m *MockRemotePeer) ConsumeRequest(msgID p2pcommon.MsgID) { 276 m.ctrl.T.Helper() 277 m.ctrl.Call(m, "ConsumeRequest", msgID) 278 } 279 280 // ConsumeRequest indicates an expected call of ConsumeRequest 281 func (mr *MockRemotePeerMockRecorder) ConsumeRequest(msgID interface{}) *gomock.Call { 282 mr.mock.ctrl.T.Helper() 283 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConsumeRequest", reflect.TypeOf((*MockRemotePeer)(nil).ConsumeRequest), msgID) 284 } 285 286 // GetReceiver mocks base method 287 func (m *MockRemotePeer) GetReceiver(id p2pcommon.MsgID) p2pcommon.ResponseReceiver { 288 m.ctrl.T.Helper() 289 ret := m.ctrl.Call(m, "GetReceiver", id) 290 ret0, _ := ret[0].(p2pcommon.ResponseReceiver) 291 return ret0 292 } 293 294 // GetReceiver indicates an expected call of GetReceiver 295 func (mr *MockRemotePeerMockRecorder) GetReceiver(id interface{}) *gomock.Call { 296 mr.mock.ctrl.T.Helper() 297 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetReceiver", reflect.TypeOf((*MockRemotePeer)(nil).GetReceiver), id) 298 } 299 300 // UpdateBlkCache mocks base method 301 func (m *MockRemotePeer) UpdateBlkCache(blkHash []byte, blkNumber uint64) bool { 302 m.ctrl.T.Helper() 303 ret := m.ctrl.Call(m, "UpdateBlkCache", blkHash, blkNumber) 304 ret0, _ := ret[0].(bool) 305 return ret0 306 } 307 308 // UpdateBlkCache indicates an expected call of UpdateBlkCache 309 func (mr *MockRemotePeerMockRecorder) UpdateBlkCache(blkHash, blkNumber interface{}) *gomock.Call { 310 mr.mock.ctrl.T.Helper() 311 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateBlkCache", reflect.TypeOf((*MockRemotePeer)(nil).UpdateBlkCache), blkHash, blkNumber) 312 } 313 314 // UpdateTxCache mocks base method 315 func (m *MockRemotePeer) UpdateTxCache(hashes []types.TxID) []types.TxID { 316 m.ctrl.T.Helper() 317 ret := m.ctrl.Call(m, "UpdateTxCache", hashes) 318 ret0, _ := ret[0].([]types.TxID) 319 return ret0 320 } 321 322 // UpdateTxCache indicates an expected call of UpdateTxCache 323 func (mr *MockRemotePeerMockRecorder) UpdateTxCache(hashes interface{}) *gomock.Call { 324 mr.mock.ctrl.T.Helper() 325 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateTxCache", reflect.TypeOf((*MockRemotePeer)(nil).UpdateTxCache), hashes) 326 } 327 328 // UpdateLastNotice mocks base method 329 func (m *MockRemotePeer) UpdateLastNotice(blkHash []byte, blkNumber uint64) { 330 m.ctrl.T.Helper() 331 m.ctrl.Call(m, "UpdateLastNotice", blkHash, blkNumber) 332 } 333 334 // UpdateLastNotice indicates an expected call of UpdateLastNotice 335 func (mr *MockRemotePeerMockRecorder) UpdateLastNotice(blkHash, blkNumber interface{}) *gomock.Call { 336 mr.mock.ctrl.T.Helper() 337 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateLastNotice", reflect.TypeOf((*MockRemotePeer)(nil).UpdateLastNotice), blkHash, blkNumber) 338 } 339 340 // MF mocks base method 341 func (m *MockRemotePeer) MF() p2pcommon.MoFactory { 342 m.ctrl.T.Helper() 343 ret := m.ctrl.Call(m, "MF") 344 ret0, _ := ret[0].(p2pcommon.MoFactory) 345 return ret0 346 } 347 348 // MF indicates an expected call of MF 349 func (mr *MockRemotePeerMockRecorder) MF() *gomock.Call { 350 mr.mock.ctrl.T.Helper() 351 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MF", reflect.TypeOf((*MockRemotePeer)(nil).MF)) 352 }