Commit ebd26f9a authored by suyanlong's avatar suyanlong

Fix uint test

parent f23e3cf1
...@@ -17,7 +17,6 @@ func TestLogger(t *testing.T) { ...@@ -17,7 +17,6 @@ func TestLogger(t *testing.T) {
Level: "info", Level: "info",
Module: repo.LogModule{ Module: repo.LogModule{
AppchainMgr: "info", AppchainMgr: "info",
Executor: "info",
App: "info", App: "info",
Monitor: "info", Monitor: "info",
Swarm: "info", Swarm: "info",
......
package peermgr package peermgr
import ( import (
"context"
"fmt" "fmt"
"testing" "testing"
"time" "time"
libp2pcry "github.com/libp2p/go-libp2p-core/crypto" libp2pcry "github.com/libp2p/go-libp2p-core/crypto"
peer2 "github.com/libp2p/go-libp2p-core/peer" peer2 "github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p/p2p/protocol/ping"
"github.com/meshplus/bitxhub-kit/crypto" "github.com/meshplus/bitxhub-kit/crypto"
"github.com/meshplus/bitxhub-kit/crypto/asym" "github.com/meshplus/bitxhub-kit/crypto/asym"
network "github.com/meshplus/go-lightp2p" network "github.com/meshplus/go-lightp2p"
...@@ -424,6 +426,14 @@ type MockNetwork struct { ...@@ -424,6 +426,14 @@ type MockNetwork struct {
MockDHTHandler MockDHTHandler
} }
func (mn *MockNetwork) GetStream(peerID string) (network.Stream, error) {
panic("implement me")
}
func (mn *MockNetwork) Ping(ctx context.Context, peerID string) (<-chan ping.Result, error) {
panic("implement me")
}
// Start start the network service. // Start start the network service.
func (mn *MockNetwork) Start() error { func (mn *MockNetwork) Start() error {
return nil return nil
......
...@@ -36,11 +36,9 @@ func (m *MockRouter) EXPECT() *MockRouterMockRecorder { ...@@ -36,11 +36,9 @@ func (m *MockRouter) EXPECT() *MockRouterMockRecorder {
} }
// Add mocks base method. // Add mocks base method.
func (m *MockRouter) Add(p port.Port) error { func (m *MockRouter) Add(p port.Port) {
m.ctrl.T.Helper() m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Add", p) m.ctrl.Call(m, "Add", p)
ret0, _ := ret[0].(error)
return ret0
} }
// Add indicates an expected call of Add. // Add indicates an expected call of Add.
...@@ -50,11 +48,9 @@ func (mr *MockRouterMockRecorder) Add(p interface{}) *gomock.Call { ...@@ -50,11 +48,9 @@ func (mr *MockRouterMockRecorder) Add(p interface{}) *gomock.Call {
} }
// Adds mocks base method. // Adds mocks base method.
func (m *MockRouter) Adds(p []port.Port) error { func (m *MockRouter) Adds(p []port.Port) {
m.ctrl.T.Helper() m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Adds", p) m.ctrl.Call(m, "Adds", p)
ret0, _ := ret[0].(error)
return ret0
} }
// Adds indicates an expected call of Adds. // Adds indicates an expected call of Adds.
...@@ -63,6 +59,20 @@ func (mr *MockRouterMockRecorder) Adds(p interface{}) *gomock.Call { ...@@ -63,6 +59,20 @@ func (mr *MockRouterMockRecorder) Adds(p interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Adds", reflect.TypeOf((*MockRouter)(nil).Adds), p) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Adds", reflect.TypeOf((*MockRouter)(nil).Adds), p)
} }
// AsyncSend mocks base method.
func (m *MockRouter) AsyncSend(id string, msg *pb.Message) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "AsyncSend", id, msg)
ret0, _ := ret[0].(error)
return ret0
}
// AsyncSend indicates an expected call of AsyncSend.
func (mr *MockRouterMockRecorder) AsyncSend(id, msg interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AsyncSend", reflect.TypeOf((*MockRouter)(nil).AsyncSend), id, msg)
}
// Load mocks base method. // Load mocks base method.
func (m *MockRouter) Load(key string) (port.Port, bool) { func (m *MockRouter) Load(key string) (port.Port, bool) {
m.ctrl.T.Helper() m.ctrl.T.Helper()
...@@ -92,6 +102,21 @@ func (mr *MockRouterMockRecorder) Route(ibtp interface{}) *gomock.Call { ...@@ -92,6 +102,21 @@ func (mr *MockRouterMockRecorder) Route(ibtp interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Route", reflect.TypeOf((*MockRouter)(nil).Route), ibtp) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Route", reflect.TypeOf((*MockRouter)(nil).Route), ibtp)
} }
// Send mocks base method.
func (m *MockRouter) Send(id string, msg *pb.Message) (*pb.Message, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Send", id, msg)
ret0, _ := ret[0].(*pb.Message)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Send indicates an expected call of Send.
func (mr *MockRouterMockRecorder) Send(id, msg interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockRouter)(nil).Send), id, msg)
}
// Start mocks base method. // Start mocks base method.
func (m *MockRouter) Start() error { func (m *MockRouter) Start() error {
m.ctrl.T.Helper() m.ctrl.T.Helper()
......
...@@ -161,20 +161,6 @@ func (mr *MockClientMockRecorder) CommitCallback(ibtp interface{}) *gomock.Call ...@@ -161,20 +161,6 @@ func (mr *MockClientMockRecorder) CommitCallback(ibtp interface{}) *gomock.Call
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CommitCallback", reflect.TypeOf((*MockClient)(nil).CommitCallback), ibtp) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CommitCallback", reflect.TypeOf((*MockClient)(nil).CommitCallback), ibtp)
} }
// Exited mocks base method.
func (m *MockClient) Exited() bool {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Exited")
ret0, _ := ret[0].(bool)
return ret0
}
// Exited indicates an expected call of Exited.
func (mr *MockClientMockRecorder) Exited() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exited", reflect.TypeOf((*MockClient)(nil).Exited))
}
// GetCallbackMeta mocks base method. // GetCallbackMeta mocks base method.
func (m *MockClient) GetCallbackMeta() (map[string]uint64, error) { func (m *MockClient) GetCallbackMeta() (map[string]uint64, error) {
m.ctrl.T.Helper() m.ctrl.T.Helper()
...@@ -322,18 +308,6 @@ func (mr *MockClientMockRecorder) Initialize(configPath, ID, extra interface{}) ...@@ -322,18 +308,6 @@ func (mr *MockClientMockRecorder) Initialize(configPath, ID, extra interface{})
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Initialize", reflect.TypeOf((*MockClient)(nil).Initialize), configPath, ID, extra) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Initialize", reflect.TypeOf((*MockClient)(nil).Initialize), configPath, ID, extra)
} }
// Kill mocks base method.
func (m *MockClient) Kill() {
m.ctrl.T.Helper()
m.ctrl.Call(m, "Kill")
}
// Kill indicates an expected call of Kill.
func (mr *MockClientMockRecorder) Kill() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Kill", reflect.TypeOf((*MockClient)(nil).Kill))
}
// Name mocks base method. // Name mocks base method.
func (m *MockClient) Name() string { func (m *MockClient) Name() string {
m.ctrl.T.Helper() m.ctrl.T.Helper()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment