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
64ae3c14
Commit
64ae3c14
authored
Sep 12, 2019
by
mdj33
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ut comments
parent
82d134ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
ticket_test.go
plugin/dapp/ticket/wallet/ticket_test.go
+8
-6
No files found.
plugin/dapp/ticket/wallet/ticket_test.go
View file @
64ae3c14
...
@@ -12,10 +12,10 @@ import (
...
@@ -12,10 +12,10 @@ import (
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/mock"
"github.com/33cn/chain33/util/testnode"
wcom
"github.com/33cn/chain33/wallet/common"
wcom
"github.com/33cn/chain33/wallet/common"
ty
"github.com/33cn/plugin/plugin/dapp/ticket/types"
ty
"github.com/33cn/plugin/plugin/dapp/ticket/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/assert"
"github.com/33cn/chain33/util/testnode"
_
"github.com/33cn/chain33/system"
_
"github.com/33cn/chain33/system"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/types"
...
@@ -30,13 +30,15 @@ const (
...
@@ -30,13 +30,15 @@ const (
sendhash
=
"sendhash"
sendhash
=
"sendhash"
)
)
func
init
()
{
func
TestMain
(
m
*
testing
.
M
)
{
cfg
,
_
:=
testnode
.
GetDefaultConfig
()
cfg
,
_
:=
testnode
.
GetDefaultConfig
()
cfg
.
Consensus
.
Name
=
"ticket"
cfg
.
Consensus
.
Name
=
"ticket"
types
.
Init
(
cfg
.
Title
,
cfg
)
types
.
Init
(
cfg
.
Title
,
cfg
)
m
.
Run
()
}
}
func
Test
_
ForceCloseTicketList
(
t
*
testing
.
T
)
{
func
TestForceCloseTicketList
(
t
*
testing
.
T
)
{
ticket
:=
&
ticketPolicy
{
mtx
:
&
sync
.
Mutex
{}}
ticket
:=
&
ticketPolicy
{
mtx
:
&
sync
.
Mutex
{}}
ticket
.
walletOperate
=
new
(
walletOperateMock
)
ticket
.
walletOperate
=
new
(
walletOperateMock
)
...
@@ -51,7 +53,7 @@ func Test_ForceCloseTicketList(t *testing.T) {
...
@@ -51,7 +53,7 @@ func Test_ForceCloseTicketList(t *testing.T) {
}
}
func
Test
_
CloseTicketsByAddr
(
t
*
testing
.
T
)
{
func
TestCloseTicketsByAddr
(
t
*
testing
.
T
)
{
pk
,
err
:=
hex
.
DecodeString
(
"CC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944"
)
pk
,
err
:=
hex
.
DecodeString
(
"CC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944"
)
assert
.
Nil
(
t
,
err
)
assert
.
Nil
(
t
,
err
)
secp
,
err
:=
crypto
.
New
(
types
.
GetSignName
(
""
,
types
.
SECP256K1
))
secp
,
err
:=
crypto
.
New
(
types
.
GetSignName
(
""
,
types
.
SECP256K1
))
...
@@ -78,7 +80,7 @@ func Test_CloseTicketsByAddr(t *testing.T) {
...
@@ -78,7 +80,7 @@ func Test_CloseTicketsByAddr(t *testing.T) {
}
}
func
Test
_
BuyTicketOne
(
t
*
testing
.
T
)
{
func
TestBuyTicketOne
(
t
*
testing
.
T
)
{
ticket
:=
&
ticketPolicy
{
mtx
:
&
sync
.
Mutex
{}}
ticket
:=
&
ticketPolicy
{
mtx
:
&
sync
.
Mutex
{}}
ticket
.
walletOperate
=
new
(
walletOperateMock
)
ticket
.
walletOperate
=
new
(
walletOperateMock
)
...
@@ -95,7 +97,7 @@ func Test_BuyTicketOne(t *testing.T) {
...
@@ -95,7 +97,7 @@ func Test_BuyTicketOne(t *testing.T) {
}
}
func
Test
_
BuyMinerAddrTicketOne
(
t
*
testing
.
T
)
{
func
TestBuyMinerAddrTicketOne
(
t
*
testing
.
T
)
{
pk
,
err
:=
hex
.
DecodeString
(
"CC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944"
)
pk
,
err
:=
hex
.
DecodeString
(
"CC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944"
)
assert
.
Nil
(
t
,
err
)
assert
.
Nil
(
t
,
err
)
secp
,
err
:=
crypto
.
New
(
types
.
GetSignName
(
""
,
types
.
SECP256K1
))
secp
,
err
:=
crypto
.
New
(
types
.
GetSignName
(
""
,
types
.
SECP256K1
))
...
...
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