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
4b0d5e13
Commit
4b0d5e13
authored
Sep 10, 2019
by
vipwzw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto ci
parent
5da5ac2d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
dpos_test.go
plugin/consensus/dpos/dpos_test.go
+13
-14
No files found.
plugin/consensus/dpos/dpos_test.go
View file @
4b0d5e13
...
...
@@ -30,10 +30,9 @@ import (
"github.com/33cn/chain33/store"
"github.com/33cn/chain33/types"
ttypes
"github.com/33cn/plugin/plugin/consensus/dpos/types"
dty
"github.com/33cn/plugin/plugin/dapp/dposvote/types"
pty
"github.com/33cn/plugin/plugin/dapp/norm/types"
"google.golang.org/grpc"
dty
"github.com/33cn/plugin/plugin/dapp/dposvote/types"
_
"github.com/33cn/chain33/system"
_
"github.com/33cn/plugin/plugin/dapp/init"
...
...
@@ -46,7 +45,7 @@ var (
conn
*
grpc
.
ClientConn
c
types
.
Chain33Client
strPubkey
=
"03EF0E1D3112CF571743A3318125EDE2E52A4EB904BCBAA4B1F75020C2846A7EB4"
pubkey
[]
byte
pubkey
[]
byte
)
const
fee
=
1e6
...
...
@@ -105,10 +104,10 @@ func DposPerf() {
time
.
Sleep
(
1
*
time
.
Second
)
info
:=
&
dty
.
DposCBInfo
{
Cycle
:
task
.
Cycle
,
Cycle
:
task
.
Cycle
,
StopHeight
:
10
,
StopHash
:
"absadfafa"
,
Pubkey
:
strPubkey
,
StopHash
:
"absadfafa"
,
Pubkey
:
strPubkey
,
}
if
dposClient
.
csState
.
SendCBTx
(
info
)
{
fmt
.
Println
(
"sendCBTx ok"
)
...
...
@@ -126,7 +125,7 @@ func DposPerf() {
for
{
now
=
time
.
Now
()
.
Unix
()
task
=
DecideTaskByTime
(
now
)
if
now
<
task
.
CycleStart
+
(
task
.
CycleStop
-
task
.
CycleStart
)
/
2
{
if
now
<
task
.
CycleStart
+
(
task
.
CycleStop
-
task
.
CycleStart
)
/
2
{
break
}
time
.
Sleep
(
1
*
time
.
Second
)
...
...
@@ -134,8 +133,8 @@ func DposPerf() {
vrfM
:=
&
dty
.
DposVrfMRegist
{
Pubkey
:
strPubkey
,
Cycle
:
task
.
Cycle
,
M
:
"absadfafa"
,
Cycle
:
task
.
Cycle
,
M
:
"absadfafa"
,
}
if
dposClient
.
csState
.
SendRegistVrfMTx
(
vrfM
)
{
fmt
.
Println
(
"SendRegistVrfMTx ok"
)
...
...
@@ -153,16 +152,16 @@ func DposPerf() {
for
{
now
=
time
.
Now
()
.
Unix
()
task
=
DecideTaskByTime
(
now
)
if
now
>
task
.
CycleStart
+
(
task
.
CycleStop
-
task
.
CycleStart
)
/
2
{
if
now
>
task
.
CycleStart
+
(
task
.
CycleStop
-
task
.
CycleStart
)
/
2
{
break
}
time
.
Sleep
(
1
*
time
.
Second
)
}
vrfRP
:=
&
dty
.
DposVrfRPRegist
{
Pubkey
:
strPubkey
,
Cycle
:
task
.
Cycle
,
R
:
"Rabsadfafa"
,
P
:
"Pabsadfafa"
,
Cycle
:
task
.
Cycle
,
R
:
"Rabsadfafa"
,
P
:
"Pabsadfafa"
,
}
if
dposClient
.
csState
.
SendRegistVrfRPTx
(
vrfRP
)
{
fmt
.
Println
(
"SendRegistVrfRPTx ok"
)
...
...
@@ -171,7 +170,7 @@ func DposPerf() {
}
time
.
Sleep
(
2
*
time
.
Second
)
vrfInfo
,
err
=
dposClient
.
csState
.
QueryVrf
(
pubkey
,
task
.
Cycle
)
if
err
!=
nil
||
vrfInfo
==
nil
{
if
err
!=
nil
||
vrfInfo
==
nil
{
fmt
.
Println
(
"QueryVrf failed"
)
}
else
{
fmt
.
Println
(
"QueryVrf ok,"
,
vrfInfo
.
Cycle
,
"|"
,
len
(
vrfInfo
.
M
),
"|"
,
len
(
vrfInfo
.
R
),
"|"
,
len
(
vrfInfo
.
P
))
...
...
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