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
76b18411
Commit
76b18411
authored
Mar 08, 2019
by
vipwzw
Committed by
33cn
Mar 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix send failed
parent
ec0aee82
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
ticket_test.go
plugin/consensus/ticket/ticket_test.go
+7
-2
statedb.go
vendor/github.com/33cn/chain33/executor/statedb.go
+4
-1
testnode.go
vendor/github.com/33cn/chain33/util/testnode/testnode.go
+9
-0
No files found.
plugin/consensus/ticket/ticket_test.go
View file @
76b18411
...
@@ -21,8 +21,13 @@ import (
...
@@ -21,8 +21,13 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/assert"
)
)
// 执行: go test -cover
func
TestTicket
(
t
*
testing
.
T
)
{
func
TestTicket
(
t
*
testing
.
T
)
{
for
i
:=
0
;
i
<
10
;
i
++
{
testTicket
(
t
)
}
}
func
testTicket
(
t
*
testing
.
T
)
{
mock33
:=
testnode
.
New
(
"testdata/chain33.cfg.toml"
,
nil
)
mock33
:=
testnode
.
New
(
"testdata/chain33.cfg.toml"
,
nil
)
defer
mock33
.
Close
()
defer
mock33
.
Close
()
mock33
.
Listen
()
mock33
.
Listen
()
...
@@ -61,7 +66,7 @@ func TestTicket(t *testing.T) {
...
@@ -61,7 +66,7 @@ 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
(
10
0
)
err
=
mock33
.
WaitHeight
(
5
0
)
assert
.
Nil
(
t
,
err
)
assert
.
Nil
(
t
,
err
)
//查询票是否自动close,并且购买了新的票
//查询票是否自动close,并且购买了新的票
req
:=
&
types
.
ReqWalletTransactionList
{
Count
:
1000
}
req
:=
&
types
.
ReqWalletTransactionList
{
Count
:
1000
}
...
...
vendor/github.com/33cn/chain33/executor/statedb.go
View file @
76b18411
...
@@ -128,7 +128,10 @@ func (s *StateDB) get(key []byte) ([]byte, error) {
...
@@ -128,7 +128,10 @@ func (s *StateDB) get(key []byte) ([]byte, error) {
}
}
query
:=
&
types
.
StoreGet
{
StateHash
:
s
.
stateHash
,
Keys
:
[][]
byte
{
key
}}
query
:=
&
types
.
StoreGet
{
StateHash
:
s
.
stateHash
,
Keys
:
[][]
byte
{
key
}}
msg
:=
s
.
client
.
NewMessage
(
"store"
,
types
.
EventStoreGet
,
query
)
msg
:=
s
.
client
.
NewMessage
(
"store"
,
types
.
EventStoreGet
,
query
)
s
.
client
.
Send
(
msg
,
true
)
err
:=
s
.
client
.
Send
(
msg
,
true
)
if
err
!=
nil
{
return
nil
,
err
}
resp
,
err
:=
s
.
client
.
Wait
(
msg
)
resp
,
err
:=
s
.
client
.
Wait
(
msg
)
if
err
!=
nil
{
if
err
!=
nil
{
panic
(
err
)
//no happen for ever
panic
(
err
)
//no happen for ever
...
...
vendor/github.com/33cn/chain33/util/testnode/testnode.go
View file @
76b18411
...
@@ -289,14 +289,23 @@ func (mock *Chain33Mock) Close() {
...
@@ -289,14 +289,23 @@ func (mock *Chain33Mock) Close() {
}
}
func
(
mock
*
Chain33Mock
)
closeNoLock
()
{
func
(
mock
*
Chain33Mock
)
closeNoLock
()
{
lognode
.
Info
(
"network close"
)
mock
.
network
.
Close
()
mock
.
network
.
Close
()
lognode
.
Info
(
"network close"
)
mock
.
rpc
.
Close
()
mock
.
rpc
.
Close
()
lognode
.
Info
(
"rpc close"
)
mock
.
mem
.
Close
()
mock
.
mem
.
Close
()
lognode
.
Info
(
"mem close"
)
mock
.
exec
.
Close
()
mock
.
exec
.
Close
()
lognode
.
Info
(
"exec close"
)
mock
.
cs
.
Close
()
mock
.
cs
.
Close
()
lognode
.
Info
(
"cs close"
)
mock
.
wallet
.
Close
()
mock
.
wallet
.
Close
()
lognode
.
Info
(
"wallet close"
)
mock
.
chain
.
Close
()
mock
.
chain
.
Close
()
lognode
.
Info
(
"chain close"
)
mock
.
store
.
Close
()
mock
.
store
.
Close
()
lognode
.
Info
(
"store close"
)
mock
.
client
.
Close
()
mock
.
client
.
Close
()
os
.
RemoveAll
(
mock
.
datadir
)
os
.
RemoveAll
(
mock
.
datadir
)
}
}
...
...
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