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
7583379c
Commit
7583379c
authored
Sep 25, 2019
by
kingwang
Committed by
vipwzw
Sep 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ticket test time
parent
ed17f184
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
13 deletions
+22
-13
chain33.cfg.toml
plugin/consensus/ticket/testdata/chain33.cfg.toml
+2
-2
ticket_test.go
plugin/consensus/ticket/ticket_test.go
+20
-11
No files found.
plugin/consensus/ticket/testdata/chain33.cfg.toml
View file @
7583379c
...
@@ -82,7 +82,7 @@ maxTxNumber = 1600
...
@@ -82,7 +82,7 @@ maxTxNumber = 1600
maxTxNumber
=
10000
maxTxNumber
=
10000
[mver.consensus.ForkChainParamV2]
[mver.consensus.ForkChainParamV2]
powLimitBits
=
"0x
1
f2fffff"
powLimitBits
=
"0x
2
f2fffff"
[mver.consensus.ForkTicketFundAddrV1]
[mver.consensus.ForkTicketFundAddrV1]
fundKeyAddr
=
"1Ji3W12KGScCM7C2p8bg635sNkayDM8MGY"
fundKeyAddr
=
"1Ji3W12KGScCM7C2p8bg635sNkayDM8MGY"
...
@@ -113,7 +113,7 @@ genesisBlockTime=1514533394
...
@@ -113,7 +113,7 @@ genesisBlockTime=1514533394
[[consensus.sub.ticket.genesis]]
[[consensus.sub.ticket.genesis]]
minerAddr
=
"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
minerAddr
=
"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
returnAddr
=
"14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"
returnAddr
=
"14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"
count
=
10
000
count
=
3
000
[[consensus.sub.ticket.genesis]]
[[consensus.sub.ticket.genesis]]
minerAddr
=
"1PUiGcbsccfxW3zuvHXZBJfznziph5miAo"
minerAddr
=
"1PUiGcbsccfxW3zuvHXZBJfznziph5miAo"
...
...
plugin/consensus/ticket/ticket_test.go
View file @
7583379c
...
@@ -8,6 +8,7 @@ import (
...
@@ -8,6 +8,7 @@ import (
"crypto/ecdsa"
"crypto/ecdsa"
"fmt"
"fmt"
"testing"
"testing"
"time"
"github.com/33cn/chain33/account"
"github.com/33cn/chain33/account"
"github.com/33cn/chain33/common/crypto"
"github.com/33cn/chain33/common/crypto"
...
@@ -68,20 +69,28 @@ func testTicket(t *testing.T) {
...
@@ -68,20 +69,28 @@ func testTicket(t *testing.T) {
status
,
err
=
mock33
.
GetAPI
()
.
GetWalletStatus
()
status
,
err
=
mock33
.
GetAPI
()
.
GetWalletStatus
()
assert
.
Nil
(
t
,
err
)
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
true
,
status
.
IsAutoMining
)
assert
.
Equal
(
t
,
true
,
status
.
IsAutoMining
)
err
=
mock33
.
WaitHeight
(
50
)
start
:=
time
.
Now
()
assert
.
Nil
(
t
,
err
)
height
:=
int64
(
0
)
//查询票是否自动close,并且购买了新的票
req
:=
&
types
.
ReqWalletTransactionList
{
Count
:
1000
}
list
,
err
:=
mock33
.
GetAPI
()
.
WalletTransactionList
(
req
)
assert
.
Nil
(
t
,
err
)
hastclose
:=
false
hastclose
:=
false
hastopen
:=
false
hastopen
:=
false
for
_
,
tx
:=
range
list
.
TxDetails
{
for
{
if
tx
.
ActionName
==
"tclose"
&&
tx
.
Receipt
.
Ty
==
2
{
height
+=
50
hastclose
=
true
err
=
mock33
.
WaitHeight
(
height
)
assert
.
Nil
(
t
,
err
)
//查询票是否自动close,并且购买了新的票
req
:=
&
types
.
ReqWalletTransactionList
{
Count
:
1000
}
list
,
err
:=
mock33
.
GetAPI
()
.
WalletTransactionList
(
req
)
assert
.
Nil
(
t
,
err
)
for
_
,
tx
:=
range
list
.
TxDetails
{
if
tx
.
ActionName
==
"tclose"
&&
tx
.
Receipt
.
Ty
==
2
{
hastclose
=
true
}
if
tx
.
ActionName
==
"topen"
&&
tx
.
Receipt
.
Ty
==
2
{
hastopen
=
true
}
}
}
if
tx
.
ActionName
==
"topen"
&&
tx
.
Receipt
.
Ty
==
2
{
if
hastopen
==
true
&&
hastclose
==
true
||
time
.
Since
(
start
)
>
100
*
time
.
Second
{
hastopen
=
true
break
}
}
}
}
assert
.
Equal
(
t
,
true
,
hastclose
)
assert
.
Equal
(
t
,
true
,
hastclose
)
...
...
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