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
24432866
Commit
24432866
authored
Nov 27, 2018
by
vipwzw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix linter
parent
e8a09f64
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
78 additions
and
78 deletions
+78
-78
blackwhite.go
plugin/dapp/blackwhite/commands/blackwhite.go
+5
-5
cert.go
plugin/dapp/cert/executor/cert.go
+2
-2
evm.go
plugin/dapp/evm/commands/evm.go
+5
-5
evm.go
plugin/dapp/evm/executor/evm.go
+1
-1
hashlock.go
plugin/dapp/hashlock/commands/hashlock.go
+3
-3
lotterydb.go
plugin/dapp/lottery/executor/lotterydb.go
+1
-1
action.go
plugin/dapp/paracross/executor/action.go
+1
-1
assettransfer_test.go
plugin/dapp/paracross/executor/assettransfer_test.go
+1
-1
assetwithdraw_test.go
plugin/dapp/paracross/executor/assetwithdraw_test.go
+1
-1
paracross.go
plugin/dapp/paracross/executor/paracross.go
+1
-1
paracross_test.go
plugin/dapp/paracross/executor/paracross_test.go
+2
-2
game.go
plugin/dapp/pokerbull/commands/game.go
+7
-7
privacy.go
plugin/dapp/privacy/commands/privacy.go
+12
-12
relay.go
plugin/dapp/relay/commands/relay.go
+6
-6
relay_test.go
plugin/dapp/relay/executor/relay_test.go
+2
-2
relaydb_test.go
plugin/dapp/relay/executor/relaydb_test.go
+6
-6
retrieve.go
plugin/dapp/retrieve/commands/retrieve.go
+5
-5
ticket.go
plugin/dapp/ticket/commands/ticket.go
+2
-2
token.go
plugin/dapp/token/commands/token.go
+5
-5
trade.go
plugin/dapp/trade/commands/trade.go
+10
-10
No files found.
plugin/dapp/blackwhite/commands/blackwhite.go
View file @
24432866
...
@@ -81,7 +81,7 @@ func blackwhiteCreate(cmd *cobra.Command, args []string) {
...
@@ -81,7 +81,7 @@ func blackwhiteCreate(cmd *cobra.Command, args []string) {
}
}
var
res
string
var
res
string
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"blackwhite.BlackwhiteCreateTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"blackwhite.BlackwhiteCreateTx"
,
params
,
&
res
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -141,7 +141,7 @@ func blackwhitePlay(cmd *cobra.Command, args []string) {
...
@@ -141,7 +141,7 @@ func blackwhitePlay(cmd *cobra.Command, args []string) {
Fee
:
feeInt64
,
Fee
:
feeInt64
,
}
}
var
res
string
var
res
string
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"blackwhite.BlackwhitePlayTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"blackwhite.BlackwhitePlayTx"
,
params
,
&
res
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -180,7 +180,7 @@ func blackwhiteShow(cmd *cobra.Command, args []string) {
...
@@ -180,7 +180,7 @@ func blackwhiteShow(cmd *cobra.Command, args []string) {
Fee
:
feeInt64
,
Fee
:
feeInt64
,
}
}
var
res
string
var
res
string
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"blackwhite.BlackwhiteShowTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"blackwhite.BlackwhiteShowTx"
,
params
,
&
res
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -213,7 +213,7 @@ func blackwhiteTimeoutDone(cmd *cobra.Command, args []string) {
...
@@ -213,7 +213,7 @@ func blackwhiteTimeoutDone(cmd *cobra.Command, args []string) {
Fee
:
feeInt64
,
Fee
:
feeInt64
,
}
}
var
res
string
var
res
string
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"blackwhite.BlackwhiteTimeoutDoneTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"blackwhite.BlackwhiteTimeoutDoneTx"
,
params
,
&
res
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -290,6 +290,6 @@ func showBlackwhiteInfo(cmd *cobra.Command, args []string) {
...
@@ -290,6 +290,6 @@ func showBlackwhiteInfo(cmd *cobra.Command, args []string) {
rep
=
&
gt
.
ReplyLoopResults
{}
rep
=
&
gt
.
ReplyLoopResults
{}
}
}
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
rep
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
rep
)
ctx
.
Run
()
ctx
.
Run
()
}
}
plugin/dapp/cert/executor/cert.go
View file @
24432866
...
@@ -97,7 +97,7 @@ func (c *Cert) loadHistoryByPrefix() error {
...
@@ -97,7 +97,7 @@ func (c *Cert) loadHistoryByPrefix() error {
Direction
:
0
,
Direction
:
0
,
Count
:
0
,
Count
:
0
,
}
}
result
,
err
:=
c
.
DriverBase
.
GetA
pi
()
.
LocalList
(
parm
)
result
,
err
:=
c
.
DriverBase
.
GetA
PI
()
.
LocalList
(
parm
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
@@ -126,7 +126,7 @@ func (c *Cert) loadHistoryByPrefix() error {
...
@@ -126,7 +126,7 @@ func (c *Cert) loadHistoryByPrefix() error {
func
(
c
*
Cert
)
loadHistoryByHeight
()
error
{
func
(
c
*
Cert
)
loadHistoryByHeight
()
error
{
key
:=
calcCertHeightKey
(
c
.
GetHeight
())
key
:=
calcCertHeightKey
(
c
.
GetHeight
())
parm
:=
&
types
.
LocalDBGet
{
Keys
:
[][]
byte
{
key
}}
parm
:=
&
types
.
LocalDBGet
{
Keys
:
[][]
byte
{
key
}}
result
,
err
:=
c
.
DriverBase
.
GetA
pi
()
.
LocalGet
(
parm
)
result
,
err
:=
c
.
DriverBase
.
GetA
PI
()
.
LocalGet
(
parm
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
...
plugin/dapp/evm/commands/evm.go
View file @
24432866
...
@@ -157,7 +157,7 @@ func evmBalance(cmd *cobra.Command, args []string) {
...
@@ -157,7 +157,7 @@ func evmBalance(cmd *cobra.Command, args []string) {
StateHash
:
""
,
StateHash
:
""
,
}
}
var
res
[]
*
rpctypes
.
Account
var
res
[]
*
rpctypes
.
Account
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.GetBalance"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.GetBalance"
,
params
,
&
res
)
ctx
.
SetResultCb
(
parseGetBalanceRes
)
ctx
.
SetResultCb
(
parseGetBalanceRes
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -234,7 +234,7 @@ func createContract(cmd *cobra.Command, args []string) {
...
@@ -234,7 +234,7 @@ func createContract(cmd *cobra.Command, args []string) {
Data
:
data
,
Data
:
data
,
}
}
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.SendTransaction"
,
params
,
nil
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.SendTransaction"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -369,7 +369,7 @@ func callContract(cmd *cobra.Command, args []string) {
...
@@ -369,7 +369,7 @@ func callContract(cmd *cobra.Command, args []string) {
Data
:
data
,
Data
:
data
,
}
}
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.SendTransaction"
,
params
,
nil
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.SendTransaction"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -594,7 +594,7 @@ func evmTransfer(cmd *cobra.Command, args []string) {
...
@@ -594,7 +594,7 @@ func evmTransfer(cmd *cobra.Command, args []string) {
Data
:
data
,
Data
:
data
,
}
}
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.SendTransaction"
,
params
,
nil
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.SendTransaction"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -642,7 +642,7 @@ func evmWithdraw(cmd *cobra.Command, args []string) {
...
@@ -642,7 +642,7 @@ func evmWithdraw(cmd *cobra.Command, args []string) {
Data
:
data
,
Data
:
data
,
}
}
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.SendTransaction"
,
params
,
nil
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.SendTransaction"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
...
plugin/dapp/evm/executor/evm.go
View file @
24432866
...
@@ -150,7 +150,7 @@ func (evm *EVMExecutor) NewEVMContext(msg *common.Message) runtime.Context {
...
@@ -150,7 +150,7 @@ func (evm *EVMExecutor) NewEVMContext(msg *common.Message) runtime.Context {
return
runtime
.
Context
{
return
runtime
.
Context
{
CanTransfer
:
CanTransfer
,
CanTransfer
:
CanTransfer
,
Transfer
:
Transfer
,
Transfer
:
Transfer
,
GetHash
:
GetHashFn
(
evm
.
GetA
pi
()),
GetHash
:
GetHashFn
(
evm
.
GetA
PI
()),
Origin
:
msg
.
From
(),
Origin
:
msg
.
From
(),
Coinbase
:
nil
,
Coinbase
:
nil
,
BlockNumber
:
new
(
big
.
Int
)
.
SetInt64
(
evm
.
GetHeight
()),
BlockNumber
:
new
(
big
.
Int
)
.
SetInt64
(
evm
.
GetHeight
()),
...
...
plugin/dapp/hashlock/commands/hashlock.go
View file @
24432866
...
@@ -93,7 +93,7 @@ func hashlockLockCmd(cmd *cobra.Command, args []string) {
...
@@ -93,7 +93,7 @@ func hashlockLockCmd(cmd *cobra.Command, args []string) {
ActionName
:
"HashlockLock"
,
ActionName
:
"HashlockLock"
,
Payload
:
payLoad
,
Payload
:
payLoad
,
}
}
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.CreateTransaction"
,
paramWithExecAction
,
nil
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.CreateTransaction"
,
paramWithExecAction
,
nil
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -136,7 +136,7 @@ func hashlockUnlockCmd(cmd *cobra.Command, args []string) {
...
@@ -136,7 +136,7 @@ func hashlockUnlockCmd(cmd *cobra.Command, args []string) {
ActionName
:
"HashlockUnlock"
,
ActionName
:
"HashlockUnlock"
,
Payload
:
payLoad
,
Payload
:
payLoad
,
}
}
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.CreateTransaction"
,
paramWithExecAction
,
nil
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.CreateTransaction"
,
paramWithExecAction
,
nil
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -171,6 +171,6 @@ func hashlockSendCmd(cmd *cobra.Command, args []string) {
...
@@ -171,6 +171,6 @@ func hashlockSendCmd(cmd *cobra.Command, args []string) {
ActionName
:
"HashlockSend"
,
ActionName
:
"HashlockSend"
,
Payload
:
payLoad
,
Payload
:
payLoad
,
}
}
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.CreateTransaction"
,
paramWithExecAction
,
nil
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.CreateTransaction"
,
paramWithExecAction
,
nil
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
plugin/dapp/lottery/executor/lotterydb.go
View file @
24432866
...
@@ -136,7 +136,7 @@ func NewLotteryAction(l *Lottery, tx *types.Transaction, index int) *Action {
...
@@ -136,7 +136,7 @@ func NewLotteryAction(l *Lottery, tx *types.Transaction, index int) *Action {
grpcClient
:=
types
.
NewChain33Client
(
conn
)
grpcClient
:=
types
.
NewChain33Client
(
conn
)
return
&
Action
{
l
.
GetCoinsAccount
(),
l
.
GetStateDB
(),
hash
,
fromaddr
,
l
.
GetBlockTime
(),
return
&
Action
{
l
.
GetCoinsAccount
(),
l
.
GetStateDB
(),
hash
,
fromaddr
,
l
.
GetBlockTime
(),
l
.
GetHeight
(),
dapp
.
ExecAddress
(
string
(
tx
.
Execer
)),
l
.
GetDifficulty
(),
l
.
GetA
pi
(),
conn
,
grpcClient
,
index
}
l
.
GetHeight
(),
dapp
.
ExecAddress
(
string
(
tx
.
Execer
)),
l
.
GetDifficulty
(),
l
.
GetA
PI
(),
conn
,
grpcClient
,
index
}
}
}
// GetReceiptLog generate logs for all lottery action
// GetReceiptLog generate logs for all lottery action
...
...
plugin/dapp/paracross/executor/action.go
View file @
24432866
...
@@ -36,7 +36,7 @@ func newAction(t *Paracross, tx *types.Transaction) *action {
...
@@ -36,7 +36,7 @@ func newAction(t *Paracross, tx *types.Transaction) *action {
hash
:=
tx
.
Hash
()
hash
:=
tx
.
Hash
()
fromaddr
:=
tx
.
From
()
fromaddr
:=
tx
.
From
()
return
&
action
{
t
.
GetCoinsAccount
(),
t
.
GetStateDB
(),
t
.
GetLocalDB
(),
hash
,
fromaddr
,
return
&
action
{
t
.
GetCoinsAccount
(),
t
.
GetStateDB
(),
t
.
GetLocalDB
(),
hash
,
fromaddr
,
t
.
GetBlockTime
(),
t
.
GetHeight
(),
dapp
.
ExecAddress
(
string
(
tx
.
Execer
)),
t
.
GetA
pi
(),
tx
,
t
}
t
.
GetBlockTime
(),
t
.
GetHeight
(),
dapp
.
ExecAddress
(
string
(
tx
.
Execer
)),
t
.
GetA
PI
(),
tx
,
t
}
}
}
func
getNodes
(
db
dbm
.
KV
,
title
string
)
(
map
[
string
]
struct
{},
error
)
{
func
getNodes
(
db
dbm
.
KV
,
title
string
)
(
map
[
string
]
struct
{},
error
)
{
...
...
plugin/dapp/paracross/executor/assettransfer_test.go
View file @
24432866
...
@@ -55,7 +55,7 @@ func (suite *AssetTransferTestSuite) SetupTest() {
...
@@ -55,7 +55,7 @@ func (suite *AssetTransferTestSuite) SetupTest() {
suite
.
exec
.
SetLocalDB
(
suite
.
localDB
)
suite
.
exec
.
SetLocalDB
(
suite
.
localDB
)
suite
.
exec
.
SetStateDB
(
suite
.
stateDB
)
suite
.
exec
.
SetStateDB
(
suite
.
stateDB
)
suite
.
exec
.
SetEnv
(
0
,
0
,
0
)
suite
.
exec
.
SetEnv
(
0
,
0
,
0
)
suite
.
exec
.
SetA
pi
(
suite
.
api
)
suite
.
exec
.
SetA
PI
(
suite
.
api
)
enableParacrossTransfer
=
true
enableParacrossTransfer
=
true
// setup block
// setup block
...
...
plugin/dapp/paracross/executor/assetwithdraw_test.go
View file @
24432866
...
@@ -50,7 +50,7 @@ func (suite *AssetWithdrawTestSuite) SetupTest() {
...
@@ -50,7 +50,7 @@ func (suite *AssetWithdrawTestSuite) SetupTest() {
suite
.
exec
.
SetLocalDB
(
suite
.
localDB
)
suite
.
exec
.
SetLocalDB
(
suite
.
localDB
)
suite
.
exec
.
SetStateDB
(
suite
.
stateDB
)
suite
.
exec
.
SetStateDB
(
suite
.
stateDB
)
suite
.
exec
.
SetEnv
(
0
,
0
,
0
)
suite
.
exec
.
SetEnv
(
0
,
0
,
0
)
suite
.
exec
.
SetA
pi
(
suite
.
api
)
suite
.
exec
.
SetA
PI
(
suite
.
api
)
enableParacrossTransfer
=
true
enableParacrossTransfer
=
true
// setup block
// setup block
...
...
plugin/dapp/paracross/executor/paracross.go
View file @
24432866
...
@@ -113,7 +113,7 @@ func (c *Paracross) saveLocalParaTxs(tx *types.Transaction, isDel bool) (*types.
...
@@ -113,7 +113,7 @@ func (c *Paracross) saveLocalParaTxs(tx *types.Transaction, isDel bool) (*types.
for
i
:=
0
;
i
<
len
(
commit
.
Status
.
CrossTxHashs
);
i
++
{
for
i
:=
0
;
i
<
len
(
commit
.
Status
.
CrossTxHashs
);
i
++
{
success
:=
util
.
BitMapBit
(
commit
.
Status
.
CrossTxResult
,
uint32
(
i
))
success
:=
util
.
BitMapBit
(
commit
.
Status
.
CrossTxResult
,
uint32
(
i
))
paraTx
,
err
:=
GetTx
(
c
.
GetA
pi
(),
commit
.
Status
.
CrossTxHashs
[
i
])
paraTx
,
err
:=
GetTx
(
c
.
GetA
PI
(),
commit
.
Status
.
CrossTxHashs
[
i
])
if
err
!=
nil
{
if
err
!=
nil
{
clog
.
Crit
(
"paracross.Commit Load Tx failed"
,
"para title"
,
commit
.
Status
.
Title
,
clog
.
Crit
(
"paracross.Commit Load Tx failed"
,
"para title"
,
commit
.
Status
.
Title
,
"para height"
,
commit
.
Status
.
Height
,
"para tx index"
,
i
,
"error"
,
err
,
"txHash"
,
"para height"
,
commit
.
Status
.
Height
,
"para tx index"
,
i
,
"error"
,
err
,
"txHash"
,
...
...
plugin/dapp/paracross/executor/paracross_test.go
View file @
24432866
...
@@ -103,7 +103,7 @@ func (suite *CommitTestSuite) SetupSuite() {
...
@@ -103,7 +103,7 @@ func (suite *CommitTestSuite) SetupSuite() {
suite
.
exec
.
SetLocalDB
(
suite
.
localDB
)
suite
.
exec
.
SetLocalDB
(
suite
.
localDB
)
suite
.
exec
.
SetStateDB
(
suite
.
stateDB
)
suite
.
exec
.
SetStateDB
(
suite
.
stateDB
)
suite
.
exec
.
SetEnv
(
0
,
0
,
0
)
suite
.
exec
.
SetEnv
(
0
,
0
,
0
)
suite
.
exec
.
SetA
pi
(
suite
.
api
)
suite
.
exec
.
SetA
PI
(
suite
.
api
)
enableParacrossTransfer
=
false
enableParacrossTransfer
=
false
// TODO, more fields
// TODO, more fields
...
@@ -355,7 +355,7 @@ func TestCrossLimits(t *testing.T) {
...
@@ -355,7 +355,7 @@ func TestCrossLimits(t *testing.T) {
exec.SetLocalDB(localDB)
exec.SetLocalDB(localDB)
exec.SetStateDB(stateDB)
exec.SetStateDB(stateDB)
exec.SetEnv(0, 0, 0)
exec.SetEnv(0, 0, 0)
exec.SetA
pi
(api)
exec.SetA
PI
(api)
tx := &types.Transaction{Execer: []byte("p.user.test.paracross")}
tx := &types.Transaction{Execer: []byte("p.user.test.paracross")}
...
...
plugin/dapp/pokerbull/commands/game.go
View file @
24432866
...
@@ -67,7 +67,7 @@ func pokerbullStart(cmd *cobra.Command, args []string) {
...
@@ -67,7 +67,7 @@ func pokerbullStart(cmd *cobra.Command, args []string) {
}
}
var
res
string
var
res
string
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"pokerbull.PokerBullStartTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"pokerbull.PokerBullStartTx"
,
params
,
&
res
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -100,7 +100,7 @@ func pokerbullContinue(cmd *cobra.Command, args []string) {
...
@@ -100,7 +100,7 @@ func pokerbullContinue(cmd *cobra.Command, args []string) {
}
}
var
res
string
var
res
string
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"pokerbull.PokerBullContinueTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"pokerbull.PokerBullContinueTx"
,
params
,
&
res
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -133,7 +133,7 @@ func pokerbullQuit(cmd *cobra.Command, args []string) {
...
@@ -133,7 +133,7 @@ func pokerbullQuit(cmd *cobra.Command, args []string) {
}
}
var
res
string
var
res
string
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"pokerbull.PokerBullQuitTx"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"pokerbull.PokerBullQuitTx"
,
params
,
&
res
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -178,17 +178,17 @@ func pokerbullQuery(cmd *cobra.Command, args []string) {
...
@@ -178,17 +178,17 @@ func pokerbullQuery(cmd *cobra.Command, args []string) {
if
gameID
!=
""
{
if
gameID
!=
""
{
params
.
FuncName
=
pkt
.
FuncNameQueryGameByID
params
.
FuncName
=
pkt
.
FuncNameQueryGameByID
var
res
pkt
.
ReplyPBGame
var
res
pkt
.
ReplyPBGame
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
}
else
if
address
!=
""
{
}
else
if
address
!=
""
{
params
.
FuncName
=
pkt
.
FuncNameQueryGameByAddr
params
.
FuncName
=
pkt
.
FuncNameQueryGameByAddr
var
res
pkt
.
PBGameRecords
var
res
pkt
.
PBGameRecords
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
}
else
if
statusStr
!=
""
{
}
else
if
statusStr
!=
""
{
params
.
FuncName
=
pkt
.
FuncNameQueryGameByStatus
params
.
FuncName
=
pkt
.
FuncNameQueryGameByStatus
var
res
pkt
.
PBGameRecords
var
res
pkt
.
PBGameRecords
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
}
else
if
gameIDs
!=
""
{
}
else
if
gameIDs
!=
""
{
params
.
FuncName
=
pkt
.
FuncNameQueryGameListByIDs
params
.
FuncName
=
pkt
.
FuncNameQueryGameListByIDs
...
@@ -198,7 +198,7 @@ func pokerbullQuery(cmd *cobra.Command, args []string) {
...
@@ -198,7 +198,7 @@ func pokerbullQuery(cmd *cobra.Command, args []string) {
req
:=
&
pkt
.
QueryPBGameInfos
{
GameIds
:
gameIDsS
}
req
:=
&
pkt
.
QueryPBGameInfos
{
GameIds
:
gameIDsS
}
params
.
Payload
=
req
params
.
Payload
=
req
var
res
pkt
.
ReplyPBGameList
var
res
pkt
.
ReplyPBGameList
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
}
else
{
}
else
{
fmt
.
Println
(
"Error: requeres at least one of gameID, address or status"
)
fmt
.
Println
(
"Error: requeres at least one of gameID, address or status"
)
...
...
plugin/dapp/privacy/commands/privacy.go
View file @
24432866
...
@@ -74,7 +74,7 @@ func showPrivacyKey(cmd *cobra.Command, args []string) {
...
@@ -74,7 +74,7 @@ func showPrivacyKey(cmd *cobra.Command, args []string) {
Data
:
addr
,
Data
:
addr
,
}
}
var
res
pty
.
ReplyPrivacyPkPair
var
res
pty
.
ReplyPrivacyPkPair
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"privacy.ShowPrivacykey"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"privacy.ShowPrivacykey"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -138,7 +138,7 @@ func public2Privacy(cmd *cobra.Command, args []string) {
...
@@ -138,7 +138,7 @@ func public2Privacy(cmd *cobra.Command, args []string) {
}
}
var
res
rpctypes
.
ReplyHash
var
res
rpctypes
.
ReplyHash
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"privacy.MakeTxPublic2privacy"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"privacy.MakeTxPublic2privacy"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -204,7 +204,7 @@ func privacy2Privacy(cmd *cobra.Command, args []string) {
...
@@ -204,7 +204,7 @@ func privacy2Privacy(cmd *cobra.Command, args []string) {
}
}
var
res
rpctypes
.
ReplyHash
var
res
rpctypes
.
ReplyHash
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"privacy.MakeTxPrivacy2privacy"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"privacy.MakeTxPrivacy2privacy"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -271,7 +271,7 @@ func privacy2Public(cmd *cobra.Command, args []string) {
...
@@ -271,7 +271,7 @@ func privacy2Public(cmd *cobra.Command, args []string) {
}
}
var
res
rpctypes
.
ReplyHash
var
res
rpctypes
.
ReplyHash
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"privacy.MakeTxPrivacy2public"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"privacy.MakeTxPrivacy2public"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -300,7 +300,7 @@ func showPrivacyAccountSpend(cmd *cobra.Command, args []string) {
...
@@ -300,7 +300,7 @@ func showPrivacyAccountSpend(cmd *cobra.Command, args []string) {
}
}
var
res
pty
.
UTXOHaveTxHashs
var
res
pty
.
UTXOHaveTxHashs
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"privacy.ShowPrivacyAccountSpend"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"privacy.ShowPrivacyAccountSpend"
,
params
,
&
res
)
ctx
.
SetResultCb
(
parseShowPrivacyAccountSpendRes
)
ctx
.
SetResultCb
(
parseShowPrivacyAccountSpendRes
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -370,7 +370,7 @@ func showAmountOfUTXO(cmd *cobra.Command, args []string) {
...
@@ -370,7 +370,7 @@ func showAmountOfUTXO(cmd *cobra.Command, args []string) {
params
.
Payload
=
reqPrivacyToken
params
.
Payload
=
reqPrivacyToken
var
res
pty
.
ReplyPrivacyAmounts
var
res
pty
.
ReplyPrivacyAmounts
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
SetResultCb
(
parseShowAmountOfUTXORes
)
ctx
.
SetResultCb
(
parseShowAmountOfUTXORes
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -413,7 +413,7 @@ func showUTXOs4SpecifiedAmount(cmd *cobra.Command, args []string) {
...
@@ -413,7 +413,7 @@ func showUTXOs4SpecifiedAmount(cmd *cobra.Command, args []string) {
params
.
Payload
=
reqPrivacyToken
params
.
Payload
=
reqPrivacyToken
var
res
pty
.
ReplyUTXOsOfAmount
var
res
pty
.
ReplyUTXOsOfAmount
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
SetResultCb
(
parseShowUTXOs4SpecifiedAmountRes
)
ctx
.
SetResultCb
(
parseShowUTXOs4SpecifiedAmountRes
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -479,7 +479,7 @@ func createUTXOs(cmd *cobra.Command, args []string) {
...
@@ -479,7 +479,7 @@ func createUTXOs(cmd *cobra.Command, args []string) {
}
}
var
res
rpctypes
.
ReplyHash
var
res
rpctypes
.
ReplyHash
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"privacy.CreateUTXOs"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"privacy.CreateUTXOs"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -519,7 +519,7 @@ func showPrivacyAccountInfo(cmd *cobra.Command, args []string) {
...
@@ -519,7 +519,7 @@ func showPrivacyAccountInfo(cmd *cobra.Command, args []string) {
}
}
var
res
pty
.
ReplyPrivacyAccount
var
res
pty
.
ReplyPrivacyAccount
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"privacy.ShowPrivacyAccountInfo"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"privacy.ShowPrivacyAccountInfo"
,
params
,
&
res
)
ctx
.
SetResultCb
(
parseshowPrivacyAccountInfo
)
ctx
.
SetResultCb
(
parseshowPrivacyAccountInfo
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -612,7 +612,7 @@ func listPrivacyTxsFlags(cmd *cobra.Command, args []string) {
...
@@ -612,7 +612,7 @@ func listPrivacyTxsFlags(cmd *cobra.Command, args []string) {
Seedtxhash
:
[]
byte
(
seedtxhash
),
Seedtxhash
:
[]
byte
(
seedtxhash
),
}
}
var
res
rpctypes
.
WalletTxDetails
var
res
rpctypes
.
WalletTxDetails
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"privacy.PrivacyTxList"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"privacy.PrivacyTxList"
,
params
,
&
res
)
ctx
.
SetResultCb
(
parseWalletTxListRes
)
ctx
.
SetResultCb
(
parseWalletTxListRes
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -671,7 +671,7 @@ func rescanUtxosOpt(cmd *cobra.Command, args []string) {
...
@@ -671,7 +671,7 @@ func rescanUtxosOpt(cmd *cobra.Command, args []string) {
}
}
var
res
pty
.
RepRescanUtxos
var
res
pty
.
RepRescanUtxos
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"privacy.RescanUtxos"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"privacy.RescanUtxos"
,
params
,
&
res
)
ctx
.
SetResultCb
(
parseRescanUtxosOpt
)
ctx
.
SetResultCb
(
parseRescanUtxosOpt
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -726,7 +726,7 @@ func enablePrivacy(cmd *cobra.Command, args []string) {
...
@@ -726,7 +726,7 @@ func enablePrivacy(cmd *cobra.Command, args []string) {
}
}
var
res
pty
.
RepEnablePrivacy
var
res
pty
.
RepEnablePrivacy
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"privacy.EnablePrivacy"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"privacy.EnablePrivacy"
,
params
,
&
res
)
ctx
.
SetResultCb
(
parseEnablePrivacy
)
ctx
.
SetResultCb
(
parseEnablePrivacy
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
...
plugin/dapp/relay/commands/relay.go
View file @
24432866
...
@@ -398,7 +398,7 @@ func relayOrder(cmd *cobra.Command, args []string) {
...
@@ -398,7 +398,7 @@ func relayOrder(cmd *cobra.Command, args []string) {
}
}
var
res
string
var
res
string
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"relay.CreateRawRelayOrderTx"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"relay.CreateRawRelayOrderTx"
,
params
,
&
res
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -441,7 +441,7 @@ func relayAccept(cmd *cobra.Command, args []string) {
...
@@ -441,7 +441,7 @@ func relayAccept(cmd *cobra.Command, args []string) {
CoinWaits
:
coinwait
,
CoinWaits
:
coinwait
,
}
}
var
res
string
var
res
string
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"relay.CreateRawRelayAcceptTx"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"relay.CreateRawRelayAcceptTx"
,
params
,
&
res
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -481,7 +481,7 @@ func relayRevoke(cmd *cobra.Command, args []string) {
...
@@ -481,7 +481,7 @@ func relayRevoke(cmd *cobra.Command, args []string) {
Action
:
act
,
Action
:
act
,
}
}
var
res
string
var
res
string
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"relay.CreateRawRelayRevokeTx"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"relay.CreateRawRelayRevokeTx"
,
params
,
&
res
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -516,7 +516,7 @@ func relayConfirm(cmd *cobra.Command, args []string) {
...
@@ -516,7 +516,7 @@ func relayConfirm(cmd *cobra.Command, args []string) {
TxHash
:
txHash
,
TxHash
:
txHash
,
}
}
var
res
string
var
res
string
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"relay.CreateRawRelayConfirmTx"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"relay.CreateRawRelayConfirmTx"
,
params
,
&
res
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -566,7 +566,7 @@ func relaySaveBtcHead(cmd *cobra.Command, args []string) {
...
@@ -566,7 +566,7 @@ func relaySaveBtcHead(cmd *cobra.Command, args []string) {
}
}
var
res
string
var
res
string
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"relay.CreateRawRelaySaveBTCHeadTx"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"relay.CreateRawRelaySaveBTCHeadTx"
,
params
,
&
res
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -617,6 +617,6 @@ func relayVerifyBTC(cmd *cobra.Command, args []string) {
...
@@ -617,6 +617,6 @@ func relayVerifyBTC(cmd *cobra.Command, args []string) {
}
}
var
res
string
var
res
string
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"relay.CreateRawRelayVerifyBTCTx"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"relay.CreateRawRelayVerifyBTCTx"
,
params
,
&
res
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
plugin/dapp/relay/executor/relay_test.go
View file @
24432866
...
@@ -74,7 +74,7 @@ func (s *suiteRelay) SetupSuite() {
...
@@ -74,7 +74,7 @@ func (s *suiteRelay) SetupSuite() {
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetIsFree
(
false
)
relay
.
SetIsFree
(
false
)
relay
.
SetA
pi
(
nil
)
relay
.
SetA
PI
(
nil
)
relay
.
SetChild
(
relay
)
relay
.
SetChild
(
relay
)
relay
.
SetExecutorType
(
types
.
LoadExecutorType
(
driverName
))
relay
.
SetExecutorType
(
types
.
LoadExecutorType
(
driverName
))
s
.
relay
=
relay
s
.
relay
=
relay
...
@@ -406,7 +406,7 @@ func (s *suiteBtcHeader) SetupSuite() {
...
@@ -406,7 +406,7 @@ func (s *suiteBtcHeader) SetupSuite() {
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetIsFree
(
false
)
relay
.
SetIsFree
(
false
)
relay
.
SetA
pi
(
nil
)
relay
.
SetA
PI
(
nil
)
relay
.
SetChild
(
relay
)
relay
.
SetChild
(
relay
)
relay
.
SetExecutorType
(
types
.
LoadExecutorType
(
driverName
))
relay
.
SetExecutorType
(
types
.
LoadExecutorType
(
driverName
))
s
.
relay
=
relay
s
.
relay
=
relay
...
...
plugin/dapp/relay/executor/relaydb_test.go
View file @
24432866
...
@@ -154,7 +154,7 @@ func (s *suiteRelayDB) SetupSuite() {
...
@@ -154,7 +154,7 @@ func (s *suiteRelayDB) SetupSuite() {
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetIsFree
(
false
)
relay
.
SetIsFree
(
false
)
relay
.
SetA
pi
(
nil
)
relay
.
SetA
PI
(
nil
)
relay
.
SetChild
(
relay
)
relay
.
SetChild
(
relay
)
s
.
relay
=
relay
s
.
relay
=
relay
...
@@ -337,7 +337,7 @@ func (s *suiteAccept) SetupSuite() {
...
@@ -337,7 +337,7 @@ func (s *suiteAccept) SetupSuite() {
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetIsFree
(
false
)
relay
.
SetIsFree
(
false
)
relay
.
SetA
pi
(
nil
)
relay
.
SetA
PI
(
nil
)
relay
.
SetChild
(
relay
)
relay
.
SetChild
(
relay
)
s
.
relay
=
relay
s
.
relay
=
relay
...
@@ -535,7 +535,7 @@ func (s *suiteConfirm) SetupSuite() {
...
@@ -535,7 +535,7 @@ func (s *suiteConfirm) SetupSuite() {
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetIsFree
(
false
)
relay
.
SetIsFree
(
false
)
relay
.
SetA
pi
(
nil
)
relay
.
SetA
PI
(
nil
)
relay
.
SetChild
(
relay
)
relay
.
SetChild
(
relay
)
s
.
relay
=
relay
s
.
relay
=
relay
...
@@ -824,7 +824,7 @@ func (s *suiteVerify) SetupSuite() {
...
@@ -824,7 +824,7 @@ func (s *suiteVerify) SetupSuite() {
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetIsFree
(
false
)
relay
.
SetIsFree
(
false
)
relay
.
SetA
pi
(
nil
)
relay
.
SetA
PI
(
nil
)
relay
.
SetChild
(
relay
)
relay
.
SetChild
(
relay
)
s
.
relay
=
relay
s
.
relay
=
relay
...
@@ -1055,7 +1055,7 @@ func (s *suiteVerifyCli) SetupSuite() {
...
@@ -1055,7 +1055,7 @@ func (s *suiteVerifyCli) SetupSuite() {
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetIsFree
(
false
)
relay
.
SetIsFree
(
false
)
relay
.
SetA
pi
(
nil
)
relay
.
SetA
PI
(
nil
)
relay
.
SetChild
(
relay
)
relay
.
SetChild
(
relay
)
s
.
relay
=
relay
s
.
relay
=
relay
...
@@ -1130,7 +1130,7 @@ func (s *suiteSaveBtcHeader) SetupSuite() {
...
@@ -1130,7 +1130,7 @@ func (s *suiteSaveBtcHeader) SetupSuite() {
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetIsFree
(
false
)
relay
.
SetIsFree
(
false
)
relay
.
SetA
pi
(
nil
)
relay
.
SetA
PI
(
nil
)
relay
.
SetChild
(
relay
)
relay
.
SetChild
(
relay
)
s
.
relay
=
relay
s
.
relay
=
relay
...
...
plugin/dapp/retrieve/commands/retrieve.go
View file @
24432866
...
@@ -81,7 +81,7 @@ func backupCmd(cmd *cobra.Command, args []string) {
...
@@ -81,7 +81,7 @@ func backupCmd(cmd *cobra.Command, args []string) {
DelayPeriod
:
delay
,
DelayPeriod
:
delay
,
Fee
:
feeInt64
,
Fee
:
feeInt64
,
}
}
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"retrieve.CreateRawRetrieveBackupTx"
,
params
,
nil
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"retrieve.CreateRawRetrieveBackupTx"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -118,7 +118,7 @@ func prepareCmd(cmd *cobra.Command, args []string) {
...
@@ -118,7 +118,7 @@ func prepareCmd(cmd *cobra.Command, args []string) {
DefaultAddr
:
defaultAddr
,
DefaultAddr
:
defaultAddr
,
Fee
:
feeInt64
,
Fee
:
feeInt64
,
}
}
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"retrieve.CreateRawRetrievePrepareTx"
,
params
,
nil
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"retrieve.CreateRawRetrievePrepareTx"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -145,7 +145,7 @@ func performCmd(cmd *cobra.Command, args []string) {
...
@@ -145,7 +145,7 @@ func performCmd(cmd *cobra.Command, args []string) {
DefaultAddr
:
defaultAddr
,
DefaultAddr
:
defaultAddr
,
Fee
:
feeInt64
,
Fee
:
feeInt64
,
}
}
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"retrieve.CreateRawRetrievePerformTx"
,
params
,
nil
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"retrieve.CreateRawRetrievePerformTx"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -172,7 +172,7 @@ func cancelCmd(cmd *cobra.Command, args []string) {
...
@@ -172,7 +172,7 @@ func cancelCmd(cmd *cobra.Command, args []string) {
DefaultAddr
:
defaultAddr
,
DefaultAddr
:
defaultAddr
,
Fee
:
feeInt64
,
Fee
:
feeInt64
,
}
}
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"retrieve.CreateRawRetrieveCancelTx"
,
params
,
nil
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"retrieve.CreateRawRetrieveCancelTx"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -232,7 +232,7 @@ func queryRetrieveCmd(cmd *cobra.Command, args []string) {
...
@@ -232,7 +232,7 @@ func queryRetrieveCmd(cmd *cobra.Command, args []string) {
params
.
Payload
=
req
params
.
Payload
=
req
var
res
rt
.
RetrieveQuery
var
res
rt
.
RetrieveQuery
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
SetResultCb
(
parseRerieveDetail
)
ctx
.
SetResultCb
(
parseRerieveDetail
)
ctx
.
Run
()
ctx
.
Run
()
}
}
plugin/dapp/ticket/commands/ticket.go
View file @
24432866
...
@@ -91,7 +91,7 @@ func CountTicketCmd() *cobra.Command {
...
@@ -91,7 +91,7 @@ func CountTicketCmd() *cobra.Command {
func
countTicket
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
func
countTicket
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
rpcLaddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr"
)
rpcLaddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr"
)
var
res
int64
var
res
int64
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"ticket.GetTicketCount"
,
nil
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"ticket.GetTicketCount"
,
nil
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -188,6 +188,6 @@ func coldAddressOfMiner(cmd *cobra.Command, args []string) {
...
@@ -188,6 +188,6 @@ func coldAddressOfMiner(cmd *cobra.Command, args []string) {
params
.
Payload
=
reqaddr
params
.
Payload
=
reqaddr
var
res
types
.
ReplyStrings
var
res
types
.
ReplyStrings
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
}
}
plugin/dapp/token/commands/token.go
View file @
24432866
...
@@ -255,7 +255,7 @@ func tokenAssets(cmd *cobra.Command, args []string) {
...
@@ -255,7 +255,7 @@ func tokenAssets(cmd *cobra.Command, args []string) {
params
.
Payload
=
req
params
.
Payload
=
req
var
res
tokenty
.
ReplyAccountTokenAssets
var
res
tokenty
.
ReplyAccountTokenAssets
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
SetResultCb
(
parseTokenAssetsRes
)
ctx
.
SetResultCb
(
parseTokenAssetsRes
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -314,7 +314,7 @@ func tokenBalance(cmd *cobra.Command, args []string) {
...
@@ -314,7 +314,7 @@ func tokenBalance(cmd *cobra.Command, args []string) {
Execer
:
execer
,
Execer
:
execer
,
}
}
var
res
[]
*
rpctypes
.
Account
var
res
[]
*
rpctypes
.
Account
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"token.GetTokenBalance"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"token.GetTokenBalance"
,
params
,
&
res
)
ctx
.
SetResultCb
(
parseTokenBalanceRes
)
ctx
.
SetResultCb
(
parseTokenBalanceRes
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -388,7 +388,7 @@ func tokenPrecreated(cmd *cobra.Command, args []string) {
...
@@ -388,7 +388,7 @@ func tokenPrecreated(cmd *cobra.Command, args []string) {
Owner
:
ownerAddr
,
Owner
:
ownerAddr
,
Total
:
total
*
types
.
TokenPrecision
,
Total
:
total
*
types
.
TokenPrecision
,
}
}
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"token.CreateRawTokenPreCreateTx"
,
params
,
nil
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"token.CreateRawTokenPreCreateTx"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -422,7 +422,7 @@ func tokenFinish(cmd *cobra.Command, args []string) {
...
@@ -422,7 +422,7 @@ func tokenFinish(cmd *cobra.Command, args []string) {
Owner
:
ownerAddr
,
Owner
:
ownerAddr
,
}
}
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"token.CreateRawTokenFinishTx"
,
params
,
nil
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"token.CreateRawTokenFinishTx"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -457,6 +457,6 @@ func tokenRevoke(cmd *cobra.Command, args []string) {
...
@@ -457,6 +457,6 @@ func tokenRevoke(cmd *cobra.Command, args []string) {
Owner
:
ownerAddr
,
Owner
:
ownerAddr
,
}
}
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"token.CreateRawTokenRevokeTx"
,
params
,
nil
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"token.CreateRawTokenRevokeTx"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
plugin/dapp/trade/commands/trade.go
View file @
24432866
...
@@ -77,7 +77,7 @@ func showOnesSellOrders(cmd *cobra.Command, args []string) {
...
@@ -77,7 +77,7 @@ func showOnesSellOrders(cmd *cobra.Command, args []string) {
Payload
:
reqAddrtokens
,
Payload
:
reqAddrtokens
,
}
}
var
res
pty
.
ReplySellOrders
var
res
pty
.
ReplySellOrders
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
SetResultCb
(
parseSellOrders
)
ctx
.
SetResultCb
(
parseSellOrders
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -118,7 +118,7 @@ func showOnesSellOrdersStatus(cmd *cobra.Command, args []string) {
...
@@ -118,7 +118,7 @@ func showOnesSellOrdersStatus(cmd *cobra.Command, args []string) {
params
.
FuncName
=
"GetOnesSellOrderWithStatus"
params
.
FuncName
=
"GetOnesSellOrderWithStatus"
params
.
Payload
=
reqAddrtokens
params
.
Payload
=
reqAddrtokens
var
res
pty
.
ReplySellOrders
var
res
pty
.
ReplySellOrders
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
SetResultCb
(
parseSellOrders
)
ctx
.
SetResultCb
(
parseSellOrders
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -171,7 +171,7 @@ func showTokenSellOrdersStatus(cmd *cobra.Command, args []string) {
...
@@ -171,7 +171,7 @@ func showTokenSellOrdersStatus(cmd *cobra.Command, args []string) {
params
.
FuncName
=
"GetTokenSellOrderByStatus"
params
.
FuncName
=
"GetTokenSellOrderByStatus"
params
.
Payload
=
req
params
.
Payload
=
req
var
res
pty
.
ReplySellOrders
var
res
pty
.
ReplySellOrders
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
SetResultCb
(
parseSellOrders
)
ctx
.
SetResultCb
(
parseSellOrders
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -234,7 +234,7 @@ func showOnesBuyOrders(cmd *cobra.Command, args []string) {
...
@@ -234,7 +234,7 @@ func showOnesBuyOrders(cmd *cobra.Command, args []string) {
params
.
FuncName
=
"GetOnesBuyOrder"
params
.
FuncName
=
"GetOnesBuyOrder"
params
.
Payload
=
reqAddrtokens
params
.
Payload
=
reqAddrtokens
var
res
pty
.
ReplyBuyOrders
var
res
pty
.
ReplyBuyOrders
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
SetResultCb
(
parseBuyOrders
)
ctx
.
SetResultCb
(
parseBuyOrders
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -274,7 +274,7 @@ func showOnesBuyOrdersStatus(cmd *cobra.Command, args []string) {
...
@@ -274,7 +274,7 @@ func showOnesBuyOrdersStatus(cmd *cobra.Command, args []string) {
params
.
FuncName
=
"GetOnesBuyOrderWithStatus"
params
.
FuncName
=
"GetOnesBuyOrderWithStatus"
params
.
Payload
=
reqAddrtokens
params
.
Payload
=
reqAddrtokens
var
res
pty
.
ReplyBuyOrders
var
res
pty
.
ReplyBuyOrders
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
SetResultCb
(
parseBuyOrders
)
ctx
.
SetResultCb
(
parseBuyOrders
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -327,7 +327,7 @@ func showTokenBuyOrdersStatus(cmd *cobra.Command, args []string) {
...
@@ -327,7 +327,7 @@ func showTokenBuyOrdersStatus(cmd *cobra.Command, args []string) {
params
.
FuncName
=
"GetTokenBuyOrderByStatus"
params
.
FuncName
=
"GetTokenBuyOrderByStatus"
params
.
Payload
=
req
params
.
Payload
=
req
var
res
pty
.
ReplyBuyOrders
var
res
pty
.
ReplyBuyOrders
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
SetResultCb
(
parseBuyOrders
)
ctx
.
SetResultCb
(
parseBuyOrders
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -401,7 +401,7 @@ func showOnesOrdersStatus(cmd *cobra.Command, args []string) {
...
@@ -401,7 +401,7 @@ func showOnesOrdersStatus(cmd *cobra.Command, args []string) {
params
.
FuncName
=
"GetOnesOrderWithStatus"
params
.
FuncName
=
"GetOnesOrderWithStatus"
params
.
Payload
=
reqAddrtokens
params
.
Payload
=
reqAddrtokens
var
res
pty
.
ReplyTradeOrders
var
res
pty
.
ReplyTradeOrders
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
SetResultCb
(
parseTradeOrders
)
ctx
.
SetResultCb
(
parseTradeOrders
)
ctx
.
Run
()
ctx
.
Run
()
}
}
...
@@ -482,7 +482,7 @@ func tokenSell(cmd *cobra.Command, args []string) {
...
@@ -482,7 +482,7 @@ func tokenSell(cmd *cobra.Command, args []string) {
AssetExec
:
"token"
,
AssetExec
:
"token"
,
}
}
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"trade.CreateRawTradeSellTx"
,
params
,
nil
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"trade.CreateRawTradeSellTx"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -518,7 +518,7 @@ func tokenBuy(cmd *cobra.Command, args []string) {
...
@@ -518,7 +518,7 @@ func tokenBuy(cmd *cobra.Command, args []string) {
Fee
:
feeInt64
*
1e4
,
Fee
:
feeInt64
*
1e4
,
}
}
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"trade.CreateRawTradeBuyTx"
,
params
,
nil
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"trade.CreateRawTradeBuyTx"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
...
@@ -551,6 +551,6 @@ func tokenSellRevoke(cmd *cobra.Command, args []string) {
...
@@ -551,6 +551,6 @@ func tokenSellRevoke(cmd *cobra.Command, args []string) {
Fee
:
feeInt64
*
1e4
,
Fee
:
feeInt64
*
1e4
,
}
}
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"trade.CreateRawTradeRevokeTx"
,
params
,
nil
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"trade.CreateRawTradeRevokeTx"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
ctx
.
RunWithoutMarshal
()
}
}
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