Regenerate host mock

pull/392/head
Eugene Kim 6 years ago
parent 7f0e170f7a
commit bc3fb1e4a2
  1. 2
      p2p/host.go
  2. 46
      p2p/host/mock/host_mock.go

@ -5,6 +5,8 @@ import (
peer "github.com/libp2p/go-libp2p-peer" peer "github.com/libp2p/go-libp2p-peer"
) )
//go:generate mockgen -source host.go -destination=host/mock/host_mock.go
// Host is the client + server in p2p network. // Host is the client + server in p2p network.
type Host interface { type Host interface {
GetSelfPeer() Peer GetSelfPeer() Peer

@ -1,16 +1,15 @@
// Code generated by MockGen. DO NOT EDIT. // Code generated by MockGen. DO NOT EDIT.
// Source: ./p2p/host/host.go // Source: host.go
// Package mock is a generated GoMock package. // Package mock_p2p is a generated GoMock package.
package mock package mock_p2p
import ( import (
reflect "reflect"
gomock "github.com/golang/mock/gomock" gomock "github.com/golang/mock/gomock"
p2p "github.com/harmony-one/harmony/p2p" p2p "github.com/harmony-one/harmony/p2p"
p2p_host "github.com/libp2p/go-libp2p-host" go_libp2p_host "github.com/libp2p/go-libp2p-host"
peer "github.com/libp2p/go-libp2p-peer" go_libp2p_peer "github.com/libp2p/go-libp2p-peer"
reflect "reflect"
) )
// MockHost is a mock of Host interface // MockHost is a mock of Host interface
@ -95,9 +94,9 @@ func (mr *MockHostMockRecorder) AddPeer(arg0 interface{}) *gomock.Call {
} }
// GetID mocks base method // GetID mocks base method
func (m *MockHost) GetID() peer.ID { func (m *MockHost) GetID() go_libp2p_peer.ID {
ret := m.ctrl.Call(m, "GetID") ret := m.ctrl.Call(m, "GetID")
ret0, _ := ret[0].(peer.ID) ret0, _ := ret[0].(go_libp2p_peer.ID)
return ret0 return ret0
} }
@ -107,9 +106,9 @@ func (mr *MockHostMockRecorder) GetID() *gomock.Call {
} }
// GetP2PHost mocks base method // GetP2PHost mocks base method
func (m *MockHost) GetP2PHost() p2p_host.Host { func (m *MockHost) GetP2PHost() go_libp2p_host.Host {
ret := m.ctrl.Call(m, "GetP2PHost") ret := m.ctrl.Call(m, "GetP2PHost")
ret0, _ := ret[0].(p2p_host.Host) ret0, _ := ret[0].(go_libp2p_host.Host)
return ret0 return ret0
} }
@ -117,3 +116,28 @@ func (m *MockHost) GetP2PHost() p2p_host.Host {
func (mr *MockHostMockRecorder) GetP2PHost() *gomock.Call { func (mr *MockHostMockRecorder) GetP2PHost() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetP2PHost", reflect.TypeOf((*MockHost)(nil).GetP2PHost)) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetP2PHost", reflect.TypeOf((*MockHost)(nil).GetP2PHost))
} }
// SendMessageToGroups mocks base method
func (m *MockHost) SendMessageToGroups(groups []p2p.GroupID, msg []byte) error {
ret := m.ctrl.Call(m, "SendMessageToGroups", groups, msg)
ret0, _ := ret[0].(error)
return ret0
}
// SendMessageToGroups indicates an expected call of SendMessageToGroups
func (mr *MockHostMockRecorder) SendMessageToGroups(groups, msg interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessageToGroups", reflect.TypeOf((*MockHost)(nil).SendMessageToGroups), groups, msg)
}
// GroupReceiver mocks base method
func (m *MockHost) GroupReceiver(arg0 p2p.GroupID) (p2p.GroupReceiver, error) {
ret := m.ctrl.Call(m, "GroupReceiver", arg0)
ret0, _ := ret[0].(p2p.GroupReceiver)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GroupReceiver indicates an expected call of GroupReceiver
func (mr *MockHostMockRecorder) GroupReceiver(arg0 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GroupReceiver", reflect.TypeOf((*MockHost)(nil).GroupReceiver), arg0)
}

Loading…
Cancel
Save