Commit f593cab5 authored by jiangpeng's avatar jiangpeng Committed by vipwzw

fix privacy rpc

parent 5728f60e
......@@ -75,7 +75,7 @@ func showPrivacyKey(cmd *cobra.Command, args []string) {
Data: addr,
}
var res pty.ReplyPrivacyPkPair
ctx := jsonclient.NewRPCCtx(rpcLaddr, "privacy.ShowPrivacykey", params, &res)
ctx := jsonclient.NewRPCCtx(rpcLaddr, "privacy.ShowPrivacyKey", 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()
}
......
......@@ -86,7 +86,7 @@ func (c *Jrpc) ShowPrivacyAccountSpend(in *pty.ReqPrivBal4AddrToken, result *jso
}
// ShowPrivacykey display privacy key for json rpc
func (c *Jrpc) ShowPrivacykey(in *types.ReqString, result *json.RawMessage) error {
func (c *Jrpc) ShowPrivacyKey(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
}
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment