Commit 05a5231c authored by linj's avatar linj

fix create perform tx

parent 9a2ee997
...@@ -168,7 +168,7 @@ func performCmd(cmd *cobra.Command, args []string) { ...@@ -168,7 +168,7 @@ func performCmd(cmd *cobra.Command, args []string) {
return return
} }
for i := 0; i < len(execs); i++ { for i := 0; i < len(execs); i++ {
params.Assets = append(params.Assets, rpc.Asset{Exec: execs[i], Symbol: symbols[0]}) params.Assets = append(params.Assets, rpc.Asset{Exec: execs[i], Symbol: symbols[i]})
} }
ctx := jsonrpc.NewRPCCtx(rpcLaddr, "retrieve.CreateRawRetrievePerformTx", params, nil) ctx := jsonrpc.NewRPCCtx(rpcLaddr, "retrieve.CreateRawRetrievePerformTx", params, nil)
......
...@@ -8,6 +8,7 @@ import ( ...@@ -8,6 +8,7 @@ import (
"context" "context"
"encoding/hex" "encoding/hex"
chain33_types "github.com/33cn/chain33/types"
"github.com/33cn/plugin/plugin/dapp/retrieve/types" "github.com/33cn/plugin/plugin/dapp/retrieve/types"
) )
...@@ -49,6 +50,11 @@ func (c *Jrpc) CreateRawRetrievePerformTx(in *RetrievePerformTx, result *interfa ...@@ -49,6 +50,11 @@ func (c *Jrpc) CreateRawRetrievePerformTx(in *RetrievePerformTx, result *interfa
head := &types.PerformRetrieve{ head := &types.PerformRetrieve{
BackupAddress: in.BackupAddr, BackupAddress: in.BackupAddr,
DefaultAddress: in.DefaultAddr, DefaultAddress: in.DefaultAddr,
Assets: []*chain33_types.Asset{},
}
for i := 0; i < len(in.Assets); i++ {
head.Assets = append(head.Assets, &chain33_types.Asset{Exec: in.Assets[i].Exec, Symbol: in.Assets[i].Symbol})
} }
reply, err := c.cli.Perform(context.Background(), head) reply, err := c.cli.Perform(context.Background(), head)
if err != nil { if err != nil {
......
...@@ -43,10 +43,12 @@ func (c *channelClient) Perform(ctx context.Context, v *rt.PerformRetrieve) (*ty ...@@ -43,10 +43,12 @@ func (c *channelClient) Perform(ctx context.Context, v *rt.PerformRetrieve) (*ty
Ty: rt.RetrieveActionPerform, Ty: rt.RetrieveActionPerform,
Value: &rt.RetrieveAction_Perform{Perform: v}, Value: &rt.RetrieveAction_Perform{Perform: v},
} }
tx, err := types.CreateFormatTx(types.ExecName(rt.RetrieveX), types.Encode(perform)) payload := types.Encode(perform)
tx, err := types.CreateFormatTx(types.ExecName(rt.RetrieveX), payload)
if err != nil { if err != nil {
return nil, err return nil, err
} }
data := types.Encode(tx) data := types.Encode(tx)
return &types.UnsignTx{Data: data}, nil return &types.UnsignTx{Data: data}, nil
} }
......
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