github.com/aergoio/aergo@v1.3.1/p2p/p2pmock/mock_message.go (about) 1 // Code generated by MockGen. DO NOT EDIT. 2 // Source: message.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 reflect "reflect" 12 time "time" 13 ) 14 15 // MockMessage is a mock of Message interface 16 type MockMessage struct { 17 ctrl *gomock.Controller 18 recorder *MockMessageMockRecorder 19 } 20 21 // MockMessageMockRecorder is the mock recorder for MockMessage 22 type MockMessageMockRecorder struct { 23 mock *MockMessage 24 } 25 26 // NewMockMessage creates a new mock instance 27 func NewMockMessage(ctrl *gomock.Controller) *MockMessage { 28 mock := &MockMessage{ctrl: ctrl} 29 mock.recorder = &MockMessageMockRecorder{mock} 30 return mock 31 } 32 33 // EXPECT returns an object that allows the caller to indicate expected use 34 func (m *MockMessage) EXPECT() *MockMessageMockRecorder { 35 return m.recorder 36 } 37 38 // Subprotocol mocks base method 39 func (m *MockMessage) Subprotocol() p2pcommon.SubProtocol { 40 m.ctrl.T.Helper() 41 ret := m.ctrl.Call(m, "Subprotocol") 42 ret0, _ := ret[0].(p2pcommon.SubProtocol) 43 return ret0 44 } 45 46 // Subprotocol indicates an expected call of Subprotocol 47 func (mr *MockMessageMockRecorder) Subprotocol() *gomock.Call { 48 mr.mock.ctrl.T.Helper() 49 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Subprotocol", reflect.TypeOf((*MockMessage)(nil).Subprotocol)) 50 } 51 52 // Length mocks base method 53 func (m *MockMessage) Length() uint32 { 54 m.ctrl.T.Helper() 55 ret := m.ctrl.Call(m, "Length") 56 ret0, _ := ret[0].(uint32) 57 return ret0 58 } 59 60 // Length indicates an expected call of Length 61 func (mr *MockMessageMockRecorder) Length() *gomock.Call { 62 mr.mock.ctrl.T.Helper() 63 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Length", reflect.TypeOf((*MockMessage)(nil).Length)) 64 } 65 66 // Timestamp mocks base method 67 func (m *MockMessage) Timestamp() int64 { 68 m.ctrl.T.Helper() 69 ret := m.ctrl.Call(m, "Timestamp") 70 ret0, _ := ret[0].(int64) 71 return ret0 72 } 73 74 // Timestamp indicates an expected call of Timestamp 75 func (mr *MockMessageMockRecorder) Timestamp() *gomock.Call { 76 mr.mock.ctrl.T.Helper() 77 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Timestamp", reflect.TypeOf((*MockMessage)(nil).Timestamp)) 78 } 79 80 // ID mocks base method 81 func (m *MockMessage) ID() p2pcommon.MsgID { 82 m.ctrl.T.Helper() 83 ret := m.ctrl.Call(m, "ID") 84 ret0, _ := ret[0].(p2pcommon.MsgID) 85 return ret0 86 } 87 88 // ID indicates an expected call of ID 89 func (mr *MockMessageMockRecorder) ID() *gomock.Call { 90 mr.mock.ctrl.T.Helper() 91 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ID", reflect.TypeOf((*MockMessage)(nil).ID)) 92 } 93 94 // OriginalID mocks base method 95 func (m *MockMessage) OriginalID() p2pcommon.MsgID { 96 m.ctrl.T.Helper() 97 ret := m.ctrl.Call(m, "OriginalID") 98 ret0, _ := ret[0].(p2pcommon.MsgID) 99 return ret0 100 } 101 102 // OriginalID indicates an expected call of OriginalID 103 func (mr *MockMessageMockRecorder) OriginalID() *gomock.Call { 104 mr.mock.ctrl.T.Helper() 105 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OriginalID", reflect.TypeOf((*MockMessage)(nil).OriginalID)) 106 } 107 108 // Payload mocks base method 109 func (m *MockMessage) Payload() []byte { 110 m.ctrl.T.Helper() 111 ret := m.ctrl.Call(m, "Payload") 112 ret0, _ := ret[0].([]byte) 113 return ret0 114 } 115 116 // Payload indicates an expected call of Payload 117 func (mr *MockMessageMockRecorder) Payload() *gomock.Call { 118 mr.mock.ctrl.T.Helper() 119 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Payload", reflect.TypeOf((*MockMessage)(nil).Payload)) 120 } 121 122 // MockMessageBody is a mock of MessageBody interface 123 type MockMessageBody struct { 124 ctrl *gomock.Controller 125 recorder *MockMessageBodyMockRecorder 126 } 127 128 // MockMessageBodyMockRecorder is the mock recorder for MockMessageBody 129 type MockMessageBodyMockRecorder struct { 130 mock *MockMessageBody 131 } 132 133 // NewMockMessageBody creates a new mock instance 134 func NewMockMessageBody(ctrl *gomock.Controller) *MockMessageBody { 135 mock := &MockMessageBody{ctrl: ctrl} 136 mock.recorder = &MockMessageBodyMockRecorder{mock} 137 return mock 138 } 139 140 // EXPECT returns an object that allows the caller to indicate expected use 141 func (m *MockMessageBody) EXPECT() *MockMessageBodyMockRecorder { 142 return m.recorder 143 } 144 145 // Reset mocks base method 146 func (m *MockMessageBody) Reset() { 147 m.ctrl.T.Helper() 148 m.ctrl.Call(m, "Reset") 149 } 150 151 // Reset indicates an expected call of Reset 152 func (mr *MockMessageBodyMockRecorder) Reset() *gomock.Call { 153 mr.mock.ctrl.T.Helper() 154 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Reset", reflect.TypeOf((*MockMessageBody)(nil).Reset)) 155 } 156 157 // String mocks base method 158 func (m *MockMessageBody) String() string { 159 m.ctrl.T.Helper() 160 ret := m.ctrl.Call(m, "String") 161 ret0, _ := ret[0].(string) 162 return ret0 163 } 164 165 // String indicates an expected call of String 166 func (mr *MockMessageBodyMockRecorder) String() *gomock.Call { 167 mr.mock.ctrl.T.Helper() 168 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "String", reflect.TypeOf((*MockMessageBody)(nil).String)) 169 } 170 171 // ProtoMessage mocks base method 172 func (m *MockMessageBody) ProtoMessage() { 173 m.ctrl.T.Helper() 174 m.ctrl.Call(m, "ProtoMessage") 175 } 176 177 // ProtoMessage indicates an expected call of ProtoMessage 178 func (mr *MockMessageBodyMockRecorder) ProtoMessage() *gomock.Call { 179 mr.mock.ctrl.T.Helper() 180 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProtoMessage", reflect.TypeOf((*MockMessageBody)(nil).ProtoMessage)) 181 } 182 183 // MockMessageHandler is a mock of MessageHandler interface 184 type MockMessageHandler struct { 185 ctrl *gomock.Controller 186 recorder *MockMessageHandlerMockRecorder 187 } 188 189 // MockMessageHandlerMockRecorder is the mock recorder for MockMessageHandler 190 type MockMessageHandlerMockRecorder struct { 191 mock *MockMessageHandler 192 } 193 194 // NewMockMessageHandler creates a new mock instance 195 func NewMockMessageHandler(ctrl *gomock.Controller) *MockMessageHandler { 196 mock := &MockMessageHandler{ctrl: ctrl} 197 mock.recorder = &MockMessageHandlerMockRecorder{mock} 198 return mock 199 } 200 201 // EXPECT returns an object that allows the caller to indicate expected use 202 func (m *MockMessageHandler) EXPECT() *MockMessageHandlerMockRecorder { 203 return m.recorder 204 } 205 206 // AddAdvice mocks base method 207 func (m *MockMessageHandler) AddAdvice(advice p2pcommon.HandlerAdvice) { 208 m.ctrl.T.Helper() 209 m.ctrl.Call(m, "AddAdvice", advice) 210 } 211 212 // AddAdvice indicates an expected call of AddAdvice 213 func (mr *MockMessageHandlerMockRecorder) AddAdvice(advice interface{}) *gomock.Call { 214 mr.mock.ctrl.T.Helper() 215 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddAdvice", reflect.TypeOf((*MockMessageHandler)(nil).AddAdvice), advice) 216 } 217 218 // ParsePayload mocks base method 219 func (m *MockMessageHandler) ParsePayload(arg0 []byte) (p2pcommon.MessageBody, error) { 220 m.ctrl.T.Helper() 221 ret := m.ctrl.Call(m, "ParsePayload", arg0) 222 ret0, _ := ret[0].(p2pcommon.MessageBody) 223 ret1, _ := ret[1].(error) 224 return ret0, ret1 225 } 226 227 // ParsePayload indicates an expected call of ParsePayload 228 func (mr *MockMessageHandlerMockRecorder) ParsePayload(arg0 interface{}) *gomock.Call { 229 mr.mock.ctrl.T.Helper() 230 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ParsePayload", reflect.TypeOf((*MockMessageHandler)(nil).ParsePayload), arg0) 231 } 232 233 // CheckAuth mocks base method 234 func (m *MockMessageHandler) CheckAuth(msg p2pcommon.Message, msgBody p2pcommon.MessageBody) error { 235 m.ctrl.T.Helper() 236 ret := m.ctrl.Call(m, "CheckAuth", msg, msgBody) 237 ret0, _ := ret[0].(error) 238 return ret0 239 } 240 241 // CheckAuth indicates an expected call of CheckAuth 242 func (mr *MockMessageHandlerMockRecorder) CheckAuth(msg, msgBody interface{}) *gomock.Call { 243 mr.mock.ctrl.T.Helper() 244 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckAuth", reflect.TypeOf((*MockMessageHandler)(nil).CheckAuth), msg, msgBody) 245 } 246 247 // Handle mocks base method 248 func (m *MockMessageHandler) Handle(msg p2pcommon.Message, msgBody p2pcommon.MessageBody) { 249 m.ctrl.T.Helper() 250 m.ctrl.Call(m, "Handle", msg, msgBody) 251 } 252 253 // Handle indicates an expected call of Handle 254 func (mr *MockMessageHandlerMockRecorder) Handle(msg, msgBody interface{}) *gomock.Call { 255 mr.mock.ctrl.T.Helper() 256 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Handle", reflect.TypeOf((*MockMessageHandler)(nil).Handle), msg, msgBody) 257 } 258 259 // PreHandle mocks base method 260 func (m *MockMessageHandler) PreHandle() { 261 m.ctrl.T.Helper() 262 m.ctrl.Call(m, "PreHandle") 263 } 264 265 // PreHandle indicates an expected call of PreHandle 266 func (mr *MockMessageHandlerMockRecorder) PreHandle() *gomock.Call { 267 mr.mock.ctrl.T.Helper() 268 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PreHandle", reflect.TypeOf((*MockMessageHandler)(nil).PreHandle)) 269 } 270 271 // PostHandle mocks base method 272 func (m *MockMessageHandler) PostHandle(msg p2pcommon.Message, msgBody p2pcommon.MessageBody) { 273 m.ctrl.T.Helper() 274 m.ctrl.Call(m, "PostHandle", msg, msgBody) 275 } 276 277 // PostHandle indicates an expected call of PostHandle 278 func (mr *MockMessageHandlerMockRecorder) PostHandle(msg, msgBody interface{}) *gomock.Call { 279 mr.mock.ctrl.T.Helper() 280 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PostHandle", reflect.TypeOf((*MockMessageHandler)(nil).PostHandle), msg, msgBody) 281 } 282 283 // MockHandlerAdvice is a mock of HandlerAdvice interface 284 type MockHandlerAdvice struct { 285 ctrl *gomock.Controller 286 recorder *MockHandlerAdviceMockRecorder 287 } 288 289 // MockHandlerAdviceMockRecorder is the mock recorder for MockHandlerAdvice 290 type MockHandlerAdviceMockRecorder struct { 291 mock *MockHandlerAdvice 292 } 293 294 // NewMockHandlerAdvice creates a new mock instance 295 func NewMockHandlerAdvice(ctrl *gomock.Controller) *MockHandlerAdvice { 296 mock := &MockHandlerAdvice{ctrl: ctrl} 297 mock.recorder = &MockHandlerAdviceMockRecorder{mock} 298 return mock 299 } 300 301 // EXPECT returns an object that allows the caller to indicate expected use 302 func (m *MockHandlerAdvice) EXPECT() *MockHandlerAdviceMockRecorder { 303 return m.recorder 304 } 305 306 // PreHandle mocks base method 307 func (m *MockHandlerAdvice) PreHandle() { 308 m.ctrl.T.Helper() 309 m.ctrl.Call(m, "PreHandle") 310 } 311 312 // PreHandle indicates an expected call of PreHandle 313 func (mr *MockHandlerAdviceMockRecorder) PreHandle() *gomock.Call { 314 mr.mock.ctrl.T.Helper() 315 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PreHandle", reflect.TypeOf((*MockHandlerAdvice)(nil).PreHandle)) 316 } 317 318 // PostHandle mocks base method 319 func (m *MockHandlerAdvice) PostHandle(msg p2pcommon.Message, msgBody p2pcommon.MessageBody) { 320 m.ctrl.T.Helper() 321 m.ctrl.Call(m, "PostHandle", msg, msgBody) 322 } 323 324 // PostHandle indicates an expected call of PostHandle 325 func (mr *MockHandlerAdviceMockRecorder) PostHandle(msg, msgBody interface{}) *gomock.Call { 326 mr.mock.ctrl.T.Helper() 327 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PostHandle", reflect.TypeOf((*MockHandlerAdvice)(nil).PostHandle), msg, msgBody) 328 } 329 330 // MockAsyncHandler is a mock of AsyncHandler interface 331 type MockAsyncHandler struct { 332 ctrl *gomock.Controller 333 recorder *MockAsyncHandlerMockRecorder 334 } 335 336 // MockAsyncHandlerMockRecorder is the mock recorder for MockAsyncHandler 337 type MockAsyncHandlerMockRecorder struct { 338 mock *MockAsyncHandler 339 } 340 341 // NewMockAsyncHandler creates a new mock instance 342 func NewMockAsyncHandler(ctrl *gomock.Controller) *MockAsyncHandler { 343 mock := &MockAsyncHandler{ctrl: ctrl} 344 mock.recorder = &MockAsyncHandlerMockRecorder{mock} 345 return mock 346 } 347 348 // EXPECT returns an object that allows the caller to indicate expected use 349 func (m *MockAsyncHandler) EXPECT() *MockAsyncHandlerMockRecorder { 350 return m.recorder 351 } 352 353 // HandleOrNot mocks base method 354 func (m *MockAsyncHandler) HandleOrNot(msg p2pcommon.Message, msgBody p2pcommon.MessageBody) bool { 355 m.ctrl.T.Helper() 356 ret := m.ctrl.Call(m, "HandleOrNot", msg, msgBody) 357 ret0, _ := ret[0].(bool) 358 return ret0 359 } 360 361 // HandleOrNot indicates an expected call of HandleOrNot 362 func (mr *MockAsyncHandlerMockRecorder) HandleOrNot(msg, msgBody interface{}) *gomock.Call { 363 mr.mock.ctrl.T.Helper() 364 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleOrNot", reflect.TypeOf((*MockAsyncHandler)(nil).HandleOrNot), msg, msgBody) 365 } 366 367 // Handle mocks base method 368 func (m *MockAsyncHandler) Handle(msg p2pcommon.Message, msgBody p2pcommon.MessageBody, ttl time.Duration) { 369 m.ctrl.T.Helper() 370 m.ctrl.Call(m, "Handle", msg, msgBody, ttl) 371 } 372 373 // Handle indicates an expected call of Handle 374 func (mr *MockAsyncHandlerMockRecorder) Handle(msg, msgBody, ttl interface{}) *gomock.Call { 375 mr.mock.ctrl.T.Helper() 376 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Handle", reflect.TypeOf((*MockAsyncHandler)(nil).Handle), msg, msgBody, ttl) 377 } 378 379 // MockMsgSigner is a mock of MsgSigner interface 380 type MockMsgSigner struct { 381 ctrl *gomock.Controller 382 recorder *MockMsgSignerMockRecorder 383 } 384 385 // MockMsgSignerMockRecorder is the mock recorder for MockMsgSigner 386 type MockMsgSignerMockRecorder struct { 387 mock *MockMsgSigner 388 } 389 390 // NewMockMsgSigner creates a new mock instance 391 func NewMockMsgSigner(ctrl *gomock.Controller) *MockMsgSigner { 392 mock := &MockMsgSigner{ctrl: ctrl} 393 mock.recorder = &MockMsgSignerMockRecorder{mock} 394 return mock 395 } 396 397 // EXPECT returns an object that allows the caller to indicate expected use 398 func (m *MockMsgSigner) EXPECT() *MockMsgSignerMockRecorder { 399 return m.recorder 400 } 401 402 // SignMsg mocks base method 403 func (m *MockMsgSigner) SignMsg(msg *types.P2PMessage) error { 404 m.ctrl.T.Helper() 405 ret := m.ctrl.Call(m, "SignMsg", msg) 406 ret0, _ := ret[0].(error) 407 return ret0 408 } 409 410 // SignMsg indicates an expected call of SignMsg 411 func (mr *MockMsgSignerMockRecorder) SignMsg(msg interface{}) *gomock.Call { 412 mr.mock.ctrl.T.Helper() 413 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SignMsg", reflect.TypeOf((*MockMsgSigner)(nil).SignMsg), msg) 414 } 415 416 // VerifyMsg mocks base method 417 func (m *MockMsgSigner) VerifyMsg(msg *types.P2PMessage, senderID types.PeerID) error { 418 m.ctrl.T.Helper() 419 ret := m.ctrl.Call(m, "VerifyMsg", msg, senderID) 420 ret0, _ := ret[0].(error) 421 return ret0 422 } 423 424 // VerifyMsg indicates an expected call of VerifyMsg 425 func (mr *MockMsgSignerMockRecorder) VerifyMsg(msg, senderID interface{}) *gomock.Call { 426 mr.mock.ctrl.T.Helper() 427 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyMsg", reflect.TypeOf((*MockMsgSigner)(nil).VerifyMsg), msg, senderID) 428 }