Commit fe9c161a authored by linj's avatar linj

不需要 asset.amount: 避免 amount 引起误解

{ "amount" : "0", "exec" : "token", "symbol" : "RETRIEVE" }
parent 1ba67897
......@@ -97,7 +97,7 @@ func (c *Retrieve) ExecDelLocal_Perform(perf *rt.PerformRetrieve, tx *types.Tran
if types.IsDappFork(c.GetHeight(), rt.RetrieveX, rt.ForkRetriveAssetX) {
if len(perf.Assets) == 0 {
perf.Assets = append(perf.Assets, &types.Asset{Exec: "coins", Symbol: types.GetCoinSymbol()})
perf.Assets = append(perf.Assets, &rt.AssetSymbol{Exec: "coins", Symbol: types.GetCoinSymbol()})
}
}
for _, asset := range perf.Assets {
......
......@@ -104,7 +104,7 @@ func (c *Retrieve) ExecLocal_Perform(perf *rt.PerformRetrieve, tx *types.Transac
}
if types.IsDappFork(c.GetHeight(), rt.RetrieveX, rt.ForkRetriveAssetX) {
if len(perf.Assets) == 0 {
perf.Assets = append(perf.Assets, &types.Asset{Exec: "coins", Symbol: types.GetCoinSymbol()})
perf.Assets = append(perf.Assets, &rt.AssetSymbol{Exec: "coins", Symbol: types.GetCoinSymbol()})
}
}
for _, asset := range perf.Assets {
......
......@@ -211,7 +211,7 @@ func (action *Action) RetrievePerformAssets(perfRet *rt.PerformRetrieve, default
// 兼容原来的找回, 在不指定的情况下,找回主币
if len(perfRet.Assets) == 0 {
perfRet.Assets = append(perfRet.Assets, &types.Asset{Exec: "coins", Symbol: types.GetCoinSymbol()})
perfRet.Assets = append(perfRet.Assets, &rt.AssetSymbol{Exec: "coins", Symbol: types.GetCoinSymbol()})
//return nil, nil
}
......
......@@ -40,10 +40,16 @@ message PrepareRetrieve {
string defaultAddress = 2;
}
message AssetSymbol {
string exec = 1;
string symbol = 2;
}
message PerformRetrieve {
string backupAddress = 1;
string defaultAddress = 2;
repeated Asset assets = 3;
repeated AssetSymbol assets = 3;
}
message CancelRetrieve {
......
......@@ -8,7 +8,6 @@ import (
"context"
"encoding/hex"
chain33_types "github.com/33cn/chain33/types"
"github.com/33cn/plugin/plugin/dapp/retrieve/types"
)
......@@ -50,11 +49,11 @@ func (c *Jrpc) CreateRawRetrievePerformTx(in *RetrievePerformTx, result *interfa
head := &types.PerformRetrieve{
BackupAddress: in.BackupAddr,
DefaultAddress: in.DefaultAddr,
Assets: []*chain33_types.Asset{},
Assets: []*types.AssetSymbol{},
}
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})
head.Assets = append(head.Assets, &types.AssetSymbol{Exec: in.Assets[i].Exec, Symbol: in.Assets[i].Symbol})
}
reply, err := c.cli.Perform(context.Background(), head)
if err != 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