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) {
}
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
()
}
...
...
@@ -141,7 +141,7 @@ func blackwhitePlay(cmd *cobra.Command, args []string) {
Fee
:
feeInt64
,
}
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
()
}
...
...
@@ -180,7 +180,7 @@ func blackwhiteShow(cmd *cobra.Command, args []string) {
Fee
:
feeInt64
,
}
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
()
}
...
...
@@ -213,7 +213,7 @@ func blackwhiteTimeoutDone(cmd *cobra.Command, args []string) {
Fee
:
feeInt64
,
}
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
()
}
...
...
@@ -290,6 +290,6 @@ func showBlackwhiteInfo(cmd *cobra.Command, args []string) {
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
()
}
plugin/dapp/cert/executor/cert.go
View file @
24432866
...
...
@@ -97,7 +97,7 @@ func (c *Cert) loadHistoryByPrefix() error {
Direction
:
0
,
Count
:
0
,
}
result
,
err
:=
c
.
DriverBase
.
GetA
pi
()
.
LocalList
(
parm
)
result
,
err
:=
c
.
DriverBase
.
GetA
PI
()
.
LocalList
(
parm
)
if
err
!=
nil
{
return
err
}
...
...
@@ -126,7 +126,7 @@ func (c *Cert) loadHistoryByPrefix() error {
func
(
c
*
Cert
)
loadHistoryByHeight
()
error
{
key
:=
calcCertHeightKey
(
c
.
GetHeight
())
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
{
return
err
}
...
...
plugin/dapp/evm/commands/evm.go
View file @
24432866
...
...
@@ -157,7 +157,7 @@ func evmBalance(cmd *cobra.Command, args []string) {
StateHash
:
""
,
}
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
.
Run
()
}
...
...
@@ -234,7 +234,7 @@ func createContract(cmd *cobra.Command, args []string) {
Data
:
data
,
}
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.SendTransaction"
,
params
,
nil
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.SendTransaction"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -369,7 +369,7 @@ func callContract(cmd *cobra.Command, args []string) {
Data
:
data
,
}
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.SendTransaction"
,
params
,
nil
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.SendTransaction"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -594,7 +594,7 @@ func evmTransfer(cmd *cobra.Command, args []string) {
Data
:
data
,
}
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.SendTransaction"
,
params
,
nil
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.SendTransaction"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -642,7 +642,7 @@ func evmWithdraw(cmd *cobra.Command, args []string) {
Data
:
data
,
}
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.SendTransaction"
,
params
,
nil
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.SendTransaction"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
}
...
...
plugin/dapp/evm/executor/evm.go
View file @
24432866
...
...
@@ -150,7 +150,7 @@ func (evm *EVMExecutor) NewEVMContext(msg *common.Message) runtime.Context {
return
runtime
.
Context
{
CanTransfer
:
CanTransfer
,
Transfer
:
Transfer
,
GetHash
:
GetHashFn
(
evm
.
GetA
pi
()),
GetHash
:
GetHashFn
(
evm
.
GetA
PI
()),
Origin
:
msg
.
From
(),
Coinbase
:
nil
,
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) {
ActionName
:
"HashlockLock"
,
Payload
:
payLoad
,
}
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.CreateTransaction"
,
paramWithExecAction
,
nil
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.CreateTransaction"
,
paramWithExecAction
,
nil
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -136,7 +136,7 @@ func hashlockUnlockCmd(cmd *cobra.Command, args []string) {
ActionName
:
"HashlockUnlock"
,
Payload
:
payLoad
,
}
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.CreateTransaction"
,
paramWithExecAction
,
nil
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.CreateTransaction"
,
paramWithExecAction
,
nil
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -171,6 +171,6 @@ func hashlockSendCmd(cmd *cobra.Command, args []string) {
ActionName
:
"HashlockSend"
,
Payload
:
payLoad
,
}
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"Chain33.CreateTransaction"
,
paramWithExecAction
,
nil
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"Chain33.CreateTransaction"
,
paramWithExecAction
,
nil
)
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 {
grpcClient
:=
types
.
NewChain33Client
(
conn
)
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
...
...
plugin/dapp/paracross/executor/action.go
View file @
24432866
...
...
@@ -36,7 +36,7 @@ func newAction(t *Paracross, tx *types.Transaction) *action {
hash
:=
tx
.
Hash
()
fromaddr
:=
tx
.
From
()
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
)
{
...
...
plugin/dapp/paracross/executor/assettransfer_test.go
View file @
24432866
...
...
@@ -55,7 +55,7 @@ func (suite *AssetTransferTestSuite) SetupTest() {
suite
.
exec
.
SetLocalDB
(
suite
.
localDB
)
suite
.
exec
.
SetStateDB
(
suite
.
stateDB
)
suite
.
exec
.
SetEnv
(
0
,
0
,
0
)
suite
.
exec
.
SetA
pi
(
suite
.
api
)
suite
.
exec
.
SetA
PI
(
suite
.
api
)
enableParacrossTransfer
=
true
// setup block
...
...
plugin/dapp/paracross/executor/assetwithdraw_test.go
View file @
24432866
...
...
@@ -50,7 +50,7 @@ func (suite *AssetWithdrawTestSuite) SetupTest() {
suite
.
exec
.
SetLocalDB
(
suite
.
localDB
)
suite
.
exec
.
SetStateDB
(
suite
.
stateDB
)
suite
.
exec
.
SetEnv
(
0
,
0
,
0
)
suite
.
exec
.
SetA
pi
(
suite
.
api
)
suite
.
exec
.
SetA
PI
(
suite
.
api
)
enableParacrossTransfer
=
true
// 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.
for
i
:=
0
;
i
<
len
(
commit
.
Status
.
CrossTxHashs
);
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
{
clog
.
Crit
(
"paracross.Commit Load Tx failed"
,
"para title"
,
commit
.
Status
.
Title
,
"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() {
suite
.
exec
.
SetLocalDB
(
suite
.
localDB
)
suite
.
exec
.
SetStateDB
(
suite
.
stateDB
)
suite
.
exec
.
SetEnv
(
0
,
0
,
0
)
suite
.
exec
.
SetA
pi
(
suite
.
api
)
suite
.
exec
.
SetA
PI
(
suite
.
api
)
enableParacrossTransfer
=
false
// TODO, more fields
...
...
@@ -355,7 +355,7 @@ func TestCrossLimits(t *testing.T) {
exec.SetLocalDB(localDB)
exec.SetStateDB(stateDB)
exec.SetEnv(0, 0, 0)
exec.SetA
pi
(api)
exec.SetA
PI
(api)
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) {
}
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
()
}
...
...
@@ -100,7 +100,7 @@ func pokerbullContinue(cmd *cobra.Command, args []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
()
}
...
...
@@ -133,7 +133,7 @@ func pokerbullQuit(cmd *cobra.Command, args []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
()
}
...
...
@@ -178,17 +178,17 @@ func pokerbullQuery(cmd *cobra.Command, args []string) {
if
gameID
!=
""
{
params
.
FuncName
=
pkt
.
FuncNameQueryGameByID
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
()
}
else
if
address
!=
""
{
params
.
FuncName
=
pkt
.
FuncNameQueryGameByAddr
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
()
}
else
if
statusStr
!=
""
{
params
.
FuncName
=
pkt
.
FuncNameQueryGameByStatus
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
()
}
else
if
gameIDs
!=
""
{
params
.
FuncName
=
pkt
.
FuncNameQueryGameListByIDs
...
...
@@ -198,7 +198,7 @@ func pokerbullQuery(cmd *cobra.Command, args []string) {
req
:=
&
pkt
.
QueryPBGameInfos
{
GameIds
:
gameIDsS
}
params
.
Payload
=
req
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
()
}
else
{
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) {
Data
:
addr
,
}
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
()
}
...
...
@@ -138,7 +138,7 @@ func public2Privacy(cmd *cobra.Command, args []string) {
}
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
()
}
...
...
@@ -204,7 +204,7 @@ func privacy2Privacy(cmd *cobra.Command, args []string) {
}
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
()
}
...
...
@@ -271,7 +271,7 @@ func privacy2Public(cmd *cobra.Command, args []string) {
}
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
()
}
...
...
@@ -300,7 +300,7 @@ func showPrivacyAccountSpend(cmd *cobra.Command, args []string) {
}
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
.
Run
()
}
...
...
@@ -370,7 +370,7 @@ func showAmountOfUTXO(cmd *cobra.Command, args []string) {
params
.
Payload
=
reqPrivacyToken
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
.
Run
()
}
...
...
@@ -413,7 +413,7 @@ func showUTXOs4SpecifiedAmount(cmd *cobra.Command, args []string) {
params
.
Payload
=
reqPrivacyToken
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
.
Run
()
}
...
...
@@ -479,7 +479,7 @@ func createUTXOs(cmd *cobra.Command, args []string) {
}
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
()
}
...
...
@@ -519,7 +519,7 @@ func showPrivacyAccountInfo(cmd *cobra.Command, args []string) {
}
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
.
Run
()
}
...
...
@@ -612,7 +612,7 @@ func listPrivacyTxsFlags(cmd *cobra.Command, args []string) {
Seedtxhash
:
[]
byte
(
seedtxhash
),
}
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
.
Run
()
}
...
...
@@ -671,7 +671,7 @@ func rescanUtxosOpt(cmd *cobra.Command, args []string) {
}
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
.
Run
()
}
...
...
@@ -726,7 +726,7 @@ func enablePrivacy(cmd *cobra.Command, args []string) {
}
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
.
Run
()
}
...
...
plugin/dapp/relay/commands/relay.go
View file @
24432866
...
...
@@ -398,7 +398,7 @@ func relayOrder(cmd *cobra.Command, args []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
()
}
...
...
@@ -441,7 +441,7 @@ func relayAccept(cmd *cobra.Command, args []string) {
CoinWaits
:
coinwait
,
}
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
()
}
...
...
@@ -481,7 +481,7 @@ func relayRevoke(cmd *cobra.Command, args []string) {
Action
:
act
,
}
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
()
}
...
...
@@ -516,7 +516,7 @@ func relayConfirm(cmd *cobra.Command, args []string) {
TxHash
:
txHash
,
}
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
()
}
...
...
@@ -566,7 +566,7 @@ func relaySaveBtcHead(cmd *cobra.Command, args []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
()
}
...
...
@@ -617,6 +617,6 @@ func relayVerifyBTC(cmd *cobra.Command, args []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
()
}
plugin/dapp/relay/executor/relay_test.go
View file @
24432866
...
...
@@ -74,7 +74,7 @@ func (s *suiteRelay) SetupSuite() {
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetIsFree
(
false
)
relay
.
SetA
pi
(
nil
)
relay
.
SetA
PI
(
nil
)
relay
.
SetChild
(
relay
)
relay
.
SetExecutorType
(
types
.
LoadExecutorType
(
driverName
))
s
.
relay
=
relay
...
...
@@ -406,7 +406,7 @@ func (s *suiteBtcHeader) SetupSuite() {
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetIsFree
(
false
)
relay
.
SetA
pi
(
nil
)
relay
.
SetA
PI
(
nil
)
relay
.
SetChild
(
relay
)
relay
.
SetExecutorType
(
types
.
LoadExecutorType
(
driverName
))
s
.
relay
=
relay
...
...
plugin/dapp/relay/executor/relaydb_test.go
View file @
24432866
...
...
@@ -154,7 +154,7 @@ func (s *suiteRelayDB) SetupSuite() {
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetIsFree
(
false
)
relay
.
SetA
pi
(
nil
)
relay
.
SetA
PI
(
nil
)
relay
.
SetChild
(
relay
)
s
.
relay
=
relay
...
...
@@ -337,7 +337,7 @@ func (s *suiteAccept) SetupSuite() {
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetIsFree
(
false
)
relay
.
SetA
pi
(
nil
)
relay
.
SetA
PI
(
nil
)
relay
.
SetChild
(
relay
)
s
.
relay
=
relay
...
...
@@ -535,7 +535,7 @@ func (s *suiteConfirm) SetupSuite() {
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetIsFree
(
false
)
relay
.
SetA
pi
(
nil
)
relay
.
SetA
PI
(
nil
)
relay
.
SetChild
(
relay
)
s
.
relay
=
relay
...
...
@@ -824,7 +824,7 @@ func (s *suiteVerify) SetupSuite() {
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetIsFree
(
false
)
relay
.
SetA
pi
(
nil
)
relay
.
SetA
PI
(
nil
)
relay
.
SetChild
(
relay
)
s
.
relay
=
relay
...
...
@@ -1055,7 +1055,7 @@ func (s *suiteVerifyCli) SetupSuite() {
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetIsFree
(
false
)
relay
.
SetA
pi
(
nil
)
relay
.
SetA
PI
(
nil
)
relay
.
SetChild
(
relay
)
s
.
relay
=
relay
...
...
@@ -1130,7 +1130,7 @@ func (s *suiteSaveBtcHeader) SetupSuite() {
relay
.
SetLocalDB
(
s
.
kvdb
)
relay
.
SetEnv
(
10
,
100
,
1
)
relay
.
SetIsFree
(
false
)
relay
.
SetA
pi
(
nil
)
relay
.
SetA
PI
(
nil
)
relay
.
SetChild
(
relay
)
s
.
relay
=
relay
...
...
plugin/dapp/retrieve/commands/retrieve.go
View file @
24432866
...
...
@@ -81,7 +81,7 @@ func backupCmd(cmd *cobra.Command, args []string) {
DelayPeriod
:
delay
,
Fee
:
feeInt64
,
}
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"retrieve.CreateRawRetrieveBackupTx"
,
params
,
nil
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"retrieve.CreateRawRetrieveBackupTx"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -118,7 +118,7 @@ func prepareCmd(cmd *cobra.Command, args []string) {
DefaultAddr
:
defaultAddr
,
Fee
:
feeInt64
,
}
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"retrieve.CreateRawRetrievePrepareTx"
,
params
,
nil
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"retrieve.CreateRawRetrievePrepareTx"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -145,7 +145,7 @@ func performCmd(cmd *cobra.Command, args []string) {
DefaultAddr
:
defaultAddr
,
Fee
:
feeInt64
,
}
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"retrieve.CreateRawRetrievePerformTx"
,
params
,
nil
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"retrieve.CreateRawRetrievePerformTx"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -172,7 +172,7 @@ func cancelCmd(cmd *cobra.Command, args []string) {
DefaultAddr
:
defaultAddr
,
Fee
:
feeInt64
,
}
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"retrieve.CreateRawRetrieveCancelTx"
,
params
,
nil
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"retrieve.CreateRawRetrieveCancelTx"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -232,7 +232,7 @@ func queryRetrieveCmd(cmd *cobra.Command, args []string) {
params
.
Payload
=
req
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
.
Run
()
}
plugin/dapp/ticket/commands/ticket.go
View file @
24432866
...
...
@@ -91,7 +91,7 @@ func CountTicketCmd() *cobra.Command {
func
countTicket
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
rpcLaddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr"
)
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
()
}
...
...
@@ -188,6 +188,6 @@ func coldAddressOfMiner(cmd *cobra.Command, args []string) {
params
.
Payload
=
reqaddr
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
()
}
plugin/dapp/token/commands/token.go
View file @
24432866
...
...
@@ -255,7 +255,7 @@ func tokenAssets(cmd *cobra.Command, args []string) {
params
.
Payload
=
req
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
.
Run
()
}
...
...
@@ -314,7 +314,7 @@ func tokenBalance(cmd *cobra.Command, args []string) {
Execer
:
execer
,
}
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
.
Run
()
}
...
...
@@ -388,7 +388,7 @@ func tokenPrecreated(cmd *cobra.Command, args []string) {
Owner
:
ownerAddr
,
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
()
}
...
...
@@ -422,7 +422,7 @@ func tokenFinish(cmd *cobra.Command, args []string) {
Owner
:
ownerAddr
,
}
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"token.CreateRawTokenFinishTx"
,
params
,
nil
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"token.CreateRawTokenFinishTx"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -457,6 +457,6 @@ func tokenRevoke(cmd *cobra.Command, args []string) {
Owner
:
ownerAddr
,
}
ctx
:=
jsonclient
.
NewR
pc
Ctx
(
rpcLaddr
,
"token.CreateRawTokenRevokeTx"
,
params
,
nil
)
ctx
:=
jsonclient
.
NewR
PC
Ctx
(
rpcLaddr
,
"token.CreateRawTokenRevokeTx"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
}
plugin/dapp/trade/commands/trade.go
View file @
24432866
...
...
@@ -77,7 +77,7 @@ func showOnesSellOrders(cmd *cobra.Command, args []string) {
Payload
:
reqAddrtokens
,
}
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
.
Run
()
}
...
...
@@ -118,7 +118,7 @@ func showOnesSellOrdersStatus(cmd *cobra.Command, args []string) {
params
.
FuncName
=
"GetOnesSellOrderWithStatus"
params
.
Payload
=
reqAddrtokens
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
.
Run
()
}
...
...
@@ -171,7 +171,7 @@ func showTokenSellOrdersStatus(cmd *cobra.Command, args []string) {
params
.
FuncName
=
"GetTokenSellOrderByStatus"
params
.
Payload
=
req
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
.
Run
()
}
...
...
@@ -234,7 +234,7 @@ func showOnesBuyOrders(cmd *cobra.Command, args []string) {
params
.
FuncName
=
"GetOnesBuyOrder"
params
.
Payload
=
reqAddrtokens
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
.
Run
()
}
...
...
@@ -274,7 +274,7 @@ func showOnesBuyOrdersStatus(cmd *cobra.Command, args []string) {
params
.
FuncName
=
"GetOnesBuyOrderWithStatus"
params
.
Payload
=
reqAddrtokens
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
.
Run
()
}
...
...
@@ -327,7 +327,7 @@ func showTokenBuyOrdersStatus(cmd *cobra.Command, args []string) {
params
.
FuncName
=
"GetTokenBuyOrderByStatus"
params
.
Payload
=
req
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
.
Run
()
}
...
...
@@ -401,7 +401,7 @@ func showOnesOrdersStatus(cmd *cobra.Command, args []string) {
params
.
FuncName
=
"GetOnesOrderWithStatus"
params
.
Payload
=
reqAddrtokens
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
.
Run
()
}
...
...
@@ -482,7 +482,7 @@ func tokenSell(cmd *cobra.Command, args []string) {
AssetExec
:
"token"
,
}
ctx
:=
jsonrpc
.
NewR
pc
Ctx
(
rpcLaddr
,
"trade.CreateRawTradeSellTx"
,
params
,
nil
)
ctx
:=
jsonrpc
.
NewR
PC
Ctx
(
rpcLaddr
,
"trade.CreateRawTradeSellTx"
,
params
,
nil
)
ctx
.
RunWithoutMarshal
()
}
...
...
@@ -518,7 +518,7 @@ func tokenBuy(cmd *cobra.Command, args []string) {
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
()
}
...
...
@@ -551,6 +551,6 @@ func tokenSellRevoke(cmd *cobra.Command, args []string) {
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
()
}
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