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
340b0718
Commit
340b0718
authored
Nov 12, 2019
by
mdj33
Committed by
vipwzw
Nov 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ut
parent
eaf1c68c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
26 deletions
+19
-26
para.go
plugin/consensus/para/para.go
+6
-1
paracommitmsg.go
plugin/consensus/para/paracommitmsg.go
+0
-12
paracross_test.go
plugin/dapp/paracross/executor/paracross_test.go
+13
-13
No files found.
plugin/consensus/para/para.go
View file @
340b0718
...
@@ -250,7 +250,7 @@ func (client *client) SetQueueClient(c queue.Client) {
...
@@ -250,7 +250,7 @@ func (client *client) SetQueueClient(c queue.Client) {
})
})
go
client
.
EventLoop
()
go
client
.
EventLoop
()
client
.
wg
.
Add
(
1
)
client
.
wg
.
Add
(
1
)
go
client
.
commitMsgClient
.
process
()
go
client
.
commitMsgClient
.
handler
()
client
.
wg
.
Add
(
1
)
client
.
wg
.
Add
(
1
)
go
client
.
CreateBlock
()
go
client
.
CreateBlock
()
client
.
wg
.
Add
(
1
)
client
.
wg
.
Add
(
1
)
...
@@ -268,6 +268,11 @@ func (client *client) InitBlock() {
...
@@ -268,6 +268,11 @@ func (client *client) InitBlock() {
}
}
client
.
grpcClient
=
grpcCli
client
.
grpcClient
=
grpcCli
err
=
client
.
commitMsgClient
.
setSelfConsEnable
()
if
err
!=
nil
{
panic
(
err
)
}
block
,
err
:=
client
.
RequestLastBlock
()
block
,
err
:=
client
.
RequestLastBlock
()
if
err
!=
nil
{
if
err
!=
nil
{
panic
(
err
)
panic
(
err
)
...
...
plugin/consensus/para/paracommitmsg.go
View file @
340b0718
...
@@ -930,15 +930,3 @@ func (client *commitMsgClient) isSelfConsEnable(height int64) bool {
...
@@ -930,15 +930,3 @@ func (client *commitMsgClient) isSelfConsEnable(height int64) bool {
}
}
return
false
return
false
}
}
func
(
client
*
commitMsgClient
)
initConfig
()
{
err
:=
client
.
setSelfConsEnable
()
if
err
!=
nil
{
panic
(
err
)
}
}
func
(
client
*
commitMsgClient
)
process
()
{
client
.
initConfig
()
client
.
handler
()
}
plugin/dapp/paracross/executor/paracross_test.go
View file @
340b0718
...
@@ -469,32 +469,32 @@ type VoteTestSuite struct {
...
@@ -469,32 +469,32 @@ type VoteTestSuite struct {
exec
*
Paracross
exec
*
Paracross
}
}
func
(
s
uite
*
VoteTestSuite
)
SetupSuite
()
{
func
(
s
*
VoteTestSuite
)
SetupSuite
()
{
//para_init(Title)
//para_init(Title)
s
uite
.
exec
=
newParacross
()
.
(
*
Paracross
)
s
.
exec
=
newParacross
()
.
(
*
Paracross
)
api
:=
new
(
apimock
.
QueueProtocolAPI
)
api
:=
new
(
apimock
.
QueueProtocolAPI
)
api
.
On
(
"GetConfig"
,
mock
.
Anything
)
.
Return
(
chain33TestCfg
,
nil
)
api
.
On
(
"GetConfig"
,
mock
.
Anything
)
.
Return
(
chain33TestCfg
,
nil
)
s
uite
.
exec
.
SetAPI
(
api
)
s
.
exec
.
SetAPI
(
api
)
s
uite
.
stateDB
,
_
=
dbm
.
NewGoMemDB
(
"state"
,
"state"
,
1024
)
s
.
stateDB
,
_
=
dbm
.
NewGoMemDB
(
"state"
,
"state"
,
1024
)
// memdb 不支持KVDB接口, 等测试完Exec , 再扩展 memdb
// memdb 不支持KVDB接口, 等测试完Exec , 再扩展 memdb
//s
uite
.localDB, _ = dbm.NewGoMemDB("local", "local", 1024)
//s.localDB, _ = dbm.NewGoMemDB("local", "local", 1024)
s
uite
.
localDB
=
new
(
dbmock
.
KVDB
)
s
.
localDB
=
new
(
dbmock
.
KVDB
)
s
uite
.
exec
.
SetLocalDB
(
suite
.
localDB
)
s
.
exec
.
SetLocalDB
(
s
.
localDB
)
s
uite
.
exec
.
SetStateDB
(
suite
.
stateDB
)
s
.
exec
.
SetStateDB
(
s
.
stateDB
)
s
uite
.
exec
.
SetEnv
(
0
,
0
,
0
)
s
.
exec
.
SetEnv
(
0
,
0
,
0
)
stageKey
:=
calcParaSelfConsStagesKey
()
stageKey
:=
calcParaSelfConsStagesKey
()
stage
:=
&
pt
.
SelfConsensStage
{
BlockHeight
:
0
,
Enable
:
pt
.
ParaConfigYes
}
stage
:=
&
pt
.
SelfConsensStage
{
BlockHeight
:
0
,
Enable
:
pt
.
ParaConfigYes
}
stages
:=
&
pt
.
SelfConsensStages
{
Items
:
[]
*
pt
.
SelfConsensStage
{
stage
}}
stages
:=
&
pt
.
SelfConsensStages
{
Items
:
[]
*
pt
.
SelfConsensStage
{
stage
}}
s
uite
.
stateDB
.
Set
(
stageKey
,
types
.
Encode
(
stages
))
s
.
stateDB
.
Set
(
stageKey
,
types
.
Encode
(
stages
))
value
,
err
:=
s
uite
.
stateDB
.
Get
(
stageKey
)
value
,
err
:=
s
.
stateDB
.
Get
(
stageKey
)
if
err
!=
nil
{
if
err
!=
nil
{
s
uite
.
T
()
.
Error
(
"get setup stages failed"
,
err
)
s
.
T
()
.
Error
(
"get setup stages failed"
,
err
)
return
return
}
}
assert
.
Equal
(
s
uite
.
T
(),
value
,
types
.
Encode
(
stages
))
assert
.
Equal
(
s
.
T
(),
value
,
types
.
Encode
(
stages
))
}
}
...
...
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