Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sidecar
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
sidecar
Commits
ebd26f9a
Commit
ebd26f9a
authored
Dec 28, 2021
by
suyanlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix uint test
parent
f23e3cf1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
35 deletions
+43
-35
logger_test.go
internal/loggers/logger_test.go
+0
-1
peermgr_test.go
internal/peermgr/peermgr_test.go
+10
-0
mock_router.go
internal/router/mock_router/mock_router.go
+33
-8
mock_client.go
pkg/plugins/mock_client/mock_client.go
+0
-26
No files found.
internal/loggers/logger_test.go
View file @
ebd26f9a
...
@@ -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"
,
...
...
internal/peermgr/peermgr_test.go
View file @
ebd26f9a
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
...
...
internal/router/mock_router/mock_router.go
View file @
ebd26f9a
...
@@ -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
()
...
...
pkg/plugins/mock_client/mock_client.go
View file @
ebd26f9a
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment