Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
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
plugin
Commits
96d6d104
Commit
96d6d104
authored
Jan 06, 2021
by
袁兴强
Committed by
33cn
Jan 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix pbft ut
parent
2a46beb6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
pbft_test.go
plugin/consensus/pbft/pbft_test.go
+5
-7
No files found.
plugin/consensus/pbft/pbft_test.go
View file @
96d6d104
...
...
@@ -19,7 +19,6 @@ import (
"github.com/33cn/chain33/common/limits"
"github.com/33cn/chain33/common/log"
"github.com/33cn/chain33/executor"
"github.com/33cn/chain33/mempool"
"github.com/33cn/chain33/p2p"
"github.com/33cn/chain33/queue"
"github.com/33cn/chain33/store"
...
...
@@ -47,9 +46,8 @@ func init() {
log
.
SetLogLevel
(
"info"
)
}
func
TestPbft
(
t
*
testing
.
T
)
{
q
,
chain
,
p2pnet
,
s
,
mem
,
exec
,
cs
,
wallet
:=
initEnvPbft
()
q
,
chain
,
p2pnet
,
s
,
exec
,
cs
,
wallet
:=
initEnvPbft
()
defer
chain
.
Close
()
defer
mem
.
Close
()
defer
p2pnet
.
Close
()
defer
exec
.
Close
()
defer
s
.
Close
()
...
...
@@ -62,7 +60,7 @@ func TestPbft(t *testing.T) {
clearTestData
()
}
func
initEnvPbft
()
(
queue
.
Queue
,
*
blockchain
.
BlockChain
,
*
p2p
.
Manager
,
queue
.
Module
,
queue
.
Module
,
*
executor
.
Executor
,
queue
.
Module
,
queue
.
Module
)
{
func
initEnvPbft
()
(
queue
.
Queue
,
*
blockchain
.
BlockChain
,
*
p2p
.
Manager
,
queue
.
Module
,
*
executor
.
Executor
,
queue
.
Module
,
queue
.
Module
)
{
flag
.
Parse
()
chain33Cfg
:=
types
.
NewChain33Config
(
types
.
ReadFile
(
"chain33.test.toml"
))
var
q
=
queue
.
New
(
"channel"
)
...
...
@@ -72,8 +70,6 @@ func initEnvPbft() (queue.Queue, *blockchain.BlockChain, *p2p.Manager, queue.Mod
chain
:=
blockchain
.
New
(
chain33Cfg
)
chain
.
SetQueueClient
(
q
.
Client
())
mem
:=
mempool
.
New
(
chain33Cfg
)
mem
.
SetQueueClient
(
q
.
Client
())
exec
:=
executor
.
New
(
chain33Cfg
)
exec
.
SetQueueClient
(
q
.
Client
())
chain33Cfg
.
SetMinFee
(
0
)
...
...
@@ -86,7 +82,7 @@ func initEnvPbft() (queue.Queue, *blockchain.BlockChain, *p2p.Manager, queue.Mod
walletm
:=
wallet
.
New
(
chain33Cfg
)
walletm
.
SetQueueClient
(
q
.
Client
())
return
q
,
chain
,
p2pnet
,
s
,
mem
,
exec
,
cs
,
walletm
return
q
,
chain
,
p2pnet
,
s
,
exec
,
cs
,
walletm
}
...
...
@@ -104,6 +100,8 @@ func sendReplyList(q queue.Queue) {
time
.
Sleep
(
5
*
time
.
Second
)
break
}
}
else
if
msg
.
Ty
==
types
.
EventGetMempoolSize
{
msg
.
Reply
(
client
.
NewMessage
(
""
,
0
,
&
types
.
MempoolSize
{}))
}
}
}
...
...
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