diff --git a/net/discovery/mock_socket.go b/net/discovery/mock_socket.go new file mode 100644 index 000000000..d443196de --- /dev/null +++ b/net/discovery/mock_socket.go @@ -0,0 +1,248 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: net/discovery/socket.go + +// Package discovery is a generated GoMock package. +package discovery + +import ( + net "net" + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + vnode "github.com/vitelabs/go-vite/v2/net/vnode" +) + +// Mocksender is a mock of sender interface. +type Mocksender struct { + ctrl *gomock.Controller + recorder *MocksenderMockRecorder +} + +// MocksenderMockRecorder is the mock recorder for Mocksender. +type MocksenderMockRecorder struct { + mock *Mocksender +} + +// NewMocksender creates a new mock instance. +func NewMocksender(ctrl *gomock.Controller) *Mocksender { + mock := &Mocksender{ctrl: ctrl} + mock.recorder = &MocksenderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *Mocksender) EXPECT() *MocksenderMockRecorder { + return m.recorder +} + +// findNode mocks base method. +func (m *Mocksender) findNode(target vnode.NodeID, count int, n *Node) (<-chan []*vnode.EndPoint, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "findNode", target, count, n) + ret0, _ := ret[0].(<-chan []*vnode.EndPoint) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// findNode indicates an expected call of findNode. +func (mr *MocksenderMockRecorder) findNode(target, count, n interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "findNode", reflect.TypeOf((*Mocksender)(nil).findNode), target, count, n) +} + +// ping mocks base method. +func (m *Mocksender) ping(n *Node, callback func(*Node, error)) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "ping", n, callback) +} + +// ping indicates an expected call of ping. +func (mr *MocksenderMockRecorder) ping(n, callback interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ping", reflect.TypeOf((*Mocksender)(nil).ping), n, callback) +} + +// pong mocks base method. +func (m *Mocksender) pong(echo []byte, n *Node) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "pong", echo, n) + ret0, _ := ret[0].(error) + return ret0 +} + +// pong indicates an expected call of pong. +func (mr *MocksenderMockRecorder) pong(echo, n interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "pong", reflect.TypeOf((*Mocksender)(nil).pong), echo, n) +} + +// sendNodes mocks base method. +func (m *Mocksender) sendNodes(eps []*vnode.EndPoint, addr *net.UDPAddr) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "sendNodes", eps, addr) + ret0, _ := ret[0].(error) + return ret0 +} + +// sendNodes indicates an expected call of sendNodes. +func (mr *MocksenderMockRecorder) sendNodes(eps, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "sendNodes", reflect.TypeOf((*Mocksender)(nil).sendNodes), eps, addr) +} + +// Mockreceiver is a mock of receiver interface. +type Mockreceiver struct { + ctrl *gomock.Controller + recorder *MockreceiverMockRecorder +} + +// MockreceiverMockRecorder is the mock recorder for Mockreceiver. +type MockreceiverMockRecorder struct { + mock *Mockreceiver +} + +// NewMockreceiver creates a new mock instance. +func NewMockreceiver(ctrl *gomock.Controller) *Mockreceiver { + mock := &Mockreceiver{ctrl: ctrl} + mock.recorder = &MockreceiverMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *Mockreceiver) EXPECT() *MockreceiverMockRecorder { + return m.recorder +} + +// start mocks base method. +func (m *Mockreceiver) start() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "start") + ret0, _ := ret[0].(error) + return ret0 +} + +// start indicates an expected call of start. +func (mr *MockreceiverMockRecorder) start() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "start", reflect.TypeOf((*Mockreceiver)(nil).start)) +} + +// stop mocks base method. +func (m *Mockreceiver) stop() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "stop") + ret0, _ := ret[0].(error) + return ret0 +} + +// stop indicates an expected call of stop. +func (mr *MockreceiverMockRecorder) stop() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "stop", reflect.TypeOf((*Mockreceiver)(nil).stop)) +} + +// Mocksocket is a mock of socket interface. +type Mocksocket struct { + ctrl *gomock.Controller + recorder *MocksocketMockRecorder +} + +// MocksocketMockRecorder is the mock recorder for Mocksocket. +type MocksocketMockRecorder struct { + mock *Mocksocket +} + +// NewMocksocket creates a new mock instance. +func NewMocksocket(ctrl *gomock.Controller) *Mocksocket { + mock := &Mocksocket{ctrl: ctrl} + mock.recorder = &MocksocketMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *Mocksocket) EXPECT() *MocksocketMockRecorder { + return m.recorder +} + +// findNode mocks base method. +func (m *Mocksocket) findNode(target vnode.NodeID, count int, n *Node) (<-chan []*vnode.EndPoint, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "findNode", target, count, n) + ret0, _ := ret[0].(<-chan []*vnode.EndPoint) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// findNode indicates an expected call of findNode. +func (mr *MocksocketMockRecorder) findNode(target, count, n interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "findNode", reflect.TypeOf((*Mocksocket)(nil).findNode), target, count, n) +} + +// ping mocks base method. +func (m *Mocksocket) ping(n *Node, callback func(*Node, error)) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "ping", n, callback) +} + +// ping indicates an expected call of ping. +func (mr *MocksocketMockRecorder) ping(n, callback interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ping", reflect.TypeOf((*Mocksocket)(nil).ping), n, callback) +} + +// pong mocks base method. +func (m *Mocksocket) pong(echo []byte, n *Node) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "pong", echo, n) + ret0, _ := ret[0].(error) + return ret0 +} + +// pong indicates an expected call of pong. +func (mr *MocksocketMockRecorder) pong(echo, n interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "pong", reflect.TypeOf((*Mocksocket)(nil).pong), echo, n) +} + +// sendNodes mocks base method. +func (m *Mocksocket) sendNodes(eps []*vnode.EndPoint, addr *net.UDPAddr) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "sendNodes", eps, addr) + ret0, _ := ret[0].(error) + return ret0 +} + +// sendNodes indicates an expected call of sendNodes. +func (mr *MocksocketMockRecorder) sendNodes(eps, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "sendNodes", reflect.TypeOf((*Mocksocket)(nil).sendNodes), eps, addr) +} + +// start mocks base method. +func (m *Mocksocket) start() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "start") + ret0, _ := ret[0].(error) + return ret0 +} + +// start indicates an expected call of start. +func (mr *MocksocketMockRecorder) start() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "start", reflect.TypeOf((*Mocksocket)(nil).start)) +} + +// stop mocks base method. +func (m *Mocksocket) stop() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "stop") + ret0, _ := ret[0].(error) + return ret0 +} + +// stop indicates an expected call of stop. +func (mr *MocksocketMockRecorder) stop() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "stop", reflect.TypeOf((*Mocksocket)(nil).stop)) +}