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
f593cab5
Commit
f593cab5
authored
May 10, 2019
by
jiangpeng
Committed by
vipwzw
May 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix privacy rpc
parent
5728f60e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
17 deletions
+8
-17
privacy.go
plugin/dapp/privacy/commands/privacy.go
+2
-2
rpc.go
plugin/dapp/privacy/rpc/rpc.go
+2
-2
privacystore.go
plugin/dapp/privacy/wallet/privacystore.go
+4
-13
No files found.
plugin/dapp/privacy/commands/privacy.go
View file @
f593cab5
...
...
@@ -75,7 +75,7 @@ func showPrivacyKey(cmd *cobra.Command, args []string) {
Data
:
addr
,
}
var
res
pty
.
ReplyPrivacyPkPair
ctx
:=
jsonclient
.
NewRPCCtx
(
rpcLaddr
,
"privacy.ShowPrivacy
k
ey"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewRPCCtx
(
rpcLaddr
,
"privacy.ShowPrivacy
K
ey"
,
params
,
&
res
)
ctx
.
Run
()
}
...
...
@@ -601,7 +601,7 @@ func listPrivacyTxsFlags(cmd *cobra.Command, args []string) {
Seedtxhash
:
[]
byte
(
seedtxhash
),
}
var
res
rpctypes
.
WalletTxDetails
ctx
:=
jsonclient
.
NewRPCCtx
(
rpcLaddr
,
"privacy.
PrivacyTxList
"
,
params
,
&
res
)
ctx
:=
jsonclient
.
NewRPCCtx
(
rpcLaddr
,
"privacy.
GetPrivacyTxByAddr
"
,
params
,
&
res
)
ctx
.
SetResultCb
(
parseWalletTxListRes
)
ctx
.
Run
()
}
...
...
plugin/dapp/privacy/rpc/rpc.go
View file @
f593cab5
...
...
@@ -86,7 +86,7 @@ func (c *Jrpc) ShowPrivacyAccountSpend(in *pty.ReqPrivBal4AddrToken, result *jso
}
// ShowPrivacykey display privacy key for json rpc
func
(
c
*
Jrpc
)
ShowPrivacy
k
ey
(
in
*
types
.
ReqString
,
result
*
json
.
RawMessage
)
error
{
func
(
c
*
Jrpc
)
ShowPrivacy
K
ey
(
in
*
types
.
ReqString
,
result
*
json
.
RawMessage
)
error
{
reply
,
err
:=
c
.
cli
.
ShowPrivacyKey
(
context
.
Background
(),
in
)
if
err
!=
nil
{
return
err
...
...
@@ -107,7 +107,7 @@ func (c *Jrpc) CreateUTXOs(in *pty.ReqCreateUTXOs, result *interface{}) error {
}
// PrivacyTxList get all privacy transaction list by param
func
(
c
*
Jrpc
)
PrivacyTxList
(
in
*
pty
.
ReqPrivacyTransactionList
,
result
*
interface
{})
error
{
func
(
c
*
Jrpc
)
GetPrivacyTxByAddr
(
in
*
pty
.
ReqPrivacyTransactionList
,
result
*
interface
{})
error
{
if
in
.
Direction
!=
0
&&
in
.
Direction
!=
1
{
return
types
.
ErrInvalidParam
}
...
...
plugin/dapp/privacy/wallet/privacystore.go
View file @
f593cab5
...
...
@@ -243,10 +243,6 @@ func (store *privacyStore) getWalletPrivacyTxDetails(param *privacytypes.ReqPriv
}
txbytes
=
append
(
txbytes
,
value
)
}
if
len
(
txbytes
)
==
0
{
bizlog
.
Error
(
"getWalletPrivacyTxDetails does not exist tx!"
)
return
nil
,
types
.
ErrTxNotExist
}
}
else
{
list
:=
store
.
NewListHelper
()
...
...
@@ -267,11 +263,6 @@ func (store *privacyStore) getWalletPrivacyTxDetails(param *privacytypes.ReqPriv
}
txbytes
=
append
(
txbytes
,
value
)
}
if
len
(
txbytes
)
==
0
{
bizlog
.
Error
(
"getWalletPrivacyTxDetails does not exist tx!"
)
return
nil
,
types
.
ErrTxNotExist
}
}
txDetails
:=
new
(
types
.
WalletTxDetails
)
...
...
@@ -714,10 +705,10 @@ func (store *privacyStore) listSpendUTXOs(token, addr string) (*privacytypes.UTX
prefix
:=
calcSTXOPrefix4Addr
(
token
,
addr
)
list
:=
store
.
NewListHelper
()
Key4FTXOsInTxs
:=
list
.
PrefixScan
(
prefix
)
if
len
(
Key4FTXOsInTxs
)
==
0
{
bizlog
.
Error
(
"listSpendUTXOs "
,
"addr not exist"
,
addr
)
return
nil
,
types
.
ErrNotFound
}
//
if len(Key4FTXOsInTxs) == 0 {
//
bizlog.Error("listSpendUTXOs ", "addr not exist", addr)
//
return nil, types.ErrNotFound
//
}
var
utxoHaveTxHashs
privacytypes
.
UTXOHaveTxHashs
utxoHaveTxHashs
.
UtxoHaveTxHashs
=
make
([]
*
privacytypes
.
UTXOHaveTxHash
,
0
)
...
...
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