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

删除隐私集成发送的rpc

parent f940942f
......@@ -33,33 +33,6 @@ func (g *channelClient) CreateUTXOs(ctx context.Context, in *pty.ReqCreateUTXOs)
return data.(*types.Reply), nil
}
// 将资金从公开到隐私转移
func (g *channelClient) MakeTxPublic2Privacy(ctx context.Context, in *pty.ReqPub2Pri) (*types.Reply, error) {
data, err := g.ExecWalletFunc(pty.PrivacyX, "Public2Privacy", in)
if err != nil {
return nil, err
}
return data.(*types.Reply), nil
}
// 将资产从隐私到隐私进行转移
func (g *channelClient) MakeTxPrivacy2Privacy(ctx context.Context, in *pty.ReqPri2Pri) (*types.Reply, error) {
data, err := g.ExecWalletFunc(pty.PrivacyX, "Privacy2Privacy", in)
if err != nil {
return nil, err
}
return data.(*types.Reply), nil
}
// 将资产从隐私到公开进行转移
func (g *channelClient) MakeTxPrivacy2Public(ctx context.Context, in *pty.ReqPri2Pub) (*types.Reply, error) {
data, err := g.ExecWalletFunc(pty.PrivacyX, "Privacy2Public", in)
if err != nil {
return nil, err
}
return data.(*types.Reply), nil
}
// 扫描UTXO以及获取扫描UTXO后的状态
func (g *channelClient) RescanUtxos(ctx context.Context, in *pty.ReqRescanUtxos) (*pty.RepRescanUtxos, error) {
data, err := g.ExecWalletFunc(pty.PrivacyX, "RescanUtxos", in)
......@@ -122,41 +95,6 @@ func (c *Jrpc) ShowPrivacykey(in *types.ReqString, result *json.RawMessage) erro
return err
}
// MakeTxPublic2privacy create public to privacy trasaction for json rpc
func (c *Jrpc) MakeTxPublic2privacy(in *pty.ReqPub2Pri, result *interface{}) error {
reply, err := c.cli.MakeTxPublic2Privacy(context.Background(), in)
if err != nil {
return err
}
*result = rpctypes.ReplyHash{Hash: common.ToHex(reply.GetMsg())}
return nil
}
// MakeTxPrivacy2privacy create privacy to privacy transaction
func (c *Jrpc) MakeTxPrivacy2privacy(in *pty.ReqPri2Pri, result *interface{}) error {
reply, err := c.cli.MakeTxPrivacy2Privacy(context.Background(), in)
if err != nil {
return err
}
*result = rpctypes.ReplyHash{Hash: common.ToHex(reply.GetMsg())}
return nil
}
// MakeTxPrivacy2public make privacy to public trasaction
func (c *Jrpc) MakeTxPrivacy2public(in *pty.ReqPri2Pub, result *interface{}) error {
reply, err := c.cli.MakeTxPrivacy2Public(context.Background(), in)
if err != nil {
return err
}
*result = rpctypes.ReplyHash{Hash: common.ToHex(reply.GetMsg())}
return nil
}
// CreateUTXOs create utxos for json rpc
func (c *Jrpc) CreateUTXOs(in *pty.ReqCreateUTXOs, result *interface{}) error {
......
......@@ -45,10 +45,6 @@ func TestRPCChannel(t *testing.T) {
{fn: testShowPrivacyKey},
{fn: testShowPrivacyAccountInfo},
{fn: testShowPrivacyAccountSpend},
{fn: testPublic2Privacy},
{fn: testPrivacy2Privacy},
{fn: testPrivacy2Public},
{fn: testPrivacy2Public},
{fn: testShowAmountsOfUTXO},
{fn: testShowUTXOs4SpecifiedAmount},
{fn: testCreateUTXOs},
......@@ -98,50 +94,6 @@ func testShowPrivacyAccountSpend(t *testing.T, jrpc *jsonclient.JSONClient) erro
return err
}
func testPublic2Privacy(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := pty.ReqPub2Pri{
Sender: "13cS5G1BDN2YfGudsxRxr7X25yu6ZdgxMU",
Pubkeypair: "92fe6cfec2e19cd15f203f83b5d440ddb63d0cb71559f96dc81208d819fea85886b08f6e874fca15108d244b40f9086d8c03260d4b954a40dfb3cbe41ebc7389",
Amount: 1234,
Note: "for test",
Tokenname: types.BTY,
Expire: int64(time.Hour),
}
var res rpctypes.ReplyHash
err := jrpc.Call("privacy.MakeTxPublic2privacy", params, &res)
return err
}
func testPrivacy2Privacy(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := pty.ReqPri2Pri{
Sender: "13cS5G1BDN2YfGudsxRxr7X25yu6ZdgxMU",
Pubkeypair: "92fe6cfec2e19cd15f203f83b5d440ddb63d0cb71559f96dc81208d819fea85886b08f6e874fca15108d244b40f9086d8c03260d4b954a40dfb3cbe41ebc7389",
Amount: 234567,
Mixin: 16,
Note: "for test",
Tokenname: types.BTY,
Expire: int64(time.Hour),
}
var res rpctypes.ReplyHash
err := jrpc.Call("privacy.MakeTxPrivacy2privacy", params, &res)
return err
}
func testPrivacy2Public(t *testing.T, jrpc *jsonclient.JSONClient) error {
params := pty.ReqPri2Pub{
Sender: "13cS5G1BDN2YfGudsxRxr7X25yu6ZdgxMU",
Receiver: "1EDDghAtgBsamrNEtNmYdQzC1QEhLkr87t",
Amount: 123456,
Note: "for test",
Tokenname: types.BTY,
Mixin: 16,
Expire: int64(time.Hour),
}
var res rpctypes.ReplyHash
err := jrpc.Call("privacy.MakeTxPrivacy2public", params, &res)
return err
}
func testShowAmountsOfUTXO(t *testing.T, jrpc *jsonclient.JSONClient) error {
reqPrivacyToken := pty.ReqPrivacyToken{Token: types.BTY}
......
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