github.com/aergoio/aergo@v1.3.1/p2p/p2pmock/mock_consensus.go (about)

     1  // Code generated by MockGen. DO NOT EDIT.
     2  // Source: github.com/aergoio/aergo/consensus (interfaces: ConsensusAccessor,AergoRaftAccessor)
     3  
     4  // Package mock_consensus is a generated GoMock package.
     5  package p2pmock
     6  
     7  import (
     8  	context "context"
     9  	consensus "github.com/aergoio/aergo/consensus"
    10  	types "github.com/aergoio/aergo/types"
    11  	raft "github.com/aergoio/etcd/raft"
    12  	raftpb "github.com/aergoio/etcd/raft/raftpb"
    13  	gomock "github.com/golang/mock/gomock"
    14  	peer "github.com/libp2p/go-libp2p-core/peer"
    15  	io "io"
    16  	reflect "reflect"
    17  )
    18  
    19  // MockConsensusAccessor is a mock of ConsensusAccessor interface
    20  type MockConsensusAccessor struct {
    21  	ctrl     *gomock.Controller
    22  	recorder *MockConsensusAccessorMockRecorder
    23  }
    24  
    25  // MockConsensusAccessorMockRecorder is the mock recorder for MockConsensusAccessor
    26  type MockConsensusAccessorMockRecorder struct {
    27  	mock *MockConsensusAccessor
    28  }
    29  
    30  // NewMockConsensusAccessor creates a new mock instance
    31  func NewMockConsensusAccessor(ctrl *gomock.Controller) *MockConsensusAccessor {
    32  	mock := &MockConsensusAccessor{ctrl: ctrl}
    33  	mock.recorder = &MockConsensusAccessorMockRecorder{mock}
    34  	return mock
    35  }
    36  
    37  // EXPECT returns an object that allows the caller to indicate expected use
    38  func (m *MockConsensusAccessor) EXPECT() *MockConsensusAccessorMockRecorder {
    39  	return m.recorder
    40  }
    41  
    42  // ClusterInfo mocks base method
    43  func (m *MockConsensusAccessor) ClusterInfo(arg0 []byte) *types.GetClusterInfoResponse {
    44  	m.ctrl.T.Helper()
    45  	ret := m.ctrl.Call(m, "ClusterInfo", arg0)
    46  	ret0, _ := ret[0].(*types.GetClusterInfoResponse)
    47  	return ret0
    48  }
    49  
    50  // ClusterInfo indicates an expected call of ClusterInfo
    51  func (mr *MockConsensusAccessorMockRecorder) ClusterInfo(arg0 interface{}) *gomock.Call {
    52  	mr.mock.ctrl.T.Helper()
    53  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClusterInfo", reflect.TypeOf((*MockConsensusAccessor)(nil).ClusterInfo), arg0)
    54  }
    55  
    56  // ConfChange mocks base method
    57  func (m *MockConsensusAccessor) ConfChange(arg0 *types.MembershipChange) (*consensus.Member, error) {
    58  	m.ctrl.T.Helper()
    59  	ret := m.ctrl.Call(m, "ConfChange", arg0)
    60  	ret0, _ := ret[0].(*consensus.Member)
    61  	ret1, _ := ret[1].(error)
    62  	return ret0, ret1
    63  }
    64  
    65  // ConfChange indicates an expected call of ConfChange
    66  func (mr *MockConsensusAccessorMockRecorder) ConfChange(arg0 interface{}) *gomock.Call {
    67  	mr.mock.ctrl.T.Helper()
    68  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConfChange", reflect.TypeOf((*MockConsensusAccessor)(nil).ConfChange), arg0)
    69  }
    70  
    71  // ConfChangeInfo mocks base method
    72  func (m *MockConsensusAccessor) ConfChangeInfo(arg0 uint64) (*types.ConfChangeProgress, error) {
    73  	m.ctrl.T.Helper()
    74  	ret := m.ctrl.Call(m, "ConfChangeInfo", arg0)
    75  	ret0, _ := ret[0].(*types.ConfChangeProgress)
    76  	ret1, _ := ret[1].(error)
    77  	return ret0, ret1
    78  }
    79  
    80  // ConfChangeInfo indicates an expected call of ConfChangeInfo
    81  func (mr *MockConsensusAccessorMockRecorder) ConfChangeInfo(arg0 interface{}) *gomock.Call {
    82  	mr.mock.ctrl.T.Helper()
    83  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConfChangeInfo", reflect.TypeOf((*MockConsensusAccessor)(nil).ConfChangeInfo), arg0)
    84  }
    85  
    86  // ConsensusInfo mocks base method
    87  func (m *MockConsensusAccessor) ConsensusInfo() *types.ConsensusInfo {
    88  	m.ctrl.T.Helper()
    89  	ret := m.ctrl.Call(m, "ConsensusInfo")
    90  	ret0, _ := ret[0].(*types.ConsensusInfo)
    91  	return ret0
    92  }
    93  
    94  // ConsensusInfo indicates an expected call of ConsensusInfo
    95  func (mr *MockConsensusAccessorMockRecorder) ConsensusInfo() *gomock.Call {
    96  	mr.mock.ctrl.T.Helper()
    97  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConsensusInfo", reflect.TypeOf((*MockConsensusAccessor)(nil).ConsensusInfo))
    98  }
    99  
   100  // RaftAccessor mocks base method
   101  func (m *MockConsensusAccessor) RaftAccessor() consensus.AergoRaftAccessor {
   102  	m.ctrl.T.Helper()
   103  	ret := m.ctrl.Call(m, "RaftAccessor")
   104  	ret0, _ := ret[0].(consensus.AergoRaftAccessor)
   105  	return ret0
   106  }
   107  
   108  // RaftAccessor indicates an expected call of RaftAccessor
   109  func (mr *MockConsensusAccessorMockRecorder) RaftAccessor() *gomock.Call {
   110  	mr.mock.ctrl.T.Helper()
   111  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RaftAccessor", reflect.TypeOf((*MockConsensusAccessor)(nil).RaftAccessor))
   112  }
   113  
   114  // MockAergoRaftAccessor is a mock of AergoRaftAccessor interface
   115  type MockAergoRaftAccessor struct {
   116  	ctrl     *gomock.Controller
   117  	recorder *MockAergoRaftAccessorMockRecorder
   118  }
   119  
   120  // MockAergoRaftAccessorMockRecorder is the mock recorder for MockAergoRaftAccessor
   121  type MockAergoRaftAccessorMockRecorder struct {
   122  	mock *MockAergoRaftAccessor
   123  }
   124  
   125  // NewMockAergoRaftAccessor creates a new mock instance
   126  func NewMockAergoRaftAccessor(ctrl *gomock.Controller) *MockAergoRaftAccessor {
   127  	mock := &MockAergoRaftAccessor{ctrl: ctrl}
   128  	mock.recorder = &MockAergoRaftAccessorMockRecorder{mock}
   129  	return mock
   130  }
   131  
   132  // EXPECT returns an object that allows the caller to indicate expected use
   133  func (m *MockAergoRaftAccessor) EXPECT() *MockAergoRaftAccessorMockRecorder {
   134  	return m.recorder
   135  }
   136  
   137  // GetMemberByID mocks base method
   138  func (m *MockAergoRaftAccessor) GetMemberByID(arg0 uint64) *consensus.Member {
   139  	m.ctrl.T.Helper()
   140  	ret := m.ctrl.Call(m, "GetMemberByID", arg0)
   141  	ret0, _ := ret[0].(*consensus.Member)
   142  	return ret0
   143  }
   144  
   145  // GetMemberByID indicates an expected call of GetMemberByID
   146  func (mr *MockAergoRaftAccessorMockRecorder) GetMemberByID(arg0 interface{}) *gomock.Call {
   147  	mr.mock.ctrl.T.Helper()
   148  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMemberByID", reflect.TypeOf((*MockAergoRaftAccessor)(nil).GetMemberByID), arg0)
   149  }
   150  
   151  // GetMemberByPeerID mocks base method
   152  func (m *MockAergoRaftAccessor) GetMemberByPeerID(arg0 peer.ID) *consensus.Member {
   153  	m.ctrl.T.Helper()
   154  	ret := m.ctrl.Call(m, "GetMemberByPeerID", arg0)
   155  	ret0, _ := ret[0].(*consensus.Member)
   156  	return ret0
   157  }
   158  
   159  // GetMemberByPeerID indicates an expected call of GetMemberByPeerID
   160  func (mr *MockAergoRaftAccessorMockRecorder) GetMemberByPeerID(arg0 interface{}) *gomock.Call {
   161  	mr.mock.ctrl.T.Helper()
   162  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMemberByPeerID", reflect.TypeOf((*MockAergoRaftAccessor)(nil).GetMemberByPeerID), arg0)
   163  }
   164  
   165  // IsIDRemoved mocks base method
   166  func (m *MockAergoRaftAccessor) IsIDRemoved(arg0 peer.ID) bool {
   167  	m.ctrl.T.Helper()
   168  	ret := m.ctrl.Call(m, "IsIDRemoved", arg0)
   169  	ret0, _ := ret[0].(bool)
   170  	return ret0
   171  }
   172  
   173  // IsIDRemoved indicates an expected call of IsIDRemoved
   174  func (mr *MockAergoRaftAccessorMockRecorder) IsIDRemoved(arg0 interface{}) *gomock.Call {
   175  	mr.mock.ctrl.T.Helper()
   176  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsIDRemoved", reflect.TypeOf((*MockAergoRaftAccessor)(nil).IsIDRemoved), arg0)
   177  }
   178  
   179  // Process mocks base method
   180  func (m *MockAergoRaftAccessor) Process(arg0 context.Context, arg1 peer.ID, arg2 raftpb.Message) error {
   181  	m.ctrl.T.Helper()
   182  	ret := m.ctrl.Call(m, "Process", arg0, arg1, arg2)
   183  	ret0, _ := ret[0].(error)
   184  	return ret0
   185  }
   186  
   187  // Process indicates an expected call of Process
   188  func (mr *MockAergoRaftAccessorMockRecorder) Process(arg0, arg1, arg2 interface{}) *gomock.Call {
   189  	mr.mock.ctrl.T.Helper()
   190  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Process", reflect.TypeOf((*MockAergoRaftAccessor)(nil).Process), arg0, arg1, arg2)
   191  }
   192  
   193  // ReportSnapshot mocks base method
   194  func (m *MockAergoRaftAccessor) ReportSnapshot(arg0 peer.ID, arg1 raft.SnapshotStatus) {
   195  	m.ctrl.T.Helper()
   196  	m.ctrl.Call(m, "ReportSnapshot", arg0, arg1)
   197  }
   198  
   199  // ReportSnapshot indicates an expected call of ReportSnapshot
   200  func (mr *MockAergoRaftAccessorMockRecorder) ReportSnapshot(arg0, arg1 interface{}) *gomock.Call {
   201  	mr.mock.ctrl.T.Helper()
   202  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReportSnapshot", reflect.TypeOf((*MockAergoRaftAccessor)(nil).ReportSnapshot), arg0, arg1)
   203  }
   204  
   205  // ReportUnreachable mocks base method
   206  func (m *MockAergoRaftAccessor) ReportUnreachable(arg0 peer.ID) {
   207  	m.ctrl.T.Helper()
   208  	m.ctrl.Call(m, "ReportUnreachable", arg0)
   209  }
   210  
   211  // ReportUnreachable indicates an expected call of ReportUnreachable
   212  func (mr *MockAergoRaftAccessorMockRecorder) ReportUnreachable(arg0 interface{}) *gomock.Call {
   213  	mr.mock.ctrl.T.Helper()
   214  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReportUnreachable", reflect.TypeOf((*MockAergoRaftAccessor)(nil).ReportUnreachable), arg0)
   215  }
   216  
   217  // SaveFromRemote mocks base method
   218  func (m *MockAergoRaftAccessor) SaveFromRemote(arg0 io.Reader, arg1 uint64, arg2 raftpb.Message) (int64, error) {
   219  	m.ctrl.T.Helper()
   220  	ret := m.ctrl.Call(m, "SaveFromRemote", arg0, arg1, arg2)
   221  	ret0, _ := ret[0].(int64)
   222  	ret1, _ := ret[1].(error)
   223  	return ret0, ret1
   224  }
   225  
   226  // SaveFromRemote indicates an expected call of SaveFromRemote
   227  func (mr *MockAergoRaftAccessorMockRecorder) SaveFromRemote(arg0, arg1, arg2 interface{}) *gomock.Call {
   228  	mr.mock.ctrl.T.Helper()
   229  	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SaveFromRemote", reflect.TypeOf((*MockAergoRaftAccessor)(nil).SaveFromRemote), arg0, arg1, arg2)
   230  }