// Code generated by moq; DO NOT EDIT. // github.com/matryer/moq package sentry import ( context "context" 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{ // MessagesFunc: func(messagesRequest *MessagesRequest, sentry_MessagesServer Sentry_MessagesServer) error { // panic("mock out the Messages 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 { // MessagesFunc mocks the Messages method. MessagesFunc func(messagesRequest *MessagesRequest, sentry_MessagesServer Sentry_MessagesServer) 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 { // 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 } // 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 { } } lockMessages 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 } // Messages calls MessagesFunc. func (mock *SentryServerMock) Messages(messagesRequest *MessagesRequest, sentry_MessagesServer Sentry_MessagesServer) error { if mock.MessagesFunc == nil { panic("SentryServerMock.MessagesFunc: method is nil but SentryServer.Messages was just called") } 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() 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 } // PeerCount calls PeerCountFunc. func (mock *SentryServerMock) PeerCount(contextMoqParam context.Context, peerCountRequest *PeerCountRequest) (*PeerCountReply, error) { if mock.PeerCountFunc == nil { panic("SentryServerMock.PeerCountFunc: method is nil but SentryServer.PeerCount was just called") } 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() 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) { if mock.PeerMinBlockFunc == nil { panic("SentryServerMock.PeerMinBlockFunc: method is nil but SentryServer.PeerMinBlock was just called") } 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() 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 { if mock.PeersFunc == nil { panic("SentryServerMock.PeersFunc: method is nil but SentryServer.Peers was just called") } 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() 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) { if mock.PenalizePeerFunc == nil { panic("SentryServerMock.PenalizePeerFunc: method is nil but SentryServer.PenalizePeer was just called") } 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() 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) { if mock.SendMessageByIdFunc == nil { panic("SentryServerMock.SendMessageByIdFunc: method is nil but SentryServer.SendMessageById was just called") } 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() 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) { if mock.SendMessageByMinBlockFunc == nil { panic("SentryServerMock.SendMessageByMinBlockFunc: method is nil but SentryServer.SendMessageByMinBlock was just called") } 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() 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) { if mock.SendMessageToAllFunc == nil { panic("SentryServerMock.SendMessageToAllFunc: method is nil but SentryServer.SendMessageToAll was just called") } 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() 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) { if mock.SendMessageToRandomPeersFunc == nil { panic("SentryServerMock.SendMessageToRandomPeersFunc: method is nil but SentryServer.SendMessageToRandomPeers was just called") } 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() 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) { if mock.SetStatusFunc == nil { panic("SentryServerMock.SetStatusFunc: method is nil but SentryServer.SetStatus was just called") } 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() 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() { if mock.mustEmbedUnimplementedSentryServerFunc == nil { panic("SentryServerMock.mustEmbedUnimplementedSentryServerFunc: method is nil but SentryServer.mustEmbedUnimplementedSentryServer was just called") } callInfo := struct { }{} mock.lockmustEmbedUnimplementedSentryServer.Lock() mock.calls.mustEmbedUnimplementedSentryServer = append(mock.calls.mustEmbedUnimplementedSentryServer, callInfo) mock.lockmustEmbedUnimplementedSentryServer.Unlock() 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{ // MessagesFunc: func(ctx context.Context, in *MessagesRequest, opts ...grpc.CallOption) (Sentry_MessagesClient, error) { // panic("mock out the Messages 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 { // MessagesFunc mocks the Messages method. MessagesFunc func(ctx context.Context, in *MessagesRequest, opts ...grpc.CallOption) (Sentry_MessagesClient, 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 { // 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 } // 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 } } lockMessages 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 } // Messages calls MessagesFunc. func (mock *SentryClientMock) Messages(ctx context.Context, in *MessagesRequest, opts ...grpc.CallOption) (Sentry_MessagesClient, error) { if mock.MessagesFunc == nil { panic("SentryClientMock.MessagesFunc: method is nil but SentryClient.Messages was just called") } 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() 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 } // PeerCount calls PeerCountFunc. func (mock *SentryClientMock) PeerCount(ctx context.Context, in *PeerCountRequest, opts ...grpc.CallOption) (*PeerCountReply, error) { if mock.PeerCountFunc == nil { panic("SentryClientMock.PeerCountFunc: method is nil but SentryClient.PeerCount was just called") } 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() 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) { if mock.PeerMinBlockFunc == nil { panic("SentryClientMock.PeerMinBlockFunc: method is nil but SentryClient.PeerMinBlock was just called") } 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() 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) { if mock.PeersFunc == nil { panic("SentryClientMock.PeersFunc: method is nil but SentryClient.Peers was just called") } 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() 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) { if mock.PenalizePeerFunc == nil { panic("SentryClientMock.PenalizePeerFunc: method is nil but SentryClient.PenalizePeer was just called") } 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() 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) { if mock.SendMessageByIdFunc == nil { panic("SentryClientMock.SendMessageByIdFunc: method is nil but SentryClient.SendMessageById was just called") } 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() 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) { if mock.SendMessageByMinBlockFunc == nil { panic("SentryClientMock.SendMessageByMinBlockFunc: method is nil but SentryClient.SendMessageByMinBlock was just called") } 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() 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) { if mock.SendMessageToAllFunc == nil { panic("SentryClientMock.SendMessageToAllFunc: method is nil but SentryClient.SendMessageToAll was just called") } 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() 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) { if mock.SendMessageToRandomPeersFunc == nil { panic("SentryClientMock.SendMessageToRandomPeersFunc: method is nil but SentryClient.SendMessageToRandomPeers was just called") } 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() 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) { if mock.SetStatusFunc == nil { panic("SentryClientMock.SetStatusFunc: method is nil but SentryClient.SetStatus was just called") } 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() 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 }