erigon-pulse/gointerfaces/sentry/mocks.go
Dmitry Savelev da3c239ed6
Add nodeInfo GRPC methods (#196)
* Add nodeInfo

* Remove interfaces for replacement

Signed-off-by: Dmitry Savelev <darksawa@gmail.com>

* Squashed 'interfaces/' content from commit 67abfdd

git-subtree-dir: interfaces
git-subtree-split: 67abfdd23b3bbef0d2f0c038275b6f47820d7f5e
2021-11-30 14:41:31 +00:00

1435 lines
47 KiB
Go

// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq
package sentry
import (
context "context"
types "github.com/ledgerwatch/erigon-lib/gointerfaces/types"
grpc "google.golang.org/grpc"
emptypb "google.golang.org/protobuf/types/known/emptypb"
sync "sync"
)
// Ensure, that SentryServerMock does implement SentryServer.
// If this is not the case, regenerate this file with moq.
var _ SentryServer = &SentryServerMock{}
// SentryServerMock is a mock implementation of SentryServer.
//
// func TestSomethingThatUsesSentryServer(t *testing.T) {
//
// // make and configure a mocked SentryServer
// mockedSentryServer := &SentryServerMock{
// HandShakeFunc: func(contextMoqParam context.Context, empty *emptypb.Empty) (*HandShakeReply, error) {
// panic("mock out the HandShake method")
// },
// MessagesFunc: func(messagesRequest *MessagesRequest, sentry_MessagesServer Sentry_MessagesServer) error {
// panic("mock out the Messages method")
// },
// NodeInfoFunc: func(contextMoqParam context.Context, empty *emptypb.Empty) (*types.NodeInfoReply, error) {
// panic("mock out the NodeInfo method")
// },
// PeerCountFunc: func(contextMoqParam context.Context, peerCountRequest *PeerCountRequest) (*PeerCountReply, error) {
// panic("mock out the PeerCount method")
// },
// PeerMinBlockFunc: func(contextMoqParam context.Context, peerMinBlockRequest *PeerMinBlockRequest) (*emptypb.Empty, error) {
// panic("mock out the PeerMinBlock method")
// },
// PeersFunc: func(peersRequest *PeersRequest, sentry_PeersServer Sentry_PeersServer) error {
// panic("mock out the Peers method")
// },
// PenalizePeerFunc: func(contextMoqParam context.Context, penalizePeerRequest *PenalizePeerRequest) (*emptypb.Empty, error) {
// panic("mock out the PenalizePeer method")
// },
// SendMessageByIdFunc: func(contextMoqParam context.Context, sendMessageByIdRequest *SendMessageByIdRequest) (*SentPeers, error) {
// panic("mock out the SendMessageById method")
// },
// SendMessageByMinBlockFunc: func(contextMoqParam context.Context, sendMessageByMinBlockRequest *SendMessageByMinBlockRequest) (*SentPeers, error) {
// panic("mock out the SendMessageByMinBlock method")
// },
// SendMessageToAllFunc: func(contextMoqParam context.Context, outboundMessageData *OutboundMessageData) (*SentPeers, error) {
// panic("mock out the SendMessageToAll method")
// },
// SendMessageToRandomPeersFunc: func(contextMoqParam context.Context, sendMessageToRandomPeersRequest *SendMessageToRandomPeersRequest) (*SentPeers, error) {
// panic("mock out the SendMessageToRandomPeers method")
// },
// SetStatusFunc: func(contextMoqParam context.Context, statusData *StatusData) (*SetStatusReply, error) {
// panic("mock out the SetStatus method")
// },
// mustEmbedUnimplementedSentryServerFunc: func() {
// panic("mock out the mustEmbedUnimplementedSentryServer method")
// },
// }
//
// // use mockedSentryServer in code that requires SentryServer
// // and then make assertions.
//
// }
type SentryServerMock struct {
// HandShakeFunc mocks the HandShake method.
HandShakeFunc func(contextMoqParam context.Context, empty *emptypb.Empty) (*HandShakeReply, error)
// MessagesFunc mocks the Messages method.
MessagesFunc func(messagesRequest *MessagesRequest, sentry_MessagesServer Sentry_MessagesServer) error
// NodeInfoFunc mocks the NodeInfo method.
NodeInfoFunc func(contextMoqParam context.Context, empty *emptypb.Empty) (*types.NodeInfoReply, error)
// PeerCountFunc mocks the PeerCount method.
PeerCountFunc func(contextMoqParam context.Context, peerCountRequest *PeerCountRequest) (*PeerCountReply, error)
// PeerMinBlockFunc mocks the PeerMinBlock method.
PeerMinBlockFunc func(contextMoqParam context.Context, peerMinBlockRequest *PeerMinBlockRequest) (*emptypb.Empty, error)
// PeersFunc mocks the Peers method.
PeersFunc func(peersRequest *PeersRequest, sentry_PeersServer Sentry_PeersServer) error
// PenalizePeerFunc mocks the PenalizePeer method.
PenalizePeerFunc func(contextMoqParam context.Context, penalizePeerRequest *PenalizePeerRequest) (*emptypb.Empty, error)
// SendMessageByIdFunc mocks the SendMessageById method.
SendMessageByIdFunc func(contextMoqParam context.Context, sendMessageByIdRequest *SendMessageByIdRequest) (*SentPeers, error)
// SendMessageByMinBlockFunc mocks the SendMessageByMinBlock method.
SendMessageByMinBlockFunc func(contextMoqParam context.Context, sendMessageByMinBlockRequest *SendMessageByMinBlockRequest) (*SentPeers, error)
// SendMessageToAllFunc mocks the SendMessageToAll method.
SendMessageToAllFunc func(contextMoqParam context.Context, outboundMessageData *OutboundMessageData) (*SentPeers, error)
// SendMessageToRandomPeersFunc mocks the SendMessageToRandomPeers method.
SendMessageToRandomPeersFunc func(contextMoqParam context.Context, sendMessageToRandomPeersRequest *SendMessageToRandomPeersRequest) (*SentPeers, error)
// SetStatusFunc mocks the SetStatus method.
SetStatusFunc func(contextMoqParam context.Context, statusData *StatusData) (*SetStatusReply, error)
// mustEmbedUnimplementedSentryServerFunc mocks the mustEmbedUnimplementedSentryServer method.
mustEmbedUnimplementedSentryServerFunc func()
// calls tracks calls to the methods.
calls struct {
// HandShake holds details about calls to the HandShake method.
HandShake []struct {
// ContextMoqParam is the contextMoqParam argument value.
ContextMoqParam context.Context
// Empty is the empty argument value.
Empty *emptypb.Empty
}
// Messages holds details about calls to the Messages method.
Messages []struct {
// MessagesRequest is the messagesRequest argument value.
MessagesRequest *MessagesRequest
// Sentry_MessagesServer is the sentry_MessagesServer argument value.
Sentry_MessagesServer Sentry_MessagesServer
}
// NodeInfo holds details about calls to the NodeInfo method.
NodeInfo []struct {
// ContextMoqParam is the contextMoqParam argument value.
ContextMoqParam context.Context
// Empty is the empty argument value.
Empty *emptypb.Empty
}
// PeerCount holds details about calls to the PeerCount method.
PeerCount []struct {
// ContextMoqParam is the contextMoqParam argument value.
ContextMoqParam context.Context
// PeerCountRequest is the peerCountRequest argument value.
PeerCountRequest *PeerCountRequest
}
// PeerMinBlock holds details about calls to the PeerMinBlock method.
PeerMinBlock []struct {
// ContextMoqParam is the contextMoqParam argument value.
ContextMoqParam context.Context
// PeerMinBlockRequest is the peerMinBlockRequest argument value.
PeerMinBlockRequest *PeerMinBlockRequest
}
// Peers holds details about calls to the Peers method.
Peers []struct {
// PeersRequest is the peersRequest argument value.
PeersRequest *PeersRequest
// Sentry_PeersServer is the sentry_PeersServer argument value.
Sentry_PeersServer Sentry_PeersServer
}
// PenalizePeer holds details about calls to the PenalizePeer method.
PenalizePeer []struct {
// ContextMoqParam is the contextMoqParam argument value.
ContextMoqParam context.Context
// PenalizePeerRequest is the penalizePeerRequest argument value.
PenalizePeerRequest *PenalizePeerRequest
}
// SendMessageById holds details about calls to the SendMessageById method.
SendMessageById []struct {
// ContextMoqParam is the contextMoqParam argument value.
ContextMoqParam context.Context
// SendMessageByIdRequest is the sendMessageByIdRequest argument value.
SendMessageByIdRequest *SendMessageByIdRequest
}
// SendMessageByMinBlock holds details about calls to the SendMessageByMinBlock method.
SendMessageByMinBlock []struct {
// ContextMoqParam is the contextMoqParam argument value.
ContextMoqParam context.Context
// SendMessageByMinBlockRequest is the sendMessageByMinBlockRequest argument value.
SendMessageByMinBlockRequest *SendMessageByMinBlockRequest
}
// SendMessageToAll holds details about calls to the SendMessageToAll method.
SendMessageToAll []struct {
// ContextMoqParam is the contextMoqParam argument value.
ContextMoqParam context.Context
// OutboundMessageData is the outboundMessageData argument value.
OutboundMessageData *OutboundMessageData
}
// SendMessageToRandomPeers holds details about calls to the SendMessageToRandomPeers method.
SendMessageToRandomPeers []struct {
// ContextMoqParam is the contextMoqParam argument value.
ContextMoqParam context.Context
// SendMessageToRandomPeersRequest is the sendMessageToRandomPeersRequest argument value.
SendMessageToRandomPeersRequest *SendMessageToRandomPeersRequest
}
// SetStatus holds details about calls to the SetStatus method.
SetStatus []struct {
// ContextMoqParam is the contextMoqParam argument value.
ContextMoqParam context.Context
// StatusData is the statusData argument value.
StatusData *StatusData
}
// mustEmbedUnimplementedSentryServer holds details about calls to the mustEmbedUnimplementedSentryServer method.
mustEmbedUnimplementedSentryServer []struct {
}
}
lockHandShake sync.RWMutex
lockMessages sync.RWMutex
lockNodeInfo sync.RWMutex
lockPeerCount sync.RWMutex
lockPeerMinBlock sync.RWMutex
lockPeers sync.RWMutex
lockPenalizePeer sync.RWMutex
lockSendMessageById sync.RWMutex
lockSendMessageByMinBlock sync.RWMutex
lockSendMessageToAll sync.RWMutex
lockSendMessageToRandomPeers sync.RWMutex
lockSetStatus sync.RWMutex
lockmustEmbedUnimplementedSentryServer sync.RWMutex
}
// HandShake calls HandShakeFunc.
func (mock *SentryServerMock) HandShake(contextMoqParam context.Context, empty *emptypb.Empty) (*HandShakeReply, error) {
callInfo := struct {
ContextMoqParam context.Context
Empty *emptypb.Empty
}{
ContextMoqParam: contextMoqParam,
Empty: empty,
}
mock.lockHandShake.Lock()
mock.calls.HandShake = append(mock.calls.HandShake, callInfo)
mock.lockHandShake.Unlock()
if mock.HandShakeFunc == nil {
var (
handShakeReplyOut *HandShakeReply
errOut error
)
return handShakeReplyOut, errOut
}
return mock.HandShakeFunc(contextMoqParam, empty)
}
// HandShakeCalls gets all the calls that were made to HandShake.
// Check the length with:
// len(mockedSentryServer.HandShakeCalls())
func (mock *SentryServerMock) HandShakeCalls() []struct {
ContextMoqParam context.Context
Empty *emptypb.Empty
} {
var calls []struct {
ContextMoqParam context.Context
Empty *emptypb.Empty
}
mock.lockHandShake.RLock()
calls = mock.calls.HandShake
mock.lockHandShake.RUnlock()
return calls
}
// Messages calls MessagesFunc.
func (mock *SentryServerMock) Messages(messagesRequest *MessagesRequest, sentry_MessagesServer Sentry_MessagesServer) error {
callInfo := struct {
MessagesRequest *MessagesRequest
Sentry_MessagesServer Sentry_MessagesServer
}{
MessagesRequest: messagesRequest,
Sentry_MessagesServer: sentry_MessagesServer,
}
mock.lockMessages.Lock()
mock.calls.Messages = append(mock.calls.Messages, callInfo)
mock.lockMessages.Unlock()
if mock.MessagesFunc == nil {
var (
errOut error
)
return errOut
}
return mock.MessagesFunc(messagesRequest, sentry_MessagesServer)
}
// MessagesCalls gets all the calls that were made to Messages.
// Check the length with:
// len(mockedSentryServer.MessagesCalls())
func (mock *SentryServerMock) MessagesCalls() []struct {
MessagesRequest *MessagesRequest
Sentry_MessagesServer Sentry_MessagesServer
} {
var calls []struct {
MessagesRequest *MessagesRequest
Sentry_MessagesServer Sentry_MessagesServer
}
mock.lockMessages.RLock()
calls = mock.calls.Messages
mock.lockMessages.RUnlock()
return calls
}
// NodeInfo calls NodeInfoFunc.
func (mock *SentryServerMock) NodeInfo(contextMoqParam context.Context, empty *emptypb.Empty) (*types.NodeInfoReply, error) {
callInfo := struct {
ContextMoqParam context.Context
Empty *emptypb.Empty
}{
ContextMoqParam: contextMoqParam,
Empty: empty,
}
mock.lockNodeInfo.Lock()
mock.calls.NodeInfo = append(mock.calls.NodeInfo, callInfo)
mock.lockNodeInfo.Unlock()
if mock.NodeInfoFunc == nil {
var (
nodeInfoReplyOut *types.NodeInfoReply
errOut error
)
return nodeInfoReplyOut, errOut
}
return mock.NodeInfoFunc(contextMoqParam, empty)
}
// NodeInfoCalls gets all the calls that were made to NodeInfo.
// Check the length with:
// len(mockedSentryServer.NodeInfoCalls())
func (mock *SentryServerMock) NodeInfoCalls() []struct {
ContextMoqParam context.Context
Empty *emptypb.Empty
} {
var calls []struct {
ContextMoqParam context.Context
Empty *emptypb.Empty
}
mock.lockNodeInfo.RLock()
calls = mock.calls.NodeInfo
mock.lockNodeInfo.RUnlock()
return calls
}
// PeerCount calls PeerCountFunc.
func (mock *SentryServerMock) PeerCount(contextMoqParam context.Context, peerCountRequest *PeerCountRequest) (*PeerCountReply, error) {
callInfo := struct {
ContextMoqParam context.Context
PeerCountRequest *PeerCountRequest
}{
ContextMoqParam: contextMoqParam,
PeerCountRequest: peerCountRequest,
}
mock.lockPeerCount.Lock()
mock.calls.PeerCount = append(mock.calls.PeerCount, callInfo)
mock.lockPeerCount.Unlock()
if mock.PeerCountFunc == nil {
var (
peerCountReplyOut *PeerCountReply
errOut error
)
return peerCountReplyOut, errOut
}
return mock.PeerCountFunc(contextMoqParam, peerCountRequest)
}
// PeerCountCalls gets all the calls that were made to PeerCount.
// Check the length with:
// len(mockedSentryServer.PeerCountCalls())
func (mock *SentryServerMock) PeerCountCalls() []struct {
ContextMoqParam context.Context
PeerCountRequest *PeerCountRequest
} {
var calls []struct {
ContextMoqParam context.Context
PeerCountRequest *PeerCountRequest
}
mock.lockPeerCount.RLock()
calls = mock.calls.PeerCount
mock.lockPeerCount.RUnlock()
return calls
}
// PeerMinBlock calls PeerMinBlockFunc.
func (mock *SentryServerMock) PeerMinBlock(contextMoqParam context.Context, peerMinBlockRequest *PeerMinBlockRequest) (*emptypb.Empty, error) {
callInfo := struct {
ContextMoqParam context.Context
PeerMinBlockRequest *PeerMinBlockRequest
}{
ContextMoqParam: contextMoqParam,
PeerMinBlockRequest: peerMinBlockRequest,
}
mock.lockPeerMinBlock.Lock()
mock.calls.PeerMinBlock = append(mock.calls.PeerMinBlock, callInfo)
mock.lockPeerMinBlock.Unlock()
if mock.PeerMinBlockFunc == nil {
var (
emptyOut *emptypb.Empty
errOut error
)
return emptyOut, errOut
}
return mock.PeerMinBlockFunc(contextMoqParam, peerMinBlockRequest)
}
// PeerMinBlockCalls gets all the calls that were made to PeerMinBlock.
// Check the length with:
// len(mockedSentryServer.PeerMinBlockCalls())
func (mock *SentryServerMock) PeerMinBlockCalls() []struct {
ContextMoqParam context.Context
PeerMinBlockRequest *PeerMinBlockRequest
} {
var calls []struct {
ContextMoqParam context.Context
PeerMinBlockRequest *PeerMinBlockRequest
}
mock.lockPeerMinBlock.RLock()
calls = mock.calls.PeerMinBlock
mock.lockPeerMinBlock.RUnlock()
return calls
}
// Peers calls PeersFunc.
func (mock *SentryServerMock) Peers(peersRequest *PeersRequest, sentry_PeersServer Sentry_PeersServer) error {
callInfo := struct {
PeersRequest *PeersRequest
Sentry_PeersServer Sentry_PeersServer
}{
PeersRequest: peersRequest,
Sentry_PeersServer: sentry_PeersServer,
}
mock.lockPeers.Lock()
mock.calls.Peers = append(mock.calls.Peers, callInfo)
mock.lockPeers.Unlock()
if mock.PeersFunc == nil {
var (
errOut error
)
return errOut
}
return mock.PeersFunc(peersRequest, sentry_PeersServer)
}
// PeersCalls gets all the calls that were made to Peers.
// Check the length with:
// len(mockedSentryServer.PeersCalls())
func (mock *SentryServerMock) PeersCalls() []struct {
PeersRequest *PeersRequest
Sentry_PeersServer Sentry_PeersServer
} {
var calls []struct {
PeersRequest *PeersRequest
Sentry_PeersServer Sentry_PeersServer
}
mock.lockPeers.RLock()
calls = mock.calls.Peers
mock.lockPeers.RUnlock()
return calls
}
// PenalizePeer calls PenalizePeerFunc.
func (mock *SentryServerMock) PenalizePeer(contextMoqParam context.Context, penalizePeerRequest *PenalizePeerRequest) (*emptypb.Empty, error) {
callInfo := struct {
ContextMoqParam context.Context
PenalizePeerRequest *PenalizePeerRequest
}{
ContextMoqParam: contextMoqParam,
PenalizePeerRequest: penalizePeerRequest,
}
mock.lockPenalizePeer.Lock()
mock.calls.PenalizePeer = append(mock.calls.PenalizePeer, callInfo)
mock.lockPenalizePeer.Unlock()
if mock.PenalizePeerFunc == nil {
var (
emptyOut *emptypb.Empty
errOut error
)
return emptyOut, errOut
}
return mock.PenalizePeerFunc(contextMoqParam, penalizePeerRequest)
}
// PenalizePeerCalls gets all the calls that were made to PenalizePeer.
// Check the length with:
// len(mockedSentryServer.PenalizePeerCalls())
func (mock *SentryServerMock) PenalizePeerCalls() []struct {
ContextMoqParam context.Context
PenalizePeerRequest *PenalizePeerRequest
} {
var calls []struct {
ContextMoqParam context.Context
PenalizePeerRequest *PenalizePeerRequest
}
mock.lockPenalizePeer.RLock()
calls = mock.calls.PenalizePeer
mock.lockPenalizePeer.RUnlock()
return calls
}
// SendMessageById calls SendMessageByIdFunc.
func (mock *SentryServerMock) SendMessageById(contextMoqParam context.Context, sendMessageByIdRequest *SendMessageByIdRequest) (*SentPeers, error) {
callInfo := struct {
ContextMoqParam context.Context
SendMessageByIdRequest *SendMessageByIdRequest
}{
ContextMoqParam: contextMoqParam,
SendMessageByIdRequest: sendMessageByIdRequest,
}
mock.lockSendMessageById.Lock()
mock.calls.SendMessageById = append(mock.calls.SendMessageById, callInfo)
mock.lockSendMessageById.Unlock()
if mock.SendMessageByIdFunc == nil {
var (
sentPeersOut *SentPeers
errOut error
)
return sentPeersOut, errOut
}
return mock.SendMessageByIdFunc(contextMoqParam, sendMessageByIdRequest)
}
// SendMessageByIdCalls gets all the calls that were made to SendMessageById.
// Check the length with:
// len(mockedSentryServer.SendMessageByIdCalls())
func (mock *SentryServerMock) SendMessageByIdCalls() []struct {
ContextMoqParam context.Context
SendMessageByIdRequest *SendMessageByIdRequest
} {
var calls []struct {
ContextMoqParam context.Context
SendMessageByIdRequest *SendMessageByIdRequest
}
mock.lockSendMessageById.RLock()
calls = mock.calls.SendMessageById
mock.lockSendMessageById.RUnlock()
return calls
}
// SendMessageByMinBlock calls SendMessageByMinBlockFunc.
func (mock *SentryServerMock) SendMessageByMinBlock(contextMoqParam context.Context, sendMessageByMinBlockRequest *SendMessageByMinBlockRequest) (*SentPeers, error) {
callInfo := struct {
ContextMoqParam context.Context
SendMessageByMinBlockRequest *SendMessageByMinBlockRequest
}{
ContextMoqParam: contextMoqParam,
SendMessageByMinBlockRequest: sendMessageByMinBlockRequest,
}
mock.lockSendMessageByMinBlock.Lock()
mock.calls.SendMessageByMinBlock = append(mock.calls.SendMessageByMinBlock, callInfo)
mock.lockSendMessageByMinBlock.Unlock()
if mock.SendMessageByMinBlockFunc == nil {
var (
sentPeersOut *SentPeers
errOut error
)
return sentPeersOut, errOut
}
return mock.SendMessageByMinBlockFunc(contextMoqParam, sendMessageByMinBlockRequest)
}
// SendMessageByMinBlockCalls gets all the calls that were made to SendMessageByMinBlock.
// Check the length with:
// len(mockedSentryServer.SendMessageByMinBlockCalls())
func (mock *SentryServerMock) SendMessageByMinBlockCalls() []struct {
ContextMoqParam context.Context
SendMessageByMinBlockRequest *SendMessageByMinBlockRequest
} {
var calls []struct {
ContextMoqParam context.Context
SendMessageByMinBlockRequest *SendMessageByMinBlockRequest
}
mock.lockSendMessageByMinBlock.RLock()
calls = mock.calls.SendMessageByMinBlock
mock.lockSendMessageByMinBlock.RUnlock()
return calls
}
// SendMessageToAll calls SendMessageToAllFunc.
func (mock *SentryServerMock) SendMessageToAll(contextMoqParam context.Context, outboundMessageData *OutboundMessageData) (*SentPeers, error) {
callInfo := struct {
ContextMoqParam context.Context
OutboundMessageData *OutboundMessageData
}{
ContextMoqParam: contextMoqParam,
OutboundMessageData: outboundMessageData,
}
mock.lockSendMessageToAll.Lock()
mock.calls.SendMessageToAll = append(mock.calls.SendMessageToAll, callInfo)
mock.lockSendMessageToAll.Unlock()
if mock.SendMessageToAllFunc == nil {
var (
sentPeersOut *SentPeers
errOut error
)
return sentPeersOut, errOut
}
return mock.SendMessageToAllFunc(contextMoqParam, outboundMessageData)
}
// SendMessageToAllCalls gets all the calls that were made to SendMessageToAll.
// Check the length with:
// len(mockedSentryServer.SendMessageToAllCalls())
func (mock *SentryServerMock) SendMessageToAllCalls() []struct {
ContextMoqParam context.Context
OutboundMessageData *OutboundMessageData
} {
var calls []struct {
ContextMoqParam context.Context
OutboundMessageData *OutboundMessageData
}
mock.lockSendMessageToAll.RLock()
calls = mock.calls.SendMessageToAll
mock.lockSendMessageToAll.RUnlock()
return calls
}
// SendMessageToRandomPeers calls SendMessageToRandomPeersFunc.
func (mock *SentryServerMock) SendMessageToRandomPeers(contextMoqParam context.Context, sendMessageToRandomPeersRequest *SendMessageToRandomPeersRequest) (*SentPeers, error) {
callInfo := struct {
ContextMoqParam context.Context
SendMessageToRandomPeersRequest *SendMessageToRandomPeersRequest
}{
ContextMoqParam: contextMoqParam,
SendMessageToRandomPeersRequest: sendMessageToRandomPeersRequest,
}
mock.lockSendMessageToRandomPeers.Lock()
mock.calls.SendMessageToRandomPeers = append(mock.calls.SendMessageToRandomPeers, callInfo)
mock.lockSendMessageToRandomPeers.Unlock()
if mock.SendMessageToRandomPeersFunc == nil {
var (
sentPeersOut *SentPeers
errOut error
)
return sentPeersOut, errOut
}
return mock.SendMessageToRandomPeersFunc(contextMoqParam, sendMessageToRandomPeersRequest)
}
// SendMessageToRandomPeersCalls gets all the calls that were made to SendMessageToRandomPeers.
// Check the length with:
// len(mockedSentryServer.SendMessageToRandomPeersCalls())
func (mock *SentryServerMock) SendMessageToRandomPeersCalls() []struct {
ContextMoqParam context.Context
SendMessageToRandomPeersRequest *SendMessageToRandomPeersRequest
} {
var calls []struct {
ContextMoqParam context.Context
SendMessageToRandomPeersRequest *SendMessageToRandomPeersRequest
}
mock.lockSendMessageToRandomPeers.RLock()
calls = mock.calls.SendMessageToRandomPeers
mock.lockSendMessageToRandomPeers.RUnlock()
return calls
}
// SetStatus calls SetStatusFunc.
func (mock *SentryServerMock) SetStatus(contextMoqParam context.Context, statusData *StatusData) (*SetStatusReply, error) {
callInfo := struct {
ContextMoqParam context.Context
StatusData *StatusData
}{
ContextMoqParam: contextMoqParam,
StatusData: statusData,
}
mock.lockSetStatus.Lock()
mock.calls.SetStatus = append(mock.calls.SetStatus, callInfo)
mock.lockSetStatus.Unlock()
if mock.SetStatusFunc == nil {
var (
setStatusReplyOut *SetStatusReply
errOut error
)
return setStatusReplyOut, errOut
}
return mock.SetStatusFunc(contextMoqParam, statusData)
}
// SetStatusCalls gets all the calls that were made to SetStatus.
// Check the length with:
// len(mockedSentryServer.SetStatusCalls())
func (mock *SentryServerMock) SetStatusCalls() []struct {
ContextMoqParam context.Context
StatusData *StatusData
} {
var calls []struct {
ContextMoqParam context.Context
StatusData *StatusData
}
mock.lockSetStatus.RLock()
calls = mock.calls.SetStatus
mock.lockSetStatus.RUnlock()
return calls
}
// mustEmbedUnimplementedSentryServer calls mustEmbedUnimplementedSentryServerFunc.
func (mock *SentryServerMock) mustEmbedUnimplementedSentryServer() {
callInfo := struct {
}{}
mock.lockmustEmbedUnimplementedSentryServer.Lock()
mock.calls.mustEmbedUnimplementedSentryServer = append(mock.calls.mustEmbedUnimplementedSentryServer, callInfo)
mock.lockmustEmbedUnimplementedSentryServer.Unlock()
if mock.mustEmbedUnimplementedSentryServerFunc == nil {
return
}
mock.mustEmbedUnimplementedSentryServerFunc()
}
// mustEmbedUnimplementedSentryServerCalls gets all the calls that were made to mustEmbedUnimplementedSentryServer.
// Check the length with:
// len(mockedSentryServer.mustEmbedUnimplementedSentryServerCalls())
func (mock *SentryServerMock) mustEmbedUnimplementedSentryServerCalls() []struct {
} {
var calls []struct {
}
mock.lockmustEmbedUnimplementedSentryServer.RLock()
calls = mock.calls.mustEmbedUnimplementedSentryServer
mock.lockmustEmbedUnimplementedSentryServer.RUnlock()
return calls
}
// Ensure, that SentryClientMock does implement SentryClient.
// If this is not the case, regenerate this file with moq.
var _ SentryClient = &SentryClientMock{}
// SentryClientMock is a mock implementation of SentryClient.
//
// func TestSomethingThatUsesSentryClient(t *testing.T) {
//
// // make and configure a mocked SentryClient
// mockedSentryClient := &SentryClientMock{
// HandShakeFunc: func(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HandShakeReply, error) {
// panic("mock out the HandShake method")
// },
// MessagesFunc: func(ctx context.Context, in *MessagesRequest, opts ...grpc.CallOption) (Sentry_MessagesClient, error) {
// panic("mock out the Messages method")
// },
// NodeInfoFunc: func(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.NodeInfoReply, error) {
// panic("mock out the NodeInfo method")
// },
// PeerCountFunc: func(ctx context.Context, in *PeerCountRequest, opts ...grpc.CallOption) (*PeerCountReply, error) {
// panic("mock out the PeerCount method")
// },
// PeerMinBlockFunc: func(ctx context.Context, in *PeerMinBlockRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
// panic("mock out the PeerMinBlock method")
// },
// PeersFunc: func(ctx context.Context, in *PeersRequest, opts ...grpc.CallOption) (Sentry_PeersClient, error) {
// panic("mock out the Peers method")
// },
// PenalizePeerFunc: func(ctx context.Context, in *PenalizePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
// panic("mock out the PenalizePeer method")
// },
// SendMessageByIdFunc: func(ctx context.Context, in *SendMessageByIdRequest, opts ...grpc.CallOption) (*SentPeers, error) {
// panic("mock out the SendMessageById method")
// },
// SendMessageByMinBlockFunc: func(ctx context.Context, in *SendMessageByMinBlockRequest, opts ...grpc.CallOption) (*SentPeers, error) {
// panic("mock out the SendMessageByMinBlock method")
// },
// SendMessageToAllFunc: func(ctx context.Context, in *OutboundMessageData, opts ...grpc.CallOption) (*SentPeers, error) {
// panic("mock out the SendMessageToAll method")
// },
// SendMessageToRandomPeersFunc: func(ctx context.Context, in *SendMessageToRandomPeersRequest, opts ...grpc.CallOption) (*SentPeers, error) {
// panic("mock out the SendMessageToRandomPeers method")
// },
// SetStatusFunc: func(ctx context.Context, in *StatusData, opts ...grpc.CallOption) (*SetStatusReply, error) {
// panic("mock out the SetStatus method")
// },
// }
//
// // use mockedSentryClient in code that requires SentryClient
// // and then make assertions.
//
// }
type SentryClientMock struct {
// HandShakeFunc mocks the HandShake method.
HandShakeFunc func(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HandShakeReply, error)
// MessagesFunc mocks the Messages method.
MessagesFunc func(ctx context.Context, in *MessagesRequest, opts ...grpc.CallOption) (Sentry_MessagesClient, error)
// NodeInfoFunc mocks the NodeInfo method.
NodeInfoFunc func(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.NodeInfoReply, error)
// PeerCountFunc mocks the PeerCount method.
PeerCountFunc func(ctx context.Context, in *PeerCountRequest, opts ...grpc.CallOption) (*PeerCountReply, error)
// PeerMinBlockFunc mocks the PeerMinBlock method.
PeerMinBlockFunc func(ctx context.Context, in *PeerMinBlockRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// PeersFunc mocks the Peers method.
PeersFunc func(ctx context.Context, in *PeersRequest, opts ...grpc.CallOption) (Sentry_PeersClient, error)
// PenalizePeerFunc mocks the PenalizePeer method.
PenalizePeerFunc func(ctx context.Context, in *PenalizePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// SendMessageByIdFunc mocks the SendMessageById method.
SendMessageByIdFunc func(ctx context.Context, in *SendMessageByIdRequest, opts ...grpc.CallOption) (*SentPeers, error)
// SendMessageByMinBlockFunc mocks the SendMessageByMinBlock method.
SendMessageByMinBlockFunc func(ctx context.Context, in *SendMessageByMinBlockRequest, opts ...grpc.CallOption) (*SentPeers, error)
// SendMessageToAllFunc mocks the SendMessageToAll method.
SendMessageToAllFunc func(ctx context.Context, in *OutboundMessageData, opts ...grpc.CallOption) (*SentPeers, error)
// SendMessageToRandomPeersFunc mocks the SendMessageToRandomPeers method.
SendMessageToRandomPeersFunc func(ctx context.Context, in *SendMessageToRandomPeersRequest, opts ...grpc.CallOption) (*SentPeers, error)
// SetStatusFunc mocks the SetStatus method.
SetStatusFunc func(ctx context.Context, in *StatusData, opts ...grpc.CallOption) (*SetStatusReply, error)
// calls tracks calls to the methods.
calls struct {
// HandShake holds details about calls to the HandShake method.
HandShake []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// In is the in argument value.
In *emptypb.Empty
// Opts is the opts argument value.
Opts []grpc.CallOption
}
// Messages holds details about calls to the Messages method.
Messages []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// In is the in argument value.
In *MessagesRequest
// Opts is the opts argument value.
Opts []grpc.CallOption
}
// NodeInfo holds details about calls to the NodeInfo method.
NodeInfo []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// In is the in argument value.
In *emptypb.Empty
// Opts is the opts argument value.
Opts []grpc.CallOption
}
// PeerCount holds details about calls to the PeerCount method.
PeerCount []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// In is the in argument value.
In *PeerCountRequest
// Opts is the opts argument value.
Opts []grpc.CallOption
}
// PeerMinBlock holds details about calls to the PeerMinBlock method.
PeerMinBlock []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// In is the in argument value.
In *PeerMinBlockRequest
// Opts is the opts argument value.
Opts []grpc.CallOption
}
// Peers holds details about calls to the Peers method.
Peers []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// In is the in argument value.
In *PeersRequest
// Opts is the opts argument value.
Opts []grpc.CallOption
}
// PenalizePeer holds details about calls to the PenalizePeer method.
PenalizePeer []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// In is the in argument value.
In *PenalizePeerRequest
// Opts is the opts argument value.
Opts []grpc.CallOption
}
// SendMessageById holds details about calls to the SendMessageById method.
SendMessageById []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// In is the in argument value.
In *SendMessageByIdRequest
// Opts is the opts argument value.
Opts []grpc.CallOption
}
// SendMessageByMinBlock holds details about calls to the SendMessageByMinBlock method.
SendMessageByMinBlock []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// In is the in argument value.
In *SendMessageByMinBlockRequest
// Opts is the opts argument value.
Opts []grpc.CallOption
}
// SendMessageToAll holds details about calls to the SendMessageToAll method.
SendMessageToAll []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// In is the in argument value.
In *OutboundMessageData
// Opts is the opts argument value.
Opts []grpc.CallOption
}
// SendMessageToRandomPeers holds details about calls to the SendMessageToRandomPeers method.
SendMessageToRandomPeers []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// In is the in argument value.
In *SendMessageToRandomPeersRequest
// Opts is the opts argument value.
Opts []grpc.CallOption
}
// SetStatus holds details about calls to the SetStatus method.
SetStatus []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// In is the in argument value.
In *StatusData
// Opts is the opts argument value.
Opts []grpc.CallOption
}
}
lockHandShake sync.RWMutex
lockMessages sync.RWMutex
lockNodeInfo sync.RWMutex
lockPeerCount sync.RWMutex
lockPeerMinBlock sync.RWMutex
lockPeers sync.RWMutex
lockPenalizePeer sync.RWMutex
lockSendMessageById sync.RWMutex
lockSendMessageByMinBlock sync.RWMutex
lockSendMessageToAll sync.RWMutex
lockSendMessageToRandomPeers sync.RWMutex
lockSetStatus sync.RWMutex
}
// HandShake calls HandShakeFunc.
func (mock *SentryClientMock) HandShake(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HandShakeReply, error) {
callInfo := struct {
Ctx context.Context
In *emptypb.Empty
Opts []grpc.CallOption
}{
Ctx: ctx,
In: in,
Opts: opts,
}
mock.lockHandShake.Lock()
mock.calls.HandShake = append(mock.calls.HandShake, callInfo)
mock.lockHandShake.Unlock()
if mock.HandShakeFunc == nil {
var (
handShakeReplyOut *HandShakeReply
errOut error
)
return handShakeReplyOut, errOut
}
return mock.HandShakeFunc(ctx, in, opts...)
}
// HandShakeCalls gets all the calls that were made to HandShake.
// Check the length with:
// len(mockedSentryClient.HandShakeCalls())
func (mock *SentryClientMock) HandShakeCalls() []struct {
Ctx context.Context
In *emptypb.Empty
Opts []grpc.CallOption
} {
var calls []struct {
Ctx context.Context
In *emptypb.Empty
Opts []grpc.CallOption
}
mock.lockHandShake.RLock()
calls = mock.calls.HandShake
mock.lockHandShake.RUnlock()
return calls
}
// Messages calls MessagesFunc.
func (mock *SentryClientMock) Messages(ctx context.Context, in *MessagesRequest, opts ...grpc.CallOption) (Sentry_MessagesClient, error) {
callInfo := struct {
Ctx context.Context
In *MessagesRequest
Opts []grpc.CallOption
}{
Ctx: ctx,
In: in,
Opts: opts,
}
mock.lockMessages.Lock()
mock.calls.Messages = append(mock.calls.Messages, callInfo)
mock.lockMessages.Unlock()
if mock.MessagesFunc == nil {
var (
sentry_MessagesClientOut Sentry_MessagesClient
errOut error
)
return sentry_MessagesClientOut, errOut
}
return mock.MessagesFunc(ctx, in, opts...)
}
// MessagesCalls gets all the calls that were made to Messages.
// Check the length with:
// len(mockedSentryClient.MessagesCalls())
func (mock *SentryClientMock) MessagesCalls() []struct {
Ctx context.Context
In *MessagesRequest
Opts []grpc.CallOption
} {
var calls []struct {
Ctx context.Context
In *MessagesRequest
Opts []grpc.CallOption
}
mock.lockMessages.RLock()
calls = mock.calls.Messages
mock.lockMessages.RUnlock()
return calls
}
// NodeInfo calls NodeInfoFunc.
func (mock *SentryClientMock) NodeInfo(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.NodeInfoReply, error) {
callInfo := struct {
Ctx context.Context
In *emptypb.Empty
Opts []grpc.CallOption
}{
Ctx: ctx,
In: in,
Opts: opts,
}
mock.lockNodeInfo.Lock()
mock.calls.NodeInfo = append(mock.calls.NodeInfo, callInfo)
mock.lockNodeInfo.Unlock()
if mock.NodeInfoFunc == nil {
var (
nodeInfoReplyOut *types.NodeInfoReply
errOut error
)
return nodeInfoReplyOut, errOut
}
return mock.NodeInfoFunc(ctx, in, opts...)
}
// NodeInfoCalls gets all the calls that were made to NodeInfo.
// Check the length with:
// len(mockedSentryClient.NodeInfoCalls())
func (mock *SentryClientMock) NodeInfoCalls() []struct {
Ctx context.Context
In *emptypb.Empty
Opts []grpc.CallOption
} {
var calls []struct {
Ctx context.Context
In *emptypb.Empty
Opts []grpc.CallOption
}
mock.lockNodeInfo.RLock()
calls = mock.calls.NodeInfo
mock.lockNodeInfo.RUnlock()
return calls
}
// PeerCount calls PeerCountFunc.
func (mock *SentryClientMock) PeerCount(ctx context.Context, in *PeerCountRequest, opts ...grpc.CallOption) (*PeerCountReply, error) {
callInfo := struct {
Ctx context.Context
In *PeerCountRequest
Opts []grpc.CallOption
}{
Ctx: ctx,
In: in,
Opts: opts,
}
mock.lockPeerCount.Lock()
mock.calls.PeerCount = append(mock.calls.PeerCount, callInfo)
mock.lockPeerCount.Unlock()
if mock.PeerCountFunc == nil {
var (
peerCountReplyOut *PeerCountReply
errOut error
)
return peerCountReplyOut, errOut
}
return mock.PeerCountFunc(ctx, in, opts...)
}
// PeerCountCalls gets all the calls that were made to PeerCount.
// Check the length with:
// len(mockedSentryClient.PeerCountCalls())
func (mock *SentryClientMock) PeerCountCalls() []struct {
Ctx context.Context
In *PeerCountRequest
Opts []grpc.CallOption
} {
var calls []struct {
Ctx context.Context
In *PeerCountRequest
Opts []grpc.CallOption
}
mock.lockPeerCount.RLock()
calls = mock.calls.PeerCount
mock.lockPeerCount.RUnlock()
return calls
}
// PeerMinBlock calls PeerMinBlockFunc.
func (mock *SentryClientMock) PeerMinBlock(ctx context.Context, in *PeerMinBlockRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
callInfo := struct {
Ctx context.Context
In *PeerMinBlockRequest
Opts []grpc.CallOption
}{
Ctx: ctx,
In: in,
Opts: opts,
}
mock.lockPeerMinBlock.Lock()
mock.calls.PeerMinBlock = append(mock.calls.PeerMinBlock, callInfo)
mock.lockPeerMinBlock.Unlock()
if mock.PeerMinBlockFunc == nil {
var (
emptyOut *emptypb.Empty
errOut error
)
return emptyOut, errOut
}
return mock.PeerMinBlockFunc(ctx, in, opts...)
}
// PeerMinBlockCalls gets all the calls that were made to PeerMinBlock.
// Check the length with:
// len(mockedSentryClient.PeerMinBlockCalls())
func (mock *SentryClientMock) PeerMinBlockCalls() []struct {
Ctx context.Context
In *PeerMinBlockRequest
Opts []grpc.CallOption
} {
var calls []struct {
Ctx context.Context
In *PeerMinBlockRequest
Opts []grpc.CallOption
}
mock.lockPeerMinBlock.RLock()
calls = mock.calls.PeerMinBlock
mock.lockPeerMinBlock.RUnlock()
return calls
}
// Peers calls PeersFunc.
func (mock *SentryClientMock) Peers(ctx context.Context, in *PeersRequest, opts ...grpc.CallOption) (Sentry_PeersClient, error) {
callInfo := struct {
Ctx context.Context
In *PeersRequest
Opts []grpc.CallOption
}{
Ctx: ctx,
In: in,
Opts: opts,
}
mock.lockPeers.Lock()
mock.calls.Peers = append(mock.calls.Peers, callInfo)
mock.lockPeers.Unlock()
if mock.PeersFunc == nil {
var (
sentry_PeersClientOut Sentry_PeersClient
errOut error
)
return sentry_PeersClientOut, errOut
}
return mock.PeersFunc(ctx, in, opts...)
}
// PeersCalls gets all the calls that were made to Peers.
// Check the length with:
// len(mockedSentryClient.PeersCalls())
func (mock *SentryClientMock) PeersCalls() []struct {
Ctx context.Context
In *PeersRequest
Opts []grpc.CallOption
} {
var calls []struct {
Ctx context.Context
In *PeersRequest
Opts []grpc.CallOption
}
mock.lockPeers.RLock()
calls = mock.calls.Peers
mock.lockPeers.RUnlock()
return calls
}
// PenalizePeer calls PenalizePeerFunc.
func (mock *SentryClientMock) PenalizePeer(ctx context.Context, in *PenalizePeerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
callInfo := struct {
Ctx context.Context
In *PenalizePeerRequest
Opts []grpc.CallOption
}{
Ctx: ctx,
In: in,
Opts: opts,
}
mock.lockPenalizePeer.Lock()
mock.calls.PenalizePeer = append(mock.calls.PenalizePeer, callInfo)
mock.lockPenalizePeer.Unlock()
if mock.PenalizePeerFunc == nil {
var (
emptyOut *emptypb.Empty
errOut error
)
return emptyOut, errOut
}
return mock.PenalizePeerFunc(ctx, in, opts...)
}
// PenalizePeerCalls gets all the calls that were made to PenalizePeer.
// Check the length with:
// len(mockedSentryClient.PenalizePeerCalls())
func (mock *SentryClientMock) PenalizePeerCalls() []struct {
Ctx context.Context
In *PenalizePeerRequest
Opts []grpc.CallOption
} {
var calls []struct {
Ctx context.Context
In *PenalizePeerRequest
Opts []grpc.CallOption
}
mock.lockPenalizePeer.RLock()
calls = mock.calls.PenalizePeer
mock.lockPenalizePeer.RUnlock()
return calls
}
// SendMessageById calls SendMessageByIdFunc.
func (mock *SentryClientMock) SendMessageById(ctx context.Context, in *SendMessageByIdRequest, opts ...grpc.CallOption) (*SentPeers, error) {
callInfo := struct {
Ctx context.Context
In *SendMessageByIdRequest
Opts []grpc.CallOption
}{
Ctx: ctx,
In: in,
Opts: opts,
}
mock.lockSendMessageById.Lock()
mock.calls.SendMessageById = append(mock.calls.SendMessageById, callInfo)
mock.lockSendMessageById.Unlock()
if mock.SendMessageByIdFunc == nil {
var (
sentPeersOut *SentPeers
errOut error
)
return sentPeersOut, errOut
}
return mock.SendMessageByIdFunc(ctx, in, opts...)
}
// SendMessageByIdCalls gets all the calls that were made to SendMessageById.
// Check the length with:
// len(mockedSentryClient.SendMessageByIdCalls())
func (mock *SentryClientMock) SendMessageByIdCalls() []struct {
Ctx context.Context
In *SendMessageByIdRequest
Opts []grpc.CallOption
} {
var calls []struct {
Ctx context.Context
In *SendMessageByIdRequest
Opts []grpc.CallOption
}
mock.lockSendMessageById.RLock()
calls = mock.calls.SendMessageById
mock.lockSendMessageById.RUnlock()
return calls
}
// SendMessageByMinBlock calls SendMessageByMinBlockFunc.
func (mock *SentryClientMock) SendMessageByMinBlock(ctx context.Context, in *SendMessageByMinBlockRequest, opts ...grpc.CallOption) (*SentPeers, error) {
callInfo := struct {
Ctx context.Context
In *SendMessageByMinBlockRequest
Opts []grpc.CallOption
}{
Ctx: ctx,
In: in,
Opts: opts,
}
mock.lockSendMessageByMinBlock.Lock()
mock.calls.SendMessageByMinBlock = append(mock.calls.SendMessageByMinBlock, callInfo)
mock.lockSendMessageByMinBlock.Unlock()
if mock.SendMessageByMinBlockFunc == nil {
var (
sentPeersOut *SentPeers
errOut error
)
return sentPeersOut, errOut
}
return mock.SendMessageByMinBlockFunc(ctx, in, opts...)
}
// SendMessageByMinBlockCalls gets all the calls that were made to SendMessageByMinBlock.
// Check the length with:
// len(mockedSentryClient.SendMessageByMinBlockCalls())
func (mock *SentryClientMock) SendMessageByMinBlockCalls() []struct {
Ctx context.Context
In *SendMessageByMinBlockRequest
Opts []grpc.CallOption
} {
var calls []struct {
Ctx context.Context
In *SendMessageByMinBlockRequest
Opts []grpc.CallOption
}
mock.lockSendMessageByMinBlock.RLock()
calls = mock.calls.SendMessageByMinBlock
mock.lockSendMessageByMinBlock.RUnlock()
return calls
}
// SendMessageToAll calls SendMessageToAllFunc.
func (mock *SentryClientMock) SendMessageToAll(ctx context.Context, in *OutboundMessageData, opts ...grpc.CallOption) (*SentPeers, error) {
callInfo := struct {
Ctx context.Context
In *OutboundMessageData
Opts []grpc.CallOption
}{
Ctx: ctx,
In: in,
Opts: opts,
}
mock.lockSendMessageToAll.Lock()
mock.calls.SendMessageToAll = append(mock.calls.SendMessageToAll, callInfo)
mock.lockSendMessageToAll.Unlock()
if mock.SendMessageToAllFunc == nil {
var (
sentPeersOut *SentPeers
errOut error
)
return sentPeersOut, errOut
}
return mock.SendMessageToAllFunc(ctx, in, opts...)
}
// SendMessageToAllCalls gets all the calls that were made to SendMessageToAll.
// Check the length with:
// len(mockedSentryClient.SendMessageToAllCalls())
func (mock *SentryClientMock) SendMessageToAllCalls() []struct {
Ctx context.Context
In *OutboundMessageData
Opts []grpc.CallOption
} {
var calls []struct {
Ctx context.Context
In *OutboundMessageData
Opts []grpc.CallOption
}
mock.lockSendMessageToAll.RLock()
calls = mock.calls.SendMessageToAll
mock.lockSendMessageToAll.RUnlock()
return calls
}
// SendMessageToRandomPeers calls SendMessageToRandomPeersFunc.
func (mock *SentryClientMock) SendMessageToRandomPeers(ctx context.Context, in *SendMessageToRandomPeersRequest, opts ...grpc.CallOption) (*SentPeers, error) {
callInfo := struct {
Ctx context.Context
In *SendMessageToRandomPeersRequest
Opts []grpc.CallOption
}{
Ctx: ctx,
In: in,
Opts: opts,
}
mock.lockSendMessageToRandomPeers.Lock()
mock.calls.SendMessageToRandomPeers = append(mock.calls.SendMessageToRandomPeers, callInfo)
mock.lockSendMessageToRandomPeers.Unlock()
if mock.SendMessageToRandomPeersFunc == nil {
var (
sentPeersOut *SentPeers
errOut error
)
return sentPeersOut, errOut
}
return mock.SendMessageToRandomPeersFunc(ctx, in, opts...)
}
// SendMessageToRandomPeersCalls gets all the calls that were made to SendMessageToRandomPeers.
// Check the length with:
// len(mockedSentryClient.SendMessageToRandomPeersCalls())
func (mock *SentryClientMock) SendMessageToRandomPeersCalls() []struct {
Ctx context.Context
In *SendMessageToRandomPeersRequest
Opts []grpc.CallOption
} {
var calls []struct {
Ctx context.Context
In *SendMessageToRandomPeersRequest
Opts []grpc.CallOption
}
mock.lockSendMessageToRandomPeers.RLock()
calls = mock.calls.SendMessageToRandomPeers
mock.lockSendMessageToRandomPeers.RUnlock()
return calls
}
// SetStatus calls SetStatusFunc.
func (mock *SentryClientMock) SetStatus(ctx context.Context, in *StatusData, opts ...grpc.CallOption) (*SetStatusReply, error) {
callInfo := struct {
Ctx context.Context
In *StatusData
Opts []grpc.CallOption
}{
Ctx: ctx,
In: in,
Opts: opts,
}
mock.lockSetStatus.Lock()
mock.calls.SetStatus = append(mock.calls.SetStatus, callInfo)
mock.lockSetStatus.Unlock()
if mock.SetStatusFunc == nil {
var (
setStatusReplyOut *SetStatusReply
errOut error
)
return setStatusReplyOut, errOut
}
return mock.SetStatusFunc(ctx, in, opts...)
}
// SetStatusCalls gets all the calls that were made to SetStatus.
// Check the length with:
// len(mockedSentryClient.SetStatusCalls())
func (mock *SentryClientMock) SetStatusCalls() []struct {
Ctx context.Context
In *StatusData
Opts []grpc.CallOption
} {
var calls []struct {
Ctx context.Context
In *StatusData
Opts []grpc.CallOption
}
mock.lockSetStatus.RLock()
calls = mock.calls.SetStatus
mock.lockSetStatus.RUnlock()
return calls
}