github.com/ledgerwatch/erigon-lib@v1.0.0/gointerfaces/sentry/mocks.go (about) 1 // Code generated by moq; DO NOT EDIT. 2 // github.com/matryer/moq 3 4 package sentry 5 6 import ( 7 context "context" 8 types "github.com/ledgerwatch/erigon-lib/gointerfaces/types" 9 grpc "google.golang.org/grpc" 10 emptypb "google.golang.org/protobuf/types/known/emptypb" 11 sync "sync" 12 ) 13 14 // Ensure, that SentryServerMock does implement SentryServer. 15 // If this is not the case, regenerate this file with moq. 16 var _ SentryServer = &SentryServerMock{} 17 18 // SentryServerMock is a mock implementation of SentryServer. 19 // 20 // func TestSomethingThatUsesSentryServer(t *testing.T) { 21 // 22 // // make and configure a mocked SentryServer 23 // mockedSentryServer := &SentryServerMock{ 24 // AddPeerFunc: func(contextMoqParam context.Context, addPeerRequest *AddPeerRequest) (*AddPeerReply, error) { 25 // panic("mock out the AddPeer method") 26 // }, 27 // HandShakeFunc: func(contextMoqParam context.Context, empty *emptypb.Empty) (*HandShakeReply, error) { 28 // panic("mock out the HandShake method") 29 // }, 30 // MessagesFunc: func(messagesRequest *MessagesRequest, sentry_MessagesServer Sentry_MessagesServer) error { 31 // panic("mock out the Messages method") 32 // }, 33 // NodeInfoFunc: func(contextMoqParam context.Context, empty *emptypb.Empty) (*types.NodeInfoReply, error) { 34 // panic("mock out the NodeInfo method") 35 // }, 36 // PeerByIdFunc: func(contextMoqParam context.Context, peerByIdRequest *PeerByIdRequest) (*PeerByIdReply, error) { 37 // panic("mock out the PeerById method") 38 // }, 39 // PeerCountFunc: func(contextMoqParam context.Context, peerCountRequest *PeerCountRequest) (*PeerCountReply, error) { 40 // panic("mock out the PeerCount method") 41 // }, 42 // PeerEventsFunc: func(peerEventsRequest *PeerEventsRequest, sentry_PeerEventsServer Sentry_PeerEventsServer) error { 43 // panic("mock out the PeerEvents method") 44 // }, 45 // PeerMinBlockFunc: func(contextMoqParam context.Context, peerMinBlockRequest *PeerMinBlockRequest) (*emptypb.Empty, error) { 46 // panic("mock out the PeerMinBlock method") 47 // }, 48 // PeersFunc: func(contextMoqParam context.Context, empty *emptypb.Empty) (*PeersReply, error) { 49 // panic("mock out the Peers method") 50 // }, 51 // PenalizePeerFunc: func(contextMoqParam context.Context, penalizePeerRequest *PenalizePeerRequest) (*emptypb.Empty, error) { 52 // panic("mock out the PenalizePeer method") 53 // }, 54 // SendMessageByIdFunc: func(contextMoqParam context.Context, sendMessageByIdRequest *SendMessageByIdRequest) (*SentPeers, error) { 55 // panic("mock out the SendMessageById method") 56 // }, 57 // SendMessageByMinBlockFunc: func(contextMoqParam context.Context, sendMessageByMinBlockRequest *SendMessageByMinBlockRequest) (*SentPeers, error) { 58 // panic("mock out the SendMessageByMinBlock method") 59 // }, 60 // SendMessageToAllFunc: func(contextMoqParam context.Context, outboundMessageData *OutboundMessageData) (*SentPeers, error) { 61 // panic("mock out the SendMessageToAll method") 62 // }, 63 // SendMessageToRandomPeersFunc: func(contextMoqParam context.Context, sendMessageToRandomPeersRequest *SendMessageToRandomPeersRequest) (*SentPeers, error) { 64 // panic("mock out the SendMessageToRandomPeers method") 65 // }, 66 // SetStatusFunc: func(contextMoqParam context.Context, statusData *StatusData) (*SetStatusReply, error) { 67 // panic("mock out the SetStatus method") 68 // }, 69 // mustEmbedUnimplementedSentryServerFunc: func() { 70 // panic("mock out the mustEmbedUnimplementedSentryServer method") 71 // }, 72 // } 73 // 74 // // use mockedSentryServer in code that requires SentryServer 75 // // and then make assertions. 76 // 77 // } 78 type SentryServerMock struct { 79 // AddPeerFunc mocks the AddPeer method. 80 AddPeerFunc func(contextMoqParam context.Context, addPeerRequest *AddPeerRequest) (*AddPeerReply, error) 81 82 // HandShakeFunc mocks the HandShake method. 83 HandShakeFunc func(contextMoqParam context.Context, empty *emptypb.Empty) (*HandShakeReply, error) 84 85 // MessagesFunc mocks the Messages method. 86 MessagesFunc func(messagesRequest *MessagesRequest, sentry_MessagesServer Sentry_MessagesServer) error 87 88 // NodeInfoFunc mocks the NodeInfo method. 89 NodeInfoFunc func(contextMoqParam context.Context, empty *emptypb.Empty) (*types.NodeInfoReply, error) 90 91 // PeerByIdFunc mocks the PeerById method. 92 PeerByIdFunc func(contextMoqParam context.Context, peerByIdRequest *PeerByIdRequest) (*PeerByIdReply, error) 93 94 // PeerCountFunc mocks the PeerCount method. 95 PeerCountFunc func(contextMoqParam context.Context, peerCountRequest *PeerCountRequest) (*PeerCountReply, error) 96 97 // PeerEventsFunc mocks the PeerEvents method. 98 PeerEventsFunc func(peerEventsRequest *PeerEventsRequest, sentry_PeerEventsServer Sentry_PeerEventsServer) error 99 100 // PeerMinBlockFunc mocks the PeerMinBlock method. 101 PeerMinBlockFunc func(contextMoqParam context.Context, peerMinBlockRequest *PeerMinBlockRequest) (*emptypb.Empty, error) 102 103 // PeersFunc mocks the Peers method. 104 PeersFunc func(contextMoqParam context.Context, empty *emptypb.Empty) (*PeersReply, error) 105 106 // PenalizePeerFunc mocks the PenalizePeer method. 107 PenalizePeerFunc func(contextMoqParam context.Context, penalizePeerRequest *PenalizePeerRequest) (*emptypb.Empty, error) 108 109 // SendMessageByIdFunc mocks the SendMessageById method. 110 SendMessageByIdFunc func(contextMoqParam context.Context, sendMessageByIdRequest *SendMessageByIdRequest) (*SentPeers, error) 111 112 // SendMessageByMinBlockFunc mocks the SendMessageByMinBlock method. 113 SendMessageByMinBlockFunc func(contextMoqParam context.Context, sendMessageByMinBlockRequest *SendMessageByMinBlockRequest) (*SentPeers, error) 114 115 // SendMessageToAllFunc mocks the SendMessageToAll method. 116 SendMessageToAllFunc func(contextMoqParam context.Context, outboundMessageData *OutboundMessageData) (*SentPeers, error) 117 118 // SendMessageToRandomPeersFunc mocks the SendMessageToRandomPeers method. 119 SendMessageToRandomPeersFunc func(contextMoqParam context.Context, sendMessageToRandomPeersRequest *SendMessageToRandomPeersRequest) (*SentPeers, error) 120 121 // SetStatusFunc mocks the SetStatus method. 122 SetStatusFunc func(contextMoqParam context.Context, statusData *StatusData) (*SetStatusReply, error) 123 124 // mustEmbedUnimplementedSentryServerFunc mocks the mustEmbedUnimplementedSentryServer method. 125 mustEmbedUnimplementedSentryServerFunc func() 126 127 // calls tracks calls to the methods. 128 calls struct { 129 // AddPeer holds details about calls to the AddPeer method. 130 AddPeer []struct { 131 // ContextMoqParam is the contextMoqParam argument value. 132 ContextMoqParam context.Context 133 // AddPeerRequest is the addPeerRequest argument value. 134 AddPeerRequest *AddPeerRequest 135 } 136 // HandShake holds details about calls to the HandShake method. 137 HandShake []struct { 138 // ContextMoqParam is the contextMoqParam argument value. 139 ContextMoqParam context.Context 140 // Empty is the empty argument value. 141 Empty *emptypb.Empty 142 } 143 // Messages holds details about calls to the Messages method. 144 Messages []struct { 145 // MessagesRequest is the messagesRequest argument value. 146 MessagesRequest *MessagesRequest 147 // Sentry_MessagesServer is the sentry_MessagesServer argument value. 148 Sentry_MessagesServer Sentry_MessagesServer 149 } 150 // NodeInfo holds details about calls to the NodeInfo method. 151 NodeInfo []struct { 152 // ContextMoqParam is the contextMoqParam argument value. 153 ContextMoqParam context.Context 154 // Empty is the empty argument value. 155 Empty *emptypb.Empty 156 } 157 // PeerById holds details about calls to the PeerById method. 158 PeerById []struct { 159 // ContextMoqParam is the contextMoqParam argument value. 160 ContextMoqParam context.Context 161 // PeerByIdRequest is the peerByIdRequest argument value. 162 PeerByIdRequest *PeerByIdRequest 163 } 164 // PeerCount holds details about calls to the PeerCount method. 165 PeerCount []struct { 166 // ContextMoqParam is the contextMoqParam argument value. 167 ContextMoqParam context.Context 168 // PeerCountRequest is the peerCountRequest argument value. 169 PeerCountRequest *PeerCountRequest 170 } 171 // PeerEvents holds details about calls to the PeerEvents method. 172 PeerEvents []struct { 173 // PeerEventsRequest is the peerEventsRequest argument value. 174 PeerEventsRequest *PeerEventsRequest 175 // Sentry_PeerEventsServer is the sentry_PeerEventsServer argument value. 176 Sentry_PeerEventsServer Sentry_PeerEventsServer 177 } 178 // PeerMinBlock holds details about calls to the PeerMinBlock method. 179 PeerMinBlock []struct { 180 // ContextMoqParam is the contextMoqParam argument value. 181 ContextMoqParam context.Context 182 // PeerMinBlockRequest is the peerMinBlockRequest argument value. 183 PeerMinBlockRequest *PeerMinBlockRequest 184 } 185 // Peers holds details about calls to the Peers method. 186 Peers []struct { 187 // ContextMoqParam is the contextMoqParam argument value. 188 ContextMoqParam context.Context 189 // Empty is the empty argument value. 190 Empty *emptypb.Empty 191 } 192 // PenalizePeer holds details about calls to the PenalizePeer method. 193 PenalizePeer []struct { 194 // ContextMoqParam is the contextMoqParam argument value. 195 ContextMoqParam context.Context 196 // PenalizePeerRequest is the penalizePeerRequest argument value. 197 PenalizePeerRequest *PenalizePeerRequest 198 } 199 // SendMessageById holds details about calls to the SendMessageById method. 200 SendMessageById []struct { 201 // ContextMoqParam is the contextMoqParam argument value. 202 ContextMoqParam context.Context 203 // SendMessageByIdRequest is the sendMessageByIdRequest argument value. 204 SendMessageByIdRequest *SendMessageByIdRequest 205 } 206 // SendMessageByMinBlock holds details about calls to the SendMessageByMinBlock method. 207 SendMessageByMinBlock []struct { 208 // ContextMoqParam is the contextMoqParam argument value. 209 ContextMoqParam context.Context 210 // SendMessageByMinBlockRequest is the sendMessageByMinBlockRequest argument value. 211 SendMessageByMinBlockRequest *SendMessageByMinBlockRequest 212 } 213 // SendMessageToAll holds details about calls to the SendMessageToAll method. 214 SendMessageToAll []struct { 215 // ContextMoqParam is the contextMoqParam argument value. 216 ContextMoqParam context.Context 217 // OutboundMessageData is the outboundMessageData argument value. 218 OutboundMessageData *OutboundMessageData 219 } 220 // SendMessageToRandomPeers holds details about calls to the SendMessageToRandomPeers method. 221 SendMessageToRandomPeers []struct { 222 // ContextMoqParam is the contextMoqParam argument value. 223 ContextMoqParam context.Context 224 // SendMessageToRandomPeersRequest is the sendMessageToRandomPeersRequest argument value. 225 SendMessageToRandomPeersRequest *SendMessageToRandomPeersRequest 226 } 227 // SetStatus holds details about calls to the SetStatus method. 228 SetStatus []struct { 229 // ContextMoqParam is the contextMoqParam argument value. 230 ContextMoqParam context.Context 231 // StatusData is the statusData argument value. 232 StatusData *StatusData 233 } 234 // mustEmbedUnimplementedSentryServer holds details about calls to the mustEmbedUnimplementedSentryServer method. 235 mustEmbedUnimplementedSentryServer []struct { 236 } 237 } 238 lockAddPeer sync.RWMutex 239 lockHandShake sync.RWMutex 240 lockMessages sync.RWMutex 241 lockNodeInfo sync.RWMutex 242 lockPeerById sync.RWMutex 243 lockPeerCount sync.RWMutex 244 lockPeerEvents sync.RWMutex 245 lockPeerMinBlock sync.RWMutex 246 lockPeers sync.RWMutex 247 lockPenalizePeer sync.RWMutex 248 lockSendMessageById sync.RWMutex 249 lockSendMessageByMinBlock sync.RWMutex 250 lockSendMessageToAll sync.RWMutex 251 lockSendMessageToRandomPeers sync.RWMutex 252 lockSetStatus sync.RWMutex 253 lockmustEmbedUnimplementedSentryServer sync.RWMutex 254 } 255 256 // AddPeer calls AddPeerFunc. 257 func (mock *SentryServerMock) AddPeer(contextMoqParam context.Context, addPeerRequest *AddPeerRequest) (*AddPeerReply, error) { 258 callInfo := struct { 259 ContextMoqParam context.Context 260 AddPeerRequest *AddPeerRequest 261 }{ 262 ContextMoqParam: contextMoqParam, 263 AddPeerRequest: addPeerRequest, 264 } 265 mock.lockAddPeer.Lock() 266 mock.calls.AddPeer = append(mock.calls.AddPeer, callInfo) 267 mock.lockAddPeer.Unlock() 268 if mock.AddPeerFunc == nil { 269 var ( 270 addPeerReplyOut *AddPeerReply 271 errOut error 272 ) 273 return addPeerReplyOut, errOut 274 } 275 return mock.AddPeerFunc(contextMoqParam, addPeerRequest) 276 } 277 278 // AddPeerCalls gets all the calls that were made to AddPeer. 279 // Check the length with: 280 // 281 // len(mockedSentryServer.AddPeerCalls()) 282 func (mock *SentryServerMock) AddPeerCalls() []struct { 283 ContextMoqParam context.Context 284 AddPeerRequest *AddPeerRequest 285 } { 286 var calls []struct { 287 ContextMoqParam context.Context 288 AddPeerRequest *AddPeerRequest 289 } 290 mock.lockAddPeer.RLock() 291 calls = mock.calls.AddPeer 292 mock.lockAddPeer.RUnlock() 293 return calls 294 } 295 296 // HandShake calls HandShakeFunc. 297 func (mock *SentryServerMock) HandShake(contextMoqParam context.Context, empty *emptypb.Empty) (*HandShakeReply, error) { 298 callInfo := struct { 299 ContextMoqParam context.Context 300 Empty *emptypb.Empty 301 }{ 302 ContextMoqParam: contextMoqParam, 303 Empty: empty, 304 } 305 mock.lockHandShake.Lock() 306 mock.calls.HandShake = append(mock.calls.HandShake, callInfo) 307 mock.lockHandShake.Unlock() 308 if mock.HandShakeFunc == nil { 309 var ( 310 handShakeReplyOut *HandShakeReply 311 errOut error 312 ) 313 return handShakeReplyOut, errOut 314 } 315 return mock.HandShakeFunc(contextMoqParam, empty) 316 } 317 318 // HandShakeCalls gets all the calls that were made to HandShake. 319 // Check the length with: 320 // 321 // len(mockedSentryServer.HandShakeCalls()) 322 func (mock *SentryServerMock) HandShakeCalls() []struct { 323 ContextMoqParam context.Context 324 Empty *emptypb.Empty 325 } { 326 var calls []struct { 327 ContextMoqParam context.Context 328 Empty *emptypb.Empty 329 } 330 mock.lockHandShake.RLock() 331 calls = mock.calls.HandShake 332 mock.lockHandShake.RUnlock() 333 return calls 334 } 335 336 // Messages calls MessagesFunc. 337 func (mock *SentryServerMock) Messages(messagesRequest *MessagesRequest, sentry_MessagesServer Sentry_MessagesServer) error { 338 callInfo := struct { 339 MessagesRequest *MessagesRequest 340 Sentry_MessagesServer Sentry_MessagesServer 341 }{ 342 MessagesRequest: messagesRequest, 343 Sentry_MessagesServer: sentry_MessagesServer, 344 } 345 mock.lockMessages.Lock() 346 mock.calls.Messages = append(mock.calls.Messages, callInfo) 347 mock.lockMessages.Unlock() 348 if mock.MessagesFunc == nil { 349 var ( 350 errOut error 351 ) 352 return errOut 353 } 354 return mock.MessagesFunc(messagesRequest, sentry_MessagesServer) 355 } 356 357 // MessagesCalls gets all the calls that were made to Messages. 358 // Check the length with: 359 // 360 // len(mockedSentryServer.MessagesCalls()) 361 func (mock *SentryServerMock) MessagesCalls() []struct { 362 MessagesRequest *MessagesRequest 363 Sentry_MessagesServer Sentry_MessagesServer 364 } { 365 var calls []struct { 366 MessagesRequest *MessagesRequest 367 Sentry_MessagesServer Sentry_MessagesServer 368 } 369 mock.lockMessages.RLock() 370 calls = mock.calls.Messages 371 mock.lockMessages.RUnlock() 372 return calls 373 } 374 375 // NodeInfo calls NodeInfoFunc. 376 func (mock *SentryServerMock) NodeInfo(contextMoqParam context.Context, empty *emptypb.Empty) (*types.NodeInfoReply, error) { 377 callInfo := struct { 378 ContextMoqParam context.Context 379 Empty *emptypb.Empty 380 }{ 381 ContextMoqParam: contextMoqParam, 382 Empty: empty, 383 } 384 mock.lockNodeInfo.Lock() 385 mock.calls.NodeInfo = append(mock.calls.NodeInfo, callInfo) 386 mock.lockNodeInfo.Unlock() 387 if mock.NodeInfoFunc == nil { 388 var ( 389 nodeInfoReplyOut *types.NodeInfoReply 390 errOut error 391 ) 392 return nodeInfoReplyOut, errOut 393 } 394 return mock.NodeInfoFunc(contextMoqParam, empty) 395 } 396 397 // NodeInfoCalls gets all the calls that were made to NodeInfo. 398 // Check the length with: 399 // 400 // len(mockedSentryServer.NodeInfoCalls()) 401 func (mock *SentryServerMock) NodeInfoCalls() []struct { 402 ContextMoqParam context.Context 403 Empty *emptypb.Empty 404 } { 405 var calls []struct { 406 ContextMoqParam context.Context 407 Empty *emptypb.Empty 408 } 409 mock.lockNodeInfo.RLock() 410 calls = mock.calls.NodeInfo 411 mock.lockNodeInfo.RUnlock() 412 return calls 413 } 414 415 // PeerById calls PeerByIdFunc. 416 func (mock *SentryServerMock) PeerById(contextMoqParam context.Context, peerByIdRequest *PeerByIdRequest) (*PeerByIdReply, error) { 417 callInfo := struct { 418 ContextMoqParam context.Context 419 PeerByIdRequest *PeerByIdRequest 420 }{ 421 ContextMoqParam: contextMoqParam, 422 PeerByIdRequest: peerByIdRequest, 423 } 424 mock.lockPeerById.Lock() 425 mock.calls.PeerById = append(mock.calls.PeerById, callInfo) 426 mock.lockPeerById.Unlock() 427 if mock.PeerByIdFunc == nil { 428 var ( 429 peerByIdReplyOut *PeerByIdReply 430 errOut error 431 ) 432 return peerByIdReplyOut, errOut 433 } 434 return mock.PeerByIdFunc(contextMoqParam, peerByIdRequest) 435 } 436 437 // PeerByIdCalls gets all the calls that were made to PeerById. 438 // Check the length with: 439 // 440 // len(mockedSentryServer.PeerByIdCalls()) 441 func (mock *SentryServerMock) PeerByIdCalls() []struct { 442 ContextMoqParam context.Context 443 PeerByIdRequest *PeerByIdRequest 444 } { 445 var calls []struct { 446 ContextMoqParam context.Context 447 PeerByIdRequest *PeerByIdRequest 448 } 449 mock.lockPeerById.RLock() 450 calls = mock.calls.PeerById 451 mock.lockPeerById.RUnlock() 452 return calls 453 } 454 455 // PeerCount calls PeerCountFunc. 456 func (mock *SentryServerMock) PeerCount(contextMoqParam context.Context, peerCountRequest *PeerCountRequest) (*PeerCountReply, error) { 457 callInfo := struct { 458 ContextMoqParam context.Context 459 PeerCountRequest *PeerCountRequest 460 }{ 461 ContextMoqParam: contextMoqParam, 462 PeerCountRequest: peerCountRequest, 463 } 464 mock.lockPeerCount.Lock() 465 mock.calls.PeerCount = append(mock.calls.PeerCount, callInfo) 466 mock.lockPeerCount.Unlock() 467 if mock.PeerCountFunc == nil { 468 var ( 469 peerCountReplyOut *PeerCountReply 470 errOut error 471 ) 472 return peerCountReplyOut, errOut 473 } 474 return mock.PeerCountFunc(contextMoqParam, peerCountRequest) 475 } 476 477 // PeerCountCalls gets all the calls that were made to PeerCount. 478 // Check the length with: 479 // 480 // len(mockedSentryServer.PeerCountCalls()) 481 func (mock *SentryServerMock) PeerCountCalls() []struct { 482 ContextMoqParam context.Context 483 PeerCountRequest *PeerCountRequest 484 } { 485 var calls []struct { 486 ContextMoqParam context.Context 487 PeerCountRequest *PeerCountRequest 488 } 489 mock.lockPeerCount.RLock() 490 calls = mock.calls.PeerCount 491 mock.lockPeerCount.RUnlock() 492 return calls 493 } 494 495 // PeerEvents calls PeerEventsFunc. 496 func (mock *SentryServerMock) PeerEvents(peerEventsRequest *PeerEventsRequest, sentry_PeerEventsServer Sentry_PeerEventsServer) error { 497 callInfo := struct { 498 PeerEventsRequest *PeerEventsRequest 499 Sentry_PeerEventsServer Sentry_PeerEventsServer 500 }{ 501 PeerEventsRequest: peerEventsRequest, 502 Sentry_PeerEventsServer: sentry_PeerEventsServer, 503 } 504 mock.lockPeerEvents.Lock() 505 mock.calls.PeerEvents = append(mock.calls.PeerEvents, callInfo) 506 mock.lockPeerEvents.Unlock() 507 if mock.PeerEventsFunc == nil { 508 var ( 509 errOut error 510 ) 511 return errOut 512 } 513 return mock.PeerEventsFunc(peerEventsRequest, sentry_PeerEventsServer) 514 } 515 516 // PeerEventsCalls gets all the calls that were made to PeerEvents. 517 // Check the length with: 518 // 519 // len(mockedSentryServer.PeerEventsCalls()) 520 func (mock *SentryServerMock) PeerEventsCalls() []struct { 521 PeerEventsRequest *PeerEventsRequest 522 Sentry_PeerEventsServer Sentry_PeerEventsServer 523 } { 524 var calls []struct { 525 PeerEventsRequest *PeerEventsRequest 526 Sentry_PeerEventsServer Sentry_PeerEventsServer 527 } 528 mock.lockPeerEvents.RLock() 529 calls = mock.calls.PeerEvents 530 mock.lockPeerEvents.RUnlock() 531 return calls 532 } 533 534 // PeerMinBlock calls PeerMinBlockFunc. 535 func (mock *SentryServerMock) PeerMinBlock(contextMoqParam context.Context, peerMinBlockRequest *PeerMinBlockRequest) (*emptypb.Empty, error) { 536 callInfo := struct { 537 ContextMoqParam context.Context 538 PeerMinBlockRequest *PeerMinBlockRequest 539 }{ 540 ContextMoqParam: contextMoqParam, 541 PeerMinBlockRequest: peerMinBlockRequest, 542 } 543 mock.lockPeerMinBlock.Lock() 544 mock.calls.PeerMinBlock = append(mock.calls.PeerMinBlock, callInfo) 545 mock.lockPeerMinBlock.Unlock() 546 if mock.PeerMinBlockFunc == nil { 547 var ( 548 emptyOut *emptypb.Empty 549 errOut error 550 ) 551 return emptyOut, errOut 552 } 553 return mock.PeerMinBlockFunc(contextMoqParam, peerMinBlockRequest) 554 } 555 556 // PeerMinBlockCalls gets all the calls that were made to PeerMinBlock. 557 // Check the length with: 558 // 559 // len(mockedSentryServer.PeerMinBlockCalls()) 560 func (mock *SentryServerMock) PeerMinBlockCalls() []struct { 561 ContextMoqParam context.Context 562 PeerMinBlockRequest *PeerMinBlockRequest 563 } { 564 var calls []struct { 565 ContextMoqParam context.Context 566 PeerMinBlockRequest *PeerMinBlockRequest 567 } 568 mock.lockPeerMinBlock.RLock() 569 calls = mock.calls.PeerMinBlock 570 mock.lockPeerMinBlock.RUnlock() 571 return calls 572 } 573 574 // Peers calls PeersFunc. 575 func (mock *SentryServerMock) Peers(contextMoqParam context.Context, empty *emptypb.Empty) (*PeersReply, error) { 576 callInfo := struct { 577 ContextMoqParam context.Context 578 Empty *emptypb.Empty 579 }{ 580 ContextMoqParam: contextMoqParam, 581 Empty: empty, 582 } 583 mock.lockPeers.Lock() 584 mock.calls.Peers = append(mock.calls.Peers, callInfo) 585 mock.lockPeers.Unlock() 586 if mock.PeersFunc == nil { 587 var ( 588 peersReplyOut *PeersReply 589 errOut error 590 ) 591 return peersReplyOut, errOut 592 } 593 return mock.PeersFunc(contextMoqParam, empty) 594 } 595 596 // PeersCalls gets all the calls that were made to Peers. 597 // Check the length with: 598 // 599 // len(mockedSentryServer.PeersCalls()) 600 func (mock *SentryServerMock) PeersCalls() []struct { 601 ContextMoqParam context.Context 602 Empty *emptypb.Empty 603 } { 604 var calls []struct { 605 ContextMoqParam context.Context 606 Empty *emptypb.Empty 607 } 608 mock.lockPeers.RLock() 609 calls = mock.calls.Peers 610 mock.lockPeers.RUnlock() 611 return calls 612 } 613 614 // PenalizePeer calls PenalizePeerFunc. 615 func (mock *SentryServerMock) PenalizePeer(contextMoqParam context.Context, penalizePeerRequest *PenalizePeerRequest) (*emptypb.Empty, error) { 616 callInfo := struct { 617 ContextMoqParam context.Context 618 PenalizePeerRequest *PenalizePeerRequest 619 }{ 620 ContextMoqParam: contextMoqParam, 621 PenalizePeerRequest: penalizePeerRequest, 622 } 623 mock.lockPenalizePeer.Lock() 624 mock.calls.PenalizePeer = append(mock.calls.PenalizePeer, callInfo) 625 mock.lockPenalizePeer.Unlock() 626 if mock.PenalizePeerFunc == nil { 627 var ( 628 emptyOut *emptypb.Empty 629 errOut error 630 ) 631 return emptyOut, errOut 632 } 633 return mock.PenalizePeerFunc(contextMoqParam, penalizePeerRequest) 634 } 635 636 // PenalizePeerCalls gets all the calls that were made to PenalizePeer. 637 // Check the length with: 638 // 639 // len(mockedSentryServer.PenalizePeerCalls()) 640 func (mock *SentryServerMock) PenalizePeerCalls() []struct { 641 ContextMoqParam context.Context 642 PenalizePeerRequest *PenalizePeerRequest 643 } { 644 var calls []struct { 645 ContextMoqParam context.Context 646 PenalizePeerRequest *PenalizePeerRequest 647 } 648 mock.lockPenalizePeer.RLock() 649 calls = mock.calls.PenalizePeer 650 mock.lockPenalizePeer.RUnlock() 651 return calls 652 } 653 654 // SendMessageById calls SendMessageByIdFunc. 655 func (mock *SentryServerMock) SendMessageById(contextMoqParam context.Context, sendMessageByIdRequest *SendMessageByIdRequest) (*SentPeers, error) { 656 callInfo := struct { 657 ContextMoqParam context.Context 658 SendMessageByIdRequest *SendMessageByIdRequest 659 }{ 660 ContextMoqParam: contextMoqParam, 661 SendMessageByIdRequest: sendMessageByIdRequest, 662 } 663 mock.lockSendMessageById.Lock() 664 mock.calls.SendMessageById = append(mock.calls.SendMessageById, callInfo) 665 mock.lockSendMessageById.Unlock() 666 if mock.SendMessageByIdFunc == nil { 667 var ( 668 sentPeersOut *SentPeers 669 errOut error 670 ) 671 return sentPeersOut, errOut 672 } 673 return mock.SendMessageByIdFunc(contextMoqParam, sendMessageByIdRequest) 674 } 675 676 // SendMessageByIdCalls gets all the calls that were made to SendMessageById. 677 // Check the length with: 678 // 679 // len(mockedSentryServer.SendMessageByIdCalls()) 680 func (mock *SentryServerMock) SendMessageByIdCalls() []struct { 681 ContextMoqParam context.Context 682 SendMessageByIdRequest *SendMessageByIdRequest 683 } { 684 var calls []struct { 685 ContextMoqParam context.Context 686 SendMessageByIdRequest *SendMessageByIdRequest 687 } 688 mock.lockSendMessageById.RLock() 689 calls = mock.calls.SendMessageById 690 mock.lockSendMessageById.RUnlock() 691 return calls 692 } 693 694 // SendMessageByMinBlock calls SendMessageByMinBlockFunc. 695 func (mock *SentryServerMock) SendMessageByMinBlock(contextMoqParam context.Context, sendMessageByMinBlockRequest *SendMessageByMinBlockRequest) (*SentPeers, error) { 696 callInfo := struct { 697 ContextMoqParam context.Context 698 SendMessageByMinBlockRequest *SendMessageByMinBlockRequest 699 }{ 700 ContextMoqParam: contextMoqParam, 701 SendMessageByMinBlockRequest: sendMessageByMinBlockRequest, 702 } 703 mock.lockSendMessageByMinBlock.Lock() 704 mock.calls.SendMessageByMinBlock = append(mock.calls.SendMessageByMinBlock, callInfo) 705 mock.lockSendMessageByMinBlock.Unlock() 706 if mock.SendMessageByMinBlockFunc == nil { 707 var ( 708 sentPeersOut *SentPeers 709 errOut error 710 ) 711 return sentPeersOut, errOut 712 } 713 return mock.SendMessageByMinBlockFunc(contextMoqParam, sendMessageByMinBlockRequest) 714 } 715 716 // SendMessageByMinBlockCalls gets all the calls that were made to SendMessageByMinBlock. 717 // Check the length with: 718 // 719 // len(mockedSentryServer.SendMessageByMinBlockCalls()) 720 func (mock *SentryServerMock) SendMessageByMinBlockCalls() []struct { 721 ContextMoqParam context.Context 722 SendMessageByMinBlockRequest *SendMessageByMinBlockRequest 723 } { 724 var calls []struct { 725 ContextMoqParam context.Context 726 SendMessageByMinBlockRequest *SendMessageByMinBlockRequest 727 } 728 mock.lockSendMessageByMinBlock.RLock() 729 calls = mock.calls.SendMessageByMinBlock 730 mock.lockSendMessageByMinBlock.RUnlock() 731 return calls 732 } 733 734 // SendMessageToAll calls SendMessageToAllFunc. 735 func (mock *SentryServerMock) SendMessageToAll(contextMoqParam context.Context, outboundMessageData *OutboundMessageData) (*SentPeers, error) { 736 callInfo := struct { 737 ContextMoqParam context.Context 738 OutboundMessageData *OutboundMessageData 739 }{ 740 ContextMoqParam: contextMoqParam, 741 OutboundMessageData: outboundMessageData, 742 } 743 mock.lockSendMessageToAll.Lock() 744 mock.calls.SendMessageToAll = append(mock.calls.SendMessageToAll, callInfo) 745 mock.lockSendMessageToAll.Unlock() 746 if mock.SendMessageToAllFunc == nil { 747 var ( 748 sentPeersOut *SentPeers 749 errOut error 750 ) 751 return sentPeersOut, errOut 752 } 753 return mock.SendMessageToAllFunc(contextMoqParam, outboundMessageData) 754 } 755 756 // SendMessageToAllCalls gets all the calls that were made to SendMessageToAll. 757 // Check the length with: 758 // 759 // len(mockedSentryServer.SendMessageToAllCalls()) 760 func (mock *SentryServerMock) SendMessageToAllCalls() []struct { 761 ContextMoqParam context.Context 762 OutboundMessageData *OutboundMessageData 763 } { 764 var calls []struct { 765 ContextMoqParam context.Context 766 OutboundMessageData *OutboundMessageData 767 } 768 mock.lockSendMessageToAll.RLock() 769 calls = mock.calls.SendMessageToAll 770 mock.lockSendMessageToAll.RUnlock() 771 return calls 772 } 773 774 // SendMessageToRandomPeers calls SendMessageToRandomPeersFunc. 775 func (mock *SentryServerMock) SendMessageToRandomPeers(contextMoqParam context.Context, sendMessageToRandomPeersRequest *SendMessageToRandomPeersRequest) (*SentPeers, error) { 776 callInfo := struct { 777 ContextMoqParam context.Context 778 SendMessageToRandomPeersRequest *SendMessageToRandomPeersRequest 779 }{ 780 ContextMoqParam: contextMoqParam, 781 SendMessageToRandomPeersRequest: sendMessageToRandomPeersRequest, 782 } 783 mock.lockSendMessageToRandomPeers.Lock() 784 mock.calls.SendMessageToRandomPeers = append(mock.calls.SendMessageToRandomPeers, callInfo) 785 mock.lockSendMessageToRandomPeers.Unlock() 786 if mock.SendMessageToRandomPeersFunc == nil { 787 var ( 788 sentPeersOut *SentPeers 789 errOut error 790 ) 791 return sentPeersOut, errOut 792 } 793 return mock.SendMessageToRandomPeersFunc(contextMoqParam, sendMessageToRandomPeersRequest) 794 } 795 796 // SendMessageToRandomPeersCalls gets all the calls that were made to SendMessageToRandomPeers. 797 // Check the length with: 798 // 799 // len(mockedSentryServer.SendMessageToRandomPeersCalls()) 800 func (mock *SentryServerMock) SendMessageToRandomPeersCalls() []struct { 801 ContextMoqParam context.Context 802 SendMessageToRandomPeersRequest *SendMessageToRandomPeersRequest 803 } { 804 var calls []struct { 805 ContextMoqParam context.Context 806 SendMessageToRandomPeersRequest *SendMessageToRandomPeersRequest 807 } 808 mock.lockSendMessageToRandomPeers.RLock() 809 calls = mock.calls.SendMessageToRandomPeers 810 mock.lockSendMessageToRandomPeers.RUnlock() 811 return calls 812 } 813 814 // SetStatus calls SetStatusFunc. 815 func (mock *SentryServerMock) SetStatus(contextMoqParam context.Context, statusData *StatusData) (*SetStatusReply, error) { 816 callInfo := struct { 817 ContextMoqParam context.Context 818 StatusData *StatusData 819 }{ 820 ContextMoqParam: contextMoqParam, 821 StatusData: statusData, 822 } 823 mock.lockSetStatus.Lock() 824 mock.calls.SetStatus = append(mock.calls.SetStatus, callInfo) 825 mock.lockSetStatus.Unlock() 826 if mock.SetStatusFunc == nil { 827 var ( 828 setStatusReplyOut *SetStatusReply 829 errOut error 830 ) 831 return setStatusReplyOut, errOut 832 } 833 return mock.SetStatusFunc(contextMoqParam, statusData) 834 } 835 836 // SetStatusCalls gets all the calls that were made to SetStatus. 837 // Check the length with: 838 // 839 // len(mockedSentryServer.SetStatusCalls()) 840 func (mock *SentryServerMock) SetStatusCalls() []struct { 841 ContextMoqParam context.Context 842 StatusData *StatusData 843 } { 844 var calls []struct { 845 ContextMoqParam context.Context 846 StatusData *StatusData 847 } 848 mock.lockSetStatus.RLock() 849 calls = mock.calls.SetStatus 850 mock.lockSetStatus.RUnlock() 851 return calls 852 } 853 854 // mustEmbedUnimplementedSentryServer calls mustEmbedUnimplementedSentryServerFunc. 855 func (mock *SentryServerMock) mustEmbedUnimplementedSentryServer() { 856 callInfo := struct { 857 }{} 858 mock.lockmustEmbedUnimplementedSentryServer.Lock() 859 mock.calls.mustEmbedUnimplementedSentryServer = append(mock.calls.mustEmbedUnimplementedSentryServer, callInfo) 860 mock.lockmustEmbedUnimplementedSentryServer.Unlock() 861 if mock.mustEmbedUnimplementedSentryServerFunc == nil { 862 return 863 } 864 mock.mustEmbedUnimplementedSentryServerFunc() 865 } 866 867 // mustEmbedUnimplementedSentryServerCalls gets all the calls that were made to mustEmbedUnimplementedSentryServer. 868 // Check the length with: 869 // 870 // len(mockedSentryServer.mustEmbedUnimplementedSentryServerCalls()) 871 func (mock *SentryServerMock) mustEmbedUnimplementedSentryServerCalls() []struct { 872 } { 873 var calls []struct { 874 } 875 mock.lockmustEmbedUnimplementedSentryServer.RLock() 876 calls = mock.calls.mustEmbedUnimplementedSentryServer 877 mock.lockmustEmbedUnimplementedSentryServer.RUnlock() 878 return calls 879 } 880 881 // Ensure, that SentryClientMock does implement SentryClient. 882 // If this is not the case, regenerate this file with moq. 883 var _ SentryClient = &SentryClientMock{} 884 885 // SentryClientMock is a mock implementation of SentryClient. 886 // 887 // func TestSomethingThatUsesSentryClient(t *testing.T) { 888 // 889 // // make and configure a mocked SentryClient 890 // mockedSentryClient := &SentryClientMock{ 891 // AddPeerFunc: func(ctx context.Context, in *AddPeerRequest, opts ...grpc.CallOption) (*AddPeerReply, error) { 892 // panic("mock out the AddPeer method") 893 // }, 894 // HandShakeFunc: func(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HandShakeReply, error) { 895 // panic("mock out the HandShake method") 896 // }, 897 // MessagesFunc: func(ctx context.Context, in *MessagesRequest, opts ...grpc.CallOption) (Sentry_MessagesClient, error) { 898 // panic("mock out the Messages method") 899 // }, 900 // NodeInfoFunc: func(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.NodeInfoReply, error) { 901 // panic("mock out the NodeInfo method") 902 // }, 903 // PeerByIdFunc: func(ctx context.Context, in *PeerByIdRequest, opts ...grpc.CallOption) (*PeerByIdReply, error) { 904 // panic("mock out the PeerById method") 905 // }, 906 // PeerCountFunc: func(ctx context.Context, in *PeerCountRequest, opts ...grpc.CallOption) (*PeerCountReply, error) { 907 // panic("mock out the PeerCount method") 908 // }, 909 // PeerEventsFunc: func(ctx context.Context, in *PeerEventsRequest, opts ...grpc.CallOption) (Sentry_PeerEventsClient, error) { 910 // panic("mock out the PeerEvents method") 911 // }, 912 // PeerMinBlockFunc: func(ctx context.Context, in *PeerMinBlockRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { 913 // panic("mock out the PeerMinBlock method") 914 // }, 915 // PeersFunc: func(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PeersReply, error) { 916 // panic("mock out the Peers method") 917 // }, 918 // PenalizePeerFunc: func(ctx context.Context, in *PenalizePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { 919 // panic("mock out the PenalizePeer method") 920 // }, 921 // SendMessageByIdFunc: func(ctx context.Context, in *SendMessageByIdRequest, opts ...grpc.CallOption) (*SentPeers, error) { 922 // panic("mock out the SendMessageById method") 923 // }, 924 // SendMessageByMinBlockFunc: func(ctx context.Context, in *SendMessageByMinBlockRequest, opts ...grpc.CallOption) (*SentPeers, error) { 925 // panic("mock out the SendMessageByMinBlock method") 926 // }, 927 // SendMessageToAllFunc: func(ctx context.Context, in *OutboundMessageData, opts ...grpc.CallOption) (*SentPeers, error) { 928 // panic("mock out the SendMessageToAll method") 929 // }, 930 // SendMessageToRandomPeersFunc: func(ctx context.Context, in *SendMessageToRandomPeersRequest, opts ...grpc.CallOption) (*SentPeers, error) { 931 // panic("mock out the SendMessageToRandomPeers method") 932 // }, 933 // SetStatusFunc: func(ctx context.Context, in *StatusData, opts ...grpc.CallOption) (*SetStatusReply, error) { 934 // panic("mock out the SetStatus method") 935 // }, 936 // } 937 // 938 // // use mockedSentryClient in code that requires SentryClient 939 // // and then make assertions. 940 // 941 // } 942 type SentryClientMock struct { 943 // AddPeerFunc mocks the AddPeer method. 944 AddPeerFunc func(ctx context.Context, in *AddPeerRequest, opts ...grpc.CallOption) (*AddPeerReply, error) 945 946 // HandShakeFunc mocks the HandShake method. 947 HandShakeFunc func(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HandShakeReply, error) 948 949 // MessagesFunc mocks the Messages method. 950 MessagesFunc func(ctx context.Context, in *MessagesRequest, opts ...grpc.CallOption) (Sentry_MessagesClient, error) 951 952 // NodeInfoFunc mocks the NodeInfo method. 953 NodeInfoFunc func(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.NodeInfoReply, error) 954 955 // PeerByIdFunc mocks the PeerById method. 956 PeerByIdFunc func(ctx context.Context, in *PeerByIdRequest, opts ...grpc.CallOption) (*PeerByIdReply, error) 957 958 // PeerCountFunc mocks the PeerCount method. 959 PeerCountFunc func(ctx context.Context, in *PeerCountRequest, opts ...grpc.CallOption) (*PeerCountReply, error) 960 961 // PeerEventsFunc mocks the PeerEvents method. 962 PeerEventsFunc func(ctx context.Context, in *PeerEventsRequest, opts ...grpc.CallOption) (Sentry_PeerEventsClient, error) 963 964 // PeerMinBlockFunc mocks the PeerMinBlock method. 965 PeerMinBlockFunc func(ctx context.Context, in *PeerMinBlockRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) 966 967 // PeersFunc mocks the Peers method. 968 PeersFunc func(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PeersReply, error) 969 970 // PenalizePeerFunc mocks the PenalizePeer method. 971 PenalizePeerFunc func(ctx context.Context, in *PenalizePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) 972 973 // SendMessageByIdFunc mocks the SendMessageById method. 974 SendMessageByIdFunc func(ctx context.Context, in *SendMessageByIdRequest, opts ...grpc.CallOption) (*SentPeers, error) 975 976 // SendMessageByMinBlockFunc mocks the SendMessageByMinBlock method. 977 SendMessageByMinBlockFunc func(ctx context.Context, in *SendMessageByMinBlockRequest, opts ...grpc.CallOption) (*SentPeers, error) 978 979 // SendMessageToAllFunc mocks the SendMessageToAll method. 980 SendMessageToAllFunc func(ctx context.Context, in *OutboundMessageData, opts ...grpc.CallOption) (*SentPeers, error) 981 982 // SendMessageToRandomPeersFunc mocks the SendMessageToRandomPeers method. 983 SendMessageToRandomPeersFunc func(ctx context.Context, in *SendMessageToRandomPeersRequest, opts ...grpc.CallOption) (*SentPeers, error) 984 985 // SetStatusFunc mocks the SetStatus method. 986 SetStatusFunc func(ctx context.Context, in *StatusData, opts ...grpc.CallOption) (*SetStatusReply, error) 987 988 // calls tracks calls to the methods. 989 calls struct { 990 // AddPeer holds details about calls to the AddPeer method. 991 AddPeer []struct { 992 // Ctx is the ctx argument value. 993 Ctx context.Context 994 // In is the in argument value. 995 In *AddPeerRequest 996 // Opts is the opts argument value. 997 Opts []grpc.CallOption 998 } 999 // HandShake holds details about calls to the HandShake method. 1000 HandShake []struct { 1001 // Ctx is the ctx argument value. 1002 Ctx context.Context 1003 // In is the in argument value. 1004 In *emptypb.Empty 1005 // Opts is the opts argument value. 1006 Opts []grpc.CallOption 1007 } 1008 // Messages holds details about calls to the Messages method. 1009 Messages []struct { 1010 // Ctx is the ctx argument value. 1011 Ctx context.Context 1012 // In is the in argument value. 1013 In *MessagesRequest 1014 // Opts is the opts argument value. 1015 Opts []grpc.CallOption 1016 } 1017 // NodeInfo holds details about calls to the NodeInfo method. 1018 NodeInfo []struct { 1019 // Ctx is the ctx argument value. 1020 Ctx context.Context 1021 // In is the in argument value. 1022 In *emptypb.Empty 1023 // Opts is the opts argument value. 1024 Opts []grpc.CallOption 1025 } 1026 // PeerById holds details about calls to the PeerById method. 1027 PeerById []struct { 1028 // Ctx is the ctx argument value. 1029 Ctx context.Context 1030 // In is the in argument value. 1031 In *PeerByIdRequest 1032 // Opts is the opts argument value. 1033 Opts []grpc.CallOption 1034 } 1035 // PeerCount holds details about calls to the PeerCount method. 1036 PeerCount []struct { 1037 // Ctx is the ctx argument value. 1038 Ctx context.Context 1039 // In is the in argument value. 1040 In *PeerCountRequest 1041 // Opts is the opts argument value. 1042 Opts []grpc.CallOption 1043 } 1044 // PeerEvents holds details about calls to the PeerEvents method. 1045 PeerEvents []struct { 1046 // Ctx is the ctx argument value. 1047 Ctx context.Context 1048 // In is the in argument value. 1049 In *PeerEventsRequest 1050 // Opts is the opts argument value. 1051 Opts []grpc.CallOption 1052 } 1053 // PeerMinBlock holds details about calls to the PeerMinBlock method. 1054 PeerMinBlock []struct { 1055 // Ctx is the ctx argument value. 1056 Ctx context.Context 1057 // In is the in argument value. 1058 In *PeerMinBlockRequest 1059 // Opts is the opts argument value. 1060 Opts []grpc.CallOption 1061 } 1062 // Peers holds details about calls to the Peers method. 1063 Peers []struct { 1064 // Ctx is the ctx argument value. 1065 Ctx context.Context 1066 // In is the in argument value. 1067 In *emptypb.Empty 1068 // Opts is the opts argument value. 1069 Opts []grpc.CallOption 1070 } 1071 // PenalizePeer holds details about calls to the PenalizePeer method. 1072 PenalizePeer []struct { 1073 // Ctx is the ctx argument value. 1074 Ctx context.Context 1075 // In is the in argument value. 1076 In *PenalizePeerRequest 1077 // Opts is the opts argument value. 1078 Opts []grpc.CallOption 1079 } 1080 // SendMessageById holds details about calls to the SendMessageById method. 1081 SendMessageById []struct { 1082 // Ctx is the ctx argument value. 1083 Ctx context.Context 1084 // In is the in argument value. 1085 In *SendMessageByIdRequest 1086 // Opts is the opts argument value. 1087 Opts []grpc.CallOption 1088 } 1089 // SendMessageByMinBlock holds details about calls to the SendMessageByMinBlock method. 1090 SendMessageByMinBlock []struct { 1091 // Ctx is the ctx argument value. 1092 Ctx context.Context 1093 // In is the in argument value. 1094 In *SendMessageByMinBlockRequest 1095 // Opts is the opts argument value. 1096 Opts []grpc.CallOption 1097 } 1098 // SendMessageToAll holds details about calls to the SendMessageToAll method. 1099 SendMessageToAll []struct { 1100 // Ctx is the ctx argument value. 1101 Ctx context.Context 1102 // In is the in argument value. 1103 In *OutboundMessageData 1104 // Opts is the opts argument value. 1105 Opts []grpc.CallOption 1106 } 1107 // SendMessageToRandomPeers holds details about calls to the SendMessageToRandomPeers method. 1108 SendMessageToRandomPeers []struct { 1109 // Ctx is the ctx argument value. 1110 Ctx context.Context 1111 // In is the in argument value. 1112 In *SendMessageToRandomPeersRequest 1113 // Opts is the opts argument value. 1114 Opts []grpc.CallOption 1115 } 1116 // SetStatus holds details about calls to the SetStatus method. 1117 SetStatus []struct { 1118 // Ctx is the ctx argument value. 1119 Ctx context.Context 1120 // In is the in argument value. 1121 In *StatusData 1122 // Opts is the opts argument value. 1123 Opts []grpc.CallOption 1124 } 1125 } 1126 lockAddPeer sync.RWMutex 1127 lockHandShake sync.RWMutex 1128 lockMessages sync.RWMutex 1129 lockNodeInfo sync.RWMutex 1130 lockPeerById sync.RWMutex 1131 lockPeerCount sync.RWMutex 1132 lockPeerEvents sync.RWMutex 1133 lockPeerMinBlock sync.RWMutex 1134 lockPeers sync.RWMutex 1135 lockPenalizePeer sync.RWMutex 1136 lockSendMessageById sync.RWMutex 1137 lockSendMessageByMinBlock sync.RWMutex 1138 lockSendMessageToAll sync.RWMutex 1139 lockSendMessageToRandomPeers sync.RWMutex 1140 lockSetStatus sync.RWMutex 1141 } 1142 1143 // AddPeer calls AddPeerFunc. 1144 func (mock *SentryClientMock) AddPeer(ctx context.Context, in *AddPeerRequest, opts ...grpc.CallOption) (*AddPeerReply, error) { 1145 callInfo := struct { 1146 Ctx context.Context 1147 In *AddPeerRequest 1148 Opts []grpc.CallOption 1149 }{ 1150 Ctx: ctx, 1151 In: in, 1152 Opts: opts, 1153 } 1154 mock.lockAddPeer.Lock() 1155 mock.calls.AddPeer = append(mock.calls.AddPeer, callInfo) 1156 mock.lockAddPeer.Unlock() 1157 if mock.AddPeerFunc == nil { 1158 var ( 1159 addPeerReplyOut *AddPeerReply 1160 errOut error 1161 ) 1162 return addPeerReplyOut, errOut 1163 } 1164 return mock.AddPeerFunc(ctx, in, opts...) 1165 } 1166 1167 // AddPeerCalls gets all the calls that were made to AddPeer. 1168 // Check the length with: 1169 // 1170 // len(mockedSentryClient.AddPeerCalls()) 1171 func (mock *SentryClientMock) AddPeerCalls() []struct { 1172 Ctx context.Context 1173 In *AddPeerRequest 1174 Opts []grpc.CallOption 1175 } { 1176 var calls []struct { 1177 Ctx context.Context 1178 In *AddPeerRequest 1179 Opts []grpc.CallOption 1180 } 1181 mock.lockAddPeer.RLock() 1182 calls = mock.calls.AddPeer 1183 mock.lockAddPeer.RUnlock() 1184 return calls 1185 } 1186 1187 // HandShake calls HandShakeFunc. 1188 func (mock *SentryClientMock) HandShake(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HandShakeReply, error) { 1189 callInfo := struct { 1190 Ctx context.Context 1191 In *emptypb.Empty 1192 Opts []grpc.CallOption 1193 }{ 1194 Ctx: ctx, 1195 In: in, 1196 Opts: opts, 1197 } 1198 mock.lockHandShake.Lock() 1199 mock.calls.HandShake = append(mock.calls.HandShake, callInfo) 1200 mock.lockHandShake.Unlock() 1201 if mock.HandShakeFunc == nil { 1202 var ( 1203 handShakeReplyOut *HandShakeReply 1204 errOut error 1205 ) 1206 return handShakeReplyOut, errOut 1207 } 1208 return mock.HandShakeFunc(ctx, in, opts...) 1209 } 1210 1211 // HandShakeCalls gets all the calls that were made to HandShake. 1212 // Check the length with: 1213 // 1214 // len(mockedSentryClient.HandShakeCalls()) 1215 func (mock *SentryClientMock) HandShakeCalls() []struct { 1216 Ctx context.Context 1217 In *emptypb.Empty 1218 Opts []grpc.CallOption 1219 } { 1220 var calls []struct { 1221 Ctx context.Context 1222 In *emptypb.Empty 1223 Opts []grpc.CallOption 1224 } 1225 mock.lockHandShake.RLock() 1226 calls = mock.calls.HandShake 1227 mock.lockHandShake.RUnlock() 1228 return calls 1229 } 1230 1231 // Messages calls MessagesFunc. 1232 func (mock *SentryClientMock) Messages(ctx context.Context, in *MessagesRequest, opts ...grpc.CallOption) (Sentry_MessagesClient, error) { 1233 callInfo := struct { 1234 Ctx context.Context 1235 In *MessagesRequest 1236 Opts []grpc.CallOption 1237 }{ 1238 Ctx: ctx, 1239 In: in, 1240 Opts: opts, 1241 } 1242 mock.lockMessages.Lock() 1243 mock.calls.Messages = append(mock.calls.Messages, callInfo) 1244 mock.lockMessages.Unlock() 1245 if mock.MessagesFunc == nil { 1246 var ( 1247 sentry_MessagesClientOut Sentry_MessagesClient 1248 errOut error 1249 ) 1250 return sentry_MessagesClientOut, errOut 1251 } 1252 return mock.MessagesFunc(ctx, in, opts...) 1253 } 1254 1255 // MessagesCalls gets all the calls that were made to Messages. 1256 // Check the length with: 1257 // 1258 // len(mockedSentryClient.MessagesCalls()) 1259 func (mock *SentryClientMock) MessagesCalls() []struct { 1260 Ctx context.Context 1261 In *MessagesRequest 1262 Opts []grpc.CallOption 1263 } { 1264 var calls []struct { 1265 Ctx context.Context 1266 In *MessagesRequest 1267 Opts []grpc.CallOption 1268 } 1269 mock.lockMessages.RLock() 1270 calls = mock.calls.Messages 1271 mock.lockMessages.RUnlock() 1272 return calls 1273 } 1274 1275 // NodeInfo calls NodeInfoFunc. 1276 func (mock *SentryClientMock) NodeInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.NodeInfoReply, error) { 1277 callInfo := struct { 1278 Ctx context.Context 1279 In *emptypb.Empty 1280 Opts []grpc.CallOption 1281 }{ 1282 Ctx: ctx, 1283 In: in, 1284 Opts: opts, 1285 } 1286 mock.lockNodeInfo.Lock() 1287 mock.calls.NodeInfo = append(mock.calls.NodeInfo, callInfo) 1288 mock.lockNodeInfo.Unlock() 1289 if mock.NodeInfoFunc == nil { 1290 var ( 1291 nodeInfoReplyOut *types.NodeInfoReply 1292 errOut error 1293 ) 1294 return nodeInfoReplyOut, errOut 1295 } 1296 return mock.NodeInfoFunc(ctx, in, opts...) 1297 } 1298 1299 // NodeInfoCalls gets all the calls that were made to NodeInfo. 1300 // Check the length with: 1301 // 1302 // len(mockedSentryClient.NodeInfoCalls()) 1303 func (mock *SentryClientMock) NodeInfoCalls() []struct { 1304 Ctx context.Context 1305 In *emptypb.Empty 1306 Opts []grpc.CallOption 1307 } { 1308 var calls []struct { 1309 Ctx context.Context 1310 In *emptypb.Empty 1311 Opts []grpc.CallOption 1312 } 1313 mock.lockNodeInfo.RLock() 1314 calls = mock.calls.NodeInfo 1315 mock.lockNodeInfo.RUnlock() 1316 return calls 1317 } 1318 1319 // PeerById calls PeerByIdFunc. 1320 func (mock *SentryClientMock) PeerById(ctx context.Context, in *PeerByIdRequest, opts ...grpc.CallOption) (*PeerByIdReply, error) { 1321 callInfo := struct { 1322 Ctx context.Context 1323 In *PeerByIdRequest 1324 Opts []grpc.CallOption 1325 }{ 1326 Ctx: ctx, 1327 In: in, 1328 Opts: opts, 1329 } 1330 mock.lockPeerById.Lock() 1331 mock.calls.PeerById = append(mock.calls.PeerById, callInfo) 1332 mock.lockPeerById.Unlock() 1333 if mock.PeerByIdFunc == nil { 1334 var ( 1335 peerByIdReplyOut *PeerByIdReply 1336 errOut error 1337 ) 1338 return peerByIdReplyOut, errOut 1339 } 1340 return mock.PeerByIdFunc(ctx, in, opts...) 1341 } 1342 1343 // PeerByIdCalls gets all the calls that were made to PeerById. 1344 // Check the length with: 1345 // 1346 // len(mockedSentryClient.PeerByIdCalls()) 1347 func (mock *SentryClientMock) PeerByIdCalls() []struct { 1348 Ctx context.Context 1349 In *PeerByIdRequest 1350 Opts []grpc.CallOption 1351 } { 1352 var calls []struct { 1353 Ctx context.Context 1354 In *PeerByIdRequest 1355 Opts []grpc.CallOption 1356 } 1357 mock.lockPeerById.RLock() 1358 calls = mock.calls.PeerById 1359 mock.lockPeerById.RUnlock() 1360 return calls 1361 } 1362 1363 // PeerCount calls PeerCountFunc. 1364 func (mock *SentryClientMock) PeerCount(ctx context.Context, in *PeerCountRequest, opts ...grpc.CallOption) (*PeerCountReply, error) { 1365 callInfo := struct { 1366 Ctx context.Context 1367 In *PeerCountRequest 1368 Opts []grpc.CallOption 1369 }{ 1370 Ctx: ctx, 1371 In: in, 1372 Opts: opts, 1373 } 1374 mock.lockPeerCount.Lock() 1375 mock.calls.PeerCount = append(mock.calls.PeerCount, callInfo) 1376 mock.lockPeerCount.Unlock() 1377 if mock.PeerCountFunc == nil { 1378 var ( 1379 peerCountReplyOut *PeerCountReply 1380 errOut error 1381 ) 1382 return peerCountReplyOut, errOut 1383 } 1384 return mock.PeerCountFunc(ctx, in, opts...) 1385 } 1386 1387 // PeerCountCalls gets all the calls that were made to PeerCount. 1388 // Check the length with: 1389 // 1390 // len(mockedSentryClient.PeerCountCalls()) 1391 func (mock *SentryClientMock) PeerCountCalls() []struct { 1392 Ctx context.Context 1393 In *PeerCountRequest 1394 Opts []grpc.CallOption 1395 } { 1396 var calls []struct { 1397 Ctx context.Context 1398 In *PeerCountRequest 1399 Opts []grpc.CallOption 1400 } 1401 mock.lockPeerCount.RLock() 1402 calls = mock.calls.PeerCount 1403 mock.lockPeerCount.RUnlock() 1404 return calls 1405 } 1406 1407 // PeerEvents calls PeerEventsFunc. 1408 func (mock *SentryClientMock) PeerEvents(ctx context.Context, in *PeerEventsRequest, opts ...grpc.CallOption) (Sentry_PeerEventsClient, error) { 1409 callInfo := struct { 1410 Ctx context.Context 1411 In *PeerEventsRequest 1412 Opts []grpc.CallOption 1413 }{ 1414 Ctx: ctx, 1415 In: in, 1416 Opts: opts, 1417 } 1418 mock.lockPeerEvents.Lock() 1419 mock.calls.PeerEvents = append(mock.calls.PeerEvents, callInfo) 1420 mock.lockPeerEvents.Unlock() 1421 if mock.PeerEventsFunc == nil { 1422 var ( 1423 sentry_PeerEventsClientOut Sentry_PeerEventsClient 1424 errOut error 1425 ) 1426 return sentry_PeerEventsClientOut, errOut 1427 } 1428 return mock.PeerEventsFunc(ctx, in, opts...) 1429 } 1430 1431 // PeerEventsCalls gets all the calls that were made to PeerEvents. 1432 // Check the length with: 1433 // 1434 // len(mockedSentryClient.PeerEventsCalls()) 1435 func (mock *SentryClientMock) PeerEventsCalls() []struct { 1436 Ctx context.Context 1437 In *PeerEventsRequest 1438 Opts []grpc.CallOption 1439 } { 1440 var calls []struct { 1441 Ctx context.Context 1442 In *PeerEventsRequest 1443 Opts []grpc.CallOption 1444 } 1445 mock.lockPeerEvents.RLock() 1446 calls = mock.calls.PeerEvents 1447 mock.lockPeerEvents.RUnlock() 1448 return calls 1449 } 1450 1451 // PeerMinBlock calls PeerMinBlockFunc. 1452 func (mock *SentryClientMock) PeerMinBlock(ctx context.Context, in *PeerMinBlockRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { 1453 callInfo := struct { 1454 Ctx context.Context 1455 In *PeerMinBlockRequest 1456 Opts []grpc.CallOption 1457 }{ 1458 Ctx: ctx, 1459 In: in, 1460 Opts: opts, 1461 } 1462 mock.lockPeerMinBlock.Lock() 1463 mock.calls.PeerMinBlock = append(mock.calls.PeerMinBlock, callInfo) 1464 mock.lockPeerMinBlock.Unlock() 1465 if mock.PeerMinBlockFunc == nil { 1466 var ( 1467 emptyOut *emptypb.Empty 1468 errOut error 1469 ) 1470 return emptyOut, errOut 1471 } 1472 return mock.PeerMinBlockFunc(ctx, in, opts...) 1473 } 1474 1475 // PeerMinBlockCalls gets all the calls that were made to PeerMinBlock. 1476 // Check the length with: 1477 // 1478 // len(mockedSentryClient.PeerMinBlockCalls()) 1479 func (mock *SentryClientMock) PeerMinBlockCalls() []struct { 1480 Ctx context.Context 1481 In *PeerMinBlockRequest 1482 Opts []grpc.CallOption 1483 } { 1484 var calls []struct { 1485 Ctx context.Context 1486 In *PeerMinBlockRequest 1487 Opts []grpc.CallOption 1488 } 1489 mock.lockPeerMinBlock.RLock() 1490 calls = mock.calls.PeerMinBlock 1491 mock.lockPeerMinBlock.RUnlock() 1492 return calls 1493 } 1494 1495 // Peers calls PeersFunc. 1496 func (mock *SentryClientMock) Peers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PeersReply, error) { 1497 callInfo := struct { 1498 Ctx context.Context 1499 In *emptypb.Empty 1500 Opts []grpc.CallOption 1501 }{ 1502 Ctx: ctx, 1503 In: in, 1504 Opts: opts, 1505 } 1506 mock.lockPeers.Lock() 1507 mock.calls.Peers = append(mock.calls.Peers, callInfo) 1508 mock.lockPeers.Unlock() 1509 if mock.PeersFunc == nil { 1510 var ( 1511 peersReplyOut *PeersReply 1512 errOut error 1513 ) 1514 return peersReplyOut, errOut 1515 } 1516 return mock.PeersFunc(ctx, in, opts...) 1517 } 1518 1519 // PeersCalls gets all the calls that were made to Peers. 1520 // Check the length with: 1521 // 1522 // len(mockedSentryClient.PeersCalls()) 1523 func (mock *SentryClientMock) PeersCalls() []struct { 1524 Ctx context.Context 1525 In *emptypb.Empty 1526 Opts []grpc.CallOption 1527 } { 1528 var calls []struct { 1529 Ctx context.Context 1530 In *emptypb.Empty 1531 Opts []grpc.CallOption 1532 } 1533 mock.lockPeers.RLock() 1534 calls = mock.calls.Peers 1535 mock.lockPeers.RUnlock() 1536 return calls 1537 } 1538 1539 // PenalizePeer calls PenalizePeerFunc. 1540 func (mock *SentryClientMock) PenalizePeer(ctx context.Context, in *PenalizePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { 1541 callInfo := struct { 1542 Ctx context.Context 1543 In *PenalizePeerRequest 1544 Opts []grpc.CallOption 1545 }{ 1546 Ctx: ctx, 1547 In: in, 1548 Opts: opts, 1549 } 1550 mock.lockPenalizePeer.Lock() 1551 mock.calls.PenalizePeer = append(mock.calls.PenalizePeer, callInfo) 1552 mock.lockPenalizePeer.Unlock() 1553 if mock.PenalizePeerFunc == nil { 1554 var ( 1555 emptyOut *emptypb.Empty 1556 errOut error 1557 ) 1558 return emptyOut, errOut 1559 } 1560 return mock.PenalizePeerFunc(ctx, in, opts...) 1561 } 1562 1563 // PenalizePeerCalls gets all the calls that were made to PenalizePeer. 1564 // Check the length with: 1565 // 1566 // len(mockedSentryClient.PenalizePeerCalls()) 1567 func (mock *SentryClientMock) PenalizePeerCalls() []struct { 1568 Ctx context.Context 1569 In *PenalizePeerRequest 1570 Opts []grpc.CallOption 1571 } { 1572 var calls []struct { 1573 Ctx context.Context 1574 In *PenalizePeerRequest 1575 Opts []grpc.CallOption 1576 } 1577 mock.lockPenalizePeer.RLock() 1578 calls = mock.calls.PenalizePeer 1579 mock.lockPenalizePeer.RUnlock() 1580 return calls 1581 } 1582 1583 // SendMessageById calls SendMessageByIdFunc. 1584 func (mock *SentryClientMock) SendMessageById(ctx context.Context, in *SendMessageByIdRequest, opts ...grpc.CallOption) (*SentPeers, error) { 1585 callInfo := struct { 1586 Ctx context.Context 1587 In *SendMessageByIdRequest 1588 Opts []grpc.CallOption 1589 }{ 1590 Ctx: ctx, 1591 In: in, 1592 Opts: opts, 1593 } 1594 mock.lockSendMessageById.Lock() 1595 mock.calls.SendMessageById = append(mock.calls.SendMessageById, callInfo) 1596 mock.lockSendMessageById.Unlock() 1597 if mock.SendMessageByIdFunc == nil { 1598 var ( 1599 sentPeersOut *SentPeers 1600 errOut error 1601 ) 1602 return sentPeersOut, errOut 1603 } 1604 return mock.SendMessageByIdFunc(ctx, in, opts...) 1605 } 1606 1607 // SendMessageByIdCalls gets all the calls that were made to SendMessageById. 1608 // Check the length with: 1609 // 1610 // len(mockedSentryClient.SendMessageByIdCalls()) 1611 func (mock *SentryClientMock) SendMessageByIdCalls() []struct { 1612 Ctx context.Context 1613 In *SendMessageByIdRequest 1614 Opts []grpc.CallOption 1615 } { 1616 var calls []struct { 1617 Ctx context.Context 1618 In *SendMessageByIdRequest 1619 Opts []grpc.CallOption 1620 } 1621 mock.lockSendMessageById.RLock() 1622 calls = mock.calls.SendMessageById 1623 mock.lockSendMessageById.RUnlock() 1624 return calls 1625 } 1626 1627 // SendMessageByMinBlock calls SendMessageByMinBlockFunc. 1628 func (mock *SentryClientMock) SendMessageByMinBlock(ctx context.Context, in *SendMessageByMinBlockRequest, opts ...grpc.CallOption) (*SentPeers, error) { 1629 callInfo := struct { 1630 Ctx context.Context 1631 In *SendMessageByMinBlockRequest 1632 Opts []grpc.CallOption 1633 }{ 1634 Ctx: ctx, 1635 In: in, 1636 Opts: opts, 1637 } 1638 mock.lockSendMessageByMinBlock.Lock() 1639 mock.calls.SendMessageByMinBlock = append(mock.calls.SendMessageByMinBlock, callInfo) 1640 mock.lockSendMessageByMinBlock.Unlock() 1641 if mock.SendMessageByMinBlockFunc == nil { 1642 var ( 1643 sentPeersOut *SentPeers 1644 errOut error 1645 ) 1646 return sentPeersOut, errOut 1647 } 1648 return mock.SendMessageByMinBlockFunc(ctx, in, opts...) 1649 } 1650 1651 // SendMessageByMinBlockCalls gets all the calls that were made to SendMessageByMinBlock. 1652 // Check the length with: 1653 // 1654 // len(mockedSentryClient.SendMessageByMinBlockCalls()) 1655 func (mock *SentryClientMock) SendMessageByMinBlockCalls() []struct { 1656 Ctx context.Context 1657 In *SendMessageByMinBlockRequest 1658 Opts []grpc.CallOption 1659 } { 1660 var calls []struct { 1661 Ctx context.Context 1662 In *SendMessageByMinBlockRequest 1663 Opts []grpc.CallOption 1664 } 1665 mock.lockSendMessageByMinBlock.RLock() 1666 calls = mock.calls.SendMessageByMinBlock 1667 mock.lockSendMessageByMinBlock.RUnlock() 1668 return calls 1669 } 1670 1671 // SendMessageToAll calls SendMessageToAllFunc. 1672 func (mock *SentryClientMock) SendMessageToAll(ctx context.Context, in *OutboundMessageData, opts ...grpc.CallOption) (*SentPeers, error) { 1673 callInfo := struct { 1674 Ctx context.Context 1675 In *OutboundMessageData 1676 Opts []grpc.CallOption 1677 }{ 1678 Ctx: ctx, 1679 In: in, 1680 Opts: opts, 1681 } 1682 mock.lockSendMessageToAll.Lock() 1683 mock.calls.SendMessageToAll = append(mock.calls.SendMessageToAll, callInfo) 1684 mock.lockSendMessageToAll.Unlock() 1685 if mock.SendMessageToAllFunc == nil { 1686 var ( 1687 sentPeersOut *SentPeers 1688 errOut error 1689 ) 1690 return sentPeersOut, errOut 1691 } 1692 return mock.SendMessageToAllFunc(ctx, in, opts...) 1693 } 1694 1695 // SendMessageToAllCalls gets all the calls that were made to SendMessageToAll. 1696 // Check the length with: 1697 // 1698 // len(mockedSentryClient.SendMessageToAllCalls()) 1699 func (mock *SentryClientMock) SendMessageToAllCalls() []struct { 1700 Ctx context.Context 1701 In *OutboundMessageData 1702 Opts []grpc.CallOption 1703 } { 1704 var calls []struct { 1705 Ctx context.Context 1706 In *OutboundMessageData 1707 Opts []grpc.CallOption 1708 } 1709 mock.lockSendMessageToAll.RLock() 1710 calls = mock.calls.SendMessageToAll 1711 mock.lockSendMessageToAll.RUnlock() 1712 return calls 1713 } 1714 1715 // SendMessageToRandomPeers calls SendMessageToRandomPeersFunc. 1716 func (mock *SentryClientMock) SendMessageToRandomPeers(ctx context.Context, in *SendMessageToRandomPeersRequest, opts ...grpc.CallOption) (*SentPeers, error) { 1717 callInfo := struct { 1718 Ctx context.Context 1719 In *SendMessageToRandomPeersRequest 1720 Opts []grpc.CallOption 1721 }{ 1722 Ctx: ctx, 1723 In: in, 1724 Opts: opts, 1725 } 1726 mock.lockSendMessageToRandomPeers.Lock() 1727 mock.calls.SendMessageToRandomPeers = append(mock.calls.SendMessageToRandomPeers, callInfo) 1728 mock.lockSendMessageToRandomPeers.Unlock() 1729 if mock.SendMessageToRandomPeersFunc == nil { 1730 var ( 1731 sentPeersOut *SentPeers 1732 errOut error 1733 ) 1734 return sentPeersOut, errOut 1735 } 1736 return mock.SendMessageToRandomPeersFunc(ctx, in, opts...) 1737 } 1738 1739 // SendMessageToRandomPeersCalls gets all the calls that were made to SendMessageToRandomPeers. 1740 // Check the length with: 1741 // 1742 // len(mockedSentryClient.SendMessageToRandomPeersCalls()) 1743 func (mock *SentryClientMock) SendMessageToRandomPeersCalls() []struct { 1744 Ctx context.Context 1745 In *SendMessageToRandomPeersRequest 1746 Opts []grpc.CallOption 1747 } { 1748 var calls []struct { 1749 Ctx context.Context 1750 In *SendMessageToRandomPeersRequest 1751 Opts []grpc.CallOption 1752 } 1753 mock.lockSendMessageToRandomPeers.RLock() 1754 calls = mock.calls.SendMessageToRandomPeers 1755 mock.lockSendMessageToRandomPeers.RUnlock() 1756 return calls 1757 } 1758 1759 // SetStatus calls SetStatusFunc. 1760 func (mock *SentryClientMock) SetStatus(ctx context.Context, in *StatusData, opts ...grpc.CallOption) (*SetStatusReply, error) { 1761 callInfo := struct { 1762 Ctx context.Context 1763 In *StatusData 1764 Opts []grpc.CallOption 1765 }{ 1766 Ctx: ctx, 1767 In: in, 1768 Opts: opts, 1769 } 1770 mock.lockSetStatus.Lock() 1771 mock.calls.SetStatus = append(mock.calls.SetStatus, callInfo) 1772 mock.lockSetStatus.Unlock() 1773 if mock.SetStatusFunc == nil { 1774 var ( 1775 setStatusReplyOut *SetStatusReply 1776 errOut error 1777 ) 1778 return setStatusReplyOut, errOut 1779 } 1780 return mock.SetStatusFunc(ctx, in, opts...) 1781 } 1782 1783 // SetStatusCalls gets all the calls that were made to SetStatus. 1784 // Check the length with: 1785 // 1786 // len(mockedSentryClient.SetStatusCalls()) 1787 func (mock *SentryClientMock) SetStatusCalls() []struct { 1788 Ctx context.Context 1789 In *StatusData 1790 Opts []grpc.CallOption 1791 } { 1792 var calls []struct { 1793 Ctx context.Context 1794 In *StatusData 1795 Opts []grpc.CallOption 1796 } 1797 mock.lockSetStatus.RLock() 1798 calls = mock.calls.SetStatus 1799 mock.lockSetStatus.RUnlock() 1800 return calls 1801 }