Unverified Commit 1ad3a042 authored by vipwzw's avatar vipwzw Committed by GitHub

Merge pull request #624 from linj-disanbo/retrieve-support-more-assets

Retrieve support more assets
parents dfac9364 ba56fc97
...@@ -224,6 +224,7 @@ ForkTicketVrf =0 ...@@ -224,6 +224,7 @@ ForkTicketVrf =0
[fork.sub.retrieve] [fork.sub.retrieve]
Enable=0 Enable=0
ForkRetrive=0 ForkRetrive=0
ForkRetriveAsset=0
[fork.sub.hashlock] [fork.sub.hashlock]
Enable=0 Enable=0
......
...@@ -107,6 +107,19 @@ func addRetrieveCmdFlags(cmd *cobra.Command) { ...@@ -107,6 +107,19 @@ func addRetrieveCmdFlags(cmd *cobra.Command) {
cmd.Flags().Float64P("fee", "f", defaultFee, "sign address") cmd.Flags().Float64P("fee", "f", defaultFee, "sign address")
} }
func addPerformCmdFlags(cmd *cobra.Command) {
cmd.Flags().StringP("backup", "b", "", "backup address")
cmd.MarkFlagRequired("backup")
cmd.Flags().StringP("default", "t", "", "default address")
cmd.MarkFlagRequired("default")
cmd.Flags().StringArrayP("exec", "e", []string{}, "asset exec")
cmd.Flags().StringArrayP("symbol", "s", []string{}, "asset symbol")
defaultFee := float64(types.GInt("MinFee")) / float64(types.Coin)
cmd.Flags().Float64P("fee", "f", defaultFee, "sign address")
}
func prepareCmd(cmd *cobra.Command, args []string) { func prepareCmd(cmd *cobra.Command, args []string) {
rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr") rpcLaddr, _ := cmd.Flags().GetString("rpc_laddr")
backup, _ := cmd.Flags().GetString("backup") backup, _ := cmd.Flags().GetString("backup")
...@@ -130,7 +143,7 @@ func PerformCmd() *cobra.Command { ...@@ -130,7 +143,7 @@ func PerformCmd() *cobra.Command {
Short: "Perform the retrieve", Short: "Perform the retrieve",
Run: performCmd, Run: performCmd,
} }
addRetrieveCmdFlags(cmd) addPerformCmdFlags(cmd)
return cmd return cmd
} }
...@@ -140,12 +153,24 @@ func performCmd(cmd *cobra.Command, args []string) { ...@@ -140,12 +153,24 @@ func performCmd(cmd *cobra.Command, args []string) {
defaultAddr, _ := cmd.Flags().GetString("default") defaultAddr, _ := cmd.Flags().GetString("default")
fee, _ := cmd.Flags().GetFloat64("fee") fee, _ := cmd.Flags().GetFloat64("fee")
execs, _ := cmd.Flags().GetStringArray("exec")
symbols, _ := cmd.Flags().GetStringArray("symbol")
feeInt64 := int64(fee*types.InputPrecision) * types.Multiple1E4 feeInt64 := int64(fee*types.InputPrecision) * types.Multiple1E4
params := rpc.RetrievePerformTx{ params := rpc.RetrievePerformTx{
BackupAddr: backup, BackupAddr: backup,
DefaultAddr: defaultAddr, DefaultAddr: defaultAddr,
Assets: []rpc.Asset{},
Fee: feeInt64, Fee: feeInt64,
} }
if len(execs) != len(symbols) {
fmt.Printf("exec count must equal to symbol count\n")
return
}
for i := 0; i < len(execs); i++ {
params.Assets = append(params.Assets, rpc.Asset{Exec: execs[i], Symbol: symbols[0]})
}
ctx := jsonrpc.NewRPCCtx(rpcLaddr, "retrieve.CreateRawRetrievePerformTx", params, nil) ctx := jsonrpc.NewRPCCtx(rpcLaddr, "retrieve.CreateRawRetrievePerformTx", params, nil)
ctx.RunWithoutMarshal() ctx.RunWithoutMarshal()
} }
......
...@@ -53,7 +53,7 @@ func (c *Retrieve) ExecDelLocal_Backup(backup *rt.BackupRetrieve, tx *types.Tran ...@@ -53,7 +53,7 @@ func (c *Retrieve) ExecDelLocal_Backup(backup *rt.BackupRetrieve, tx *types.Tran
set := &types.LocalDBSet{} set := &types.LocalDBSet{}
rlog.Debug("Retrieve ExecDelLocal_Backup") rlog.Debug("Retrieve ExecDelLocal_Backup")
info := rt.RetrieveQuery{BackupAddress: backup.BackupAddress, DefaultAddress: backup.DefaultAddress, DelayPeriod: backup.DelayPeriod, PrepareTime: zeroPrepareTime, RemainTime: zeroRemainTime, Status: retrieveBackup} info := createRetrieve(backup.BackupAddress, backup.DefaultAddress, retrieveBackup)
kv, err := DelRetrieveInfo(&info, retrieveBackup, c.GetLocalDB()) kv, err := DelRetrieveInfo(&info, retrieveBackup, c.GetLocalDB())
if err != nil { if err != nil {
return set, nil return set, nil
...@@ -71,7 +71,7 @@ func (c *Retrieve) ExecDelLocal_Prepare(pre *rt.PrepareRetrieve, tx *types.Trans ...@@ -71,7 +71,7 @@ func (c *Retrieve) ExecDelLocal_Prepare(pre *rt.PrepareRetrieve, tx *types.Trans
set := &types.LocalDBSet{} set := &types.LocalDBSet{}
rlog.Debug("Retrieve ExecDelLocal_Prepare") rlog.Debug("Retrieve ExecDelLocal_Prepare")
info := rt.RetrieveQuery{BackupAddress: pre.BackupAddress, DefaultAddress: pre.DefaultAddress, DelayPeriod: zeroDelay, PrepareTime: c.GetBlockTime(), RemainTime: zeroRemainTime, Status: retrievePrepare} info := createRetrieve(pre.BackupAddress, pre.DefaultAddress, retrievePrepare)
kv, err := DelRetrieveInfo(&info, retrievePrepare, c.GetLocalDB()) kv, err := DelRetrieveInfo(&info, retrievePrepare, c.GetLocalDB())
if err != nil { if err != nil {
return set, nil return set, nil
...@@ -89,12 +89,23 @@ func (c *Retrieve) ExecDelLocal_Perform(perf *rt.PerformRetrieve, tx *types.Tran ...@@ -89,12 +89,23 @@ func (c *Retrieve) ExecDelLocal_Perform(perf *rt.PerformRetrieve, tx *types.Tran
set := &types.LocalDBSet{} set := &types.LocalDBSet{}
rlog.Debug("Retrieve ExecDelLocal_Perform") rlog.Debug("Retrieve ExecDelLocal_Perform")
info := rt.RetrieveQuery{BackupAddress: perf.BackupAddress, DefaultAddress: perf.DefaultAddress, DelayPeriod: zeroDelay, PrepareTime: zeroPrepareTime, RemainTime: zeroRemainTime, Status: retrievePerform} info := createRetrieve(perf.BackupAddress, perf.DefaultAddress, retrievePerform)
kv, err := DelRetrieveInfo(&info, retrievePerform, c.GetLocalDB()) kv, err := DelRetrieveInfo(&info, retrievePerform, c.GetLocalDB())
if err != nil { if err != nil {
return set, nil return set, nil
} }
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()})
}
}
for _, asset := range perf.Assets {
kv := &types.KeyValue{Key: calcRetrieveAssetKey(info.BackupAddress, info.DefaultAddress, asset.Exec, asset.Symbol), Value: nil}
c.GetLocalDB().Set(kv.Key, kv.Value)
set.KV = append(set.KV, kv)
}
if kv != nil { if kv != nil {
set.KV = append(set.KV, kv) set.KV = append(set.KV, kv)
} }
...@@ -107,7 +118,7 @@ func (c *Retrieve) ExecDelLocal_Cancel(cancel *rt.CancelRetrieve, tx *types.Tran ...@@ -107,7 +118,7 @@ func (c *Retrieve) ExecDelLocal_Cancel(cancel *rt.CancelRetrieve, tx *types.Tran
set := &types.LocalDBSet{} set := &types.LocalDBSet{}
rlog.Debug("Retrieve ExecDelLocal_Cancel") rlog.Debug("Retrieve ExecDelLocal_Cancel")
info := rt.RetrieveQuery{BackupAddress: cancel.BackupAddress, DefaultAddress: cancel.DefaultAddress, DelayPeriod: zeroDelay, PrepareTime: zeroPrepareTime, RemainTime: zeroRemainTime, Status: retrieveCancel} info := createRetrieve(cancel.BackupAddress, cancel.DefaultAddress, retrieveCancel)
kv, err := DelRetrieveInfo(&info, retrieveCancel, c.GetLocalDB()) kv, err := DelRetrieveInfo(&info, retrieveCancel, c.GetLocalDB())
if err != nil { if err != nil {
return set, nil return set, nil
......
...@@ -10,6 +10,10 @@ import ( ...@@ -10,6 +10,10 @@ import (
rt "github.com/33cn/plugin/plugin/dapp/retrieve/types" rt "github.com/33cn/plugin/plugin/dapp/retrieve/types"
) )
func createRetrieve(backupAddress, defaultAddress string, status int32) rt.RetrieveQuery {
return rt.RetrieveQuery{BackupAddress: backupAddress, DefaultAddress: defaultAddress, DelayPeriod: zeroDelay, PrepareTime: zeroPrepareTime, RemainTime: zeroRemainTime, Status: status}
}
// SaveRetrieveInfo local // SaveRetrieveInfo local
func SaveRetrieveInfo(info *rt.RetrieveQuery, Status int64, db dbm.KVDB) (*types.KeyValue, error) { func SaveRetrieveInfo(info *rt.RetrieveQuery, Status int64, db dbm.KVDB) (*types.KeyValue, error) {
rlog.Debug("Retrieve SaveRetrieveInfo", "backupaddr", info.BackupAddress, "defaddr", info.DefaultAddress) rlog.Debug("Retrieve SaveRetrieveInfo", "backupaddr", info.BackupAddress, "defaddr", info.DefaultAddress)
...@@ -55,7 +59,8 @@ func SaveRetrieveInfo(info *rt.RetrieveQuery, Status int64, db dbm.KVDB) (*types ...@@ -55,7 +59,8 @@ func SaveRetrieveInfo(info *rt.RetrieveQuery, Status int64, db dbm.KVDB) (*types
func (c *Retrieve) ExecLocal_Backup(backup *rt.BackupRetrieve, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) { func (c *Retrieve) ExecLocal_Backup(backup *rt.BackupRetrieve, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
set := &types.LocalDBSet{} set := &types.LocalDBSet{}
rlog.Debug("Retrieve ExecLocal_Backup") rlog.Debug("Retrieve ExecLocal_Backup")
info := rt.RetrieveQuery{BackupAddress: backup.BackupAddress, DefaultAddress: backup.DefaultAddress, DelayPeriod: backup.DelayPeriod, PrepareTime: zeroPrepareTime, RemainTime: zeroRemainTime, Status: retrieveBackup} info := createRetrieve(backup.BackupAddress, backup.DefaultAddress, retrieveBackup)
info.DelayPeriod = backup.DelayPeriod
kv, err := SaveRetrieveInfo(&info, retrieveBackup, c.GetLocalDB()) kv, err := SaveRetrieveInfo(&info, retrieveBackup, c.GetLocalDB())
if err != nil { if err != nil {
return set, nil return set, nil
...@@ -73,7 +78,8 @@ func (c *Retrieve) ExecLocal_Prepare(pre *rt.PrepareRetrieve, tx *types.Transact ...@@ -73,7 +78,8 @@ func (c *Retrieve) ExecLocal_Prepare(pre *rt.PrepareRetrieve, tx *types.Transact
set := &types.LocalDBSet{} set := &types.LocalDBSet{}
rlog.Debug("Retrieve ExecLocal_Prepare") rlog.Debug("Retrieve ExecLocal_Prepare")
info := rt.RetrieveQuery{BackupAddress: pre.BackupAddress, DefaultAddress: pre.DefaultAddress, DelayPeriod: zeroDelay, PrepareTime: zeroPrepareTime, RemainTime: zeroRemainTime, Status: retrievePrepare} info := createRetrieve(pre.BackupAddress, pre.DefaultAddress, retrievePrepare)
info.PrepareTime = c.GetBlockTime()
kv, err := SaveRetrieveInfo(&info, retrievePrepare, c.GetLocalDB()) kv, err := SaveRetrieveInfo(&info, retrievePrepare, c.GetLocalDB())
if err != nil { if err != nil {
return set, nil return set, nil
...@@ -91,11 +97,22 @@ func (c *Retrieve) ExecLocal_Perform(perf *rt.PerformRetrieve, tx *types.Transac ...@@ -91,11 +97,22 @@ func (c *Retrieve) ExecLocal_Perform(perf *rt.PerformRetrieve, tx *types.Transac
set := &types.LocalDBSet{} set := &types.LocalDBSet{}
rlog.Debug("Retrieve ExecLocal_Perf") rlog.Debug("Retrieve ExecLocal_Perf")
info := rt.RetrieveQuery{BackupAddress: perf.BackupAddress, DefaultAddress: perf.DefaultAddress, DelayPeriod: zeroDelay, PrepareTime: zeroPrepareTime, RemainTime: zeroRemainTime, Status: retrievePerform} info := createRetrieve(perf.BackupAddress, perf.DefaultAddress, retrievePerform)
kv, err := SaveRetrieveInfo(&info, retrievePerform, c.GetLocalDB()) kv, err := SaveRetrieveInfo(&info, retrievePerform, c.GetLocalDB())
if err != nil { if err != nil {
return set, nil return set, nil
} }
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()})
}
}
for _, asset := range perf.Assets {
value := types.Encode(&info)
kv := &types.KeyValue{Key: calcRetrieveAssetKey(info.BackupAddress, info.DefaultAddress, asset.Exec, asset.Symbol), Value: value}
c.GetLocalDB().Set(kv.Key, kv.Value)
set.KV = append(set.KV, kv)
}
if kv != nil { if kv != nil {
set.KV = append(set.KV, kv) set.KV = append(set.KV, kv)
...@@ -109,7 +126,7 @@ func (c *Retrieve) ExecLocal_Cancel(cancel *rt.CancelRetrieve, tx *types.Transac ...@@ -109,7 +126,7 @@ func (c *Retrieve) ExecLocal_Cancel(cancel *rt.CancelRetrieve, tx *types.Transac
set := &types.LocalDBSet{} set := &types.LocalDBSet{}
rlog.Debug("Retrieve ExecLocal_Cancel") rlog.Debug("Retrieve ExecLocal_Cancel")
info := rt.RetrieveQuery{BackupAddress: cancel.BackupAddress, DefaultAddress: cancel.DefaultAddress, DelayPeriod: zeroDelay, PrepareTime: zeroPrepareTime, RemainTime: zeroRemainTime, Status: retrieveCancel} info := createRetrieve(cancel.BackupAddress, cancel.DefaultAddress, retrieveCancel)
kv, err := SaveRetrieveInfo(&info, retrieveCancel, c.GetLocalDB()) kv, err := SaveRetrieveInfo(&info, retrieveCancel, c.GetLocalDB())
if err != nil { if err != nil {
return set, nil return set, nil
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
package executor package executor
import ( import (
"fmt"
"github.com/33cn/chain33/types" "github.com/33cn/chain33/types"
rt "github.com/33cn/plugin/plugin/dapp/retrieve/types" rt "github.com/33cn/plugin/plugin/dapp/retrieve/types"
) )
...@@ -22,5 +24,32 @@ func (r *Retrieve) Query_GetRetrieveInfo(in *rt.ReqRetrieveInfo) (types.Message, ...@@ -22,5 +24,32 @@ func (r *Retrieve) Query_GetRetrieveInfo(in *rt.ReqRetrieveInfo) (types.Message,
info.RemainTime = 0 info.RemainTime = 0
} }
} }
// 在指定asset 的情况下, 显示具体asset 的找回状态
if info.Status == retrievePerform && in.GetAssetExec() != "" {
// retrievePerform状态下,不存在有两种情况
// 1 还没找回, 2 fork 之前是没有coins 找回记录的
count := r.GetLocalDB().PrefixCount(calcRetrieveAssetPrefix(in.BackupAddress, in.DefaultAddress))
// 2 fork 之前是 没有coins 找回记录的, 相当于都找回了
if count == 0 {
return info, nil
}
asset, _ := getRetrieveAsset(r.GetLocalDB(), in.BackupAddress, in.DefaultAddress, in.AssetExec, in.AssetSymbol)
if asset != nil {
return asset, nil
}
// 1 还没找回
info.Status = retrievePrepare
info.RemainTime = zeroRemainTime
return info, nil
}
return info, nil return info, nil
} }
func calcRetrieveAssetPrefix(backupAddr, defaultAddr string) []byte {
key := fmt.Sprintf("LODB-retrieve-backup-asset:%s:%s:", backupAddr, defaultAddr)
return []byte(key)
}
...@@ -69,9 +69,22 @@ func calcRetrieveKey(backupAddr string, defaultAddr string) []byte { ...@@ -69,9 +69,22 @@ func calcRetrieveKey(backupAddr string, defaultAddr string) []byte {
return []byte(key) return []byte(key)
} }
func calcRetrieveAssetKey(backupAddr, defaultAddr, assetExec, assetSymbol string) []byte {
key := fmt.Sprintf("LODB-retrieve-backup-asset:%s:%s:%s:%s", backupAddr, defaultAddr, assetExec, assetSymbol)
return []byte(key)
}
func getRetrieveAsset(db dbm.KVDB, backupAddr, defaultAddr, assetExec, assetSymbol string) (*rt.RetrieveQuery, error) {
return getRetrieve(db, calcRetrieveAssetKey(backupAddr, defaultAddr, assetExec, assetSymbol))
}
func getRetrieveInfo(db dbm.KVDB, backupAddr string, defaultAddr string) (*rt.RetrieveQuery, error) { func getRetrieveInfo(db dbm.KVDB, backupAddr string, defaultAddr string) (*rt.RetrieveQuery, error) {
return getRetrieve(db, calcRetrieveKey(backupAddr, defaultAddr))
}
func getRetrieve(db dbm.KVDB, key []byte) (*rt.RetrieveQuery, error) {
info := rt.RetrieveQuery{} info := rt.RetrieveQuery{}
retInfo, err := db.Get(calcRetrieveKey(backupAddr, defaultAddr)) retInfo, err := db.Get(key)
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
...@@ -116,7 +116,7 @@ func (action *Action) RetrieveBackup(backupRet *rt.BackupRetrieve) (*types.Recei ...@@ -116,7 +116,7 @@ func (action *Action) RetrieveBackup(backupRet *rt.BackupRetrieve) (*types.Recei
var receipt *types.Receipt var receipt *types.Receipt
var r *DB var r *DB
var newRetrieve = false var newRetrieve = false
if types.IsDappFork(action.height, rt.RetrieveX, "ForkRetrive") { if types.IsDappFork(action.height, rt.RetrieveX, rt.ForkRetriveX) {
if err := address.CheckAddress(backupRet.BackupAddress); err != nil { if err := address.CheckAddress(backupRet.BackupAddress); err != nil {
rlog.Debug("retrieve checkaddress") rlog.Debug("retrieve checkaddress")
return nil, err return nil, err
...@@ -203,6 +203,43 @@ func (action *Action) RetrievePrepare(preRet *rt.PrepareRetrieve) (*types.Receip ...@@ -203,6 +203,43 @@ func (action *Action) RetrievePrepare(preRet *rt.PrepareRetrieve) (*types.Receip
return receipt, nil return receipt, nil
} }
// RetrievePerformAssets Action
func (action *Action) RetrievePerformAssets(perfRet *rt.PerformRetrieve, defaultAddress string) (*types.Receipt, error) {
var logs []*types.ReceiptLog
var kv []*types.KeyValue
var receipt *types.Receipt
// 兼容原来的找回, 在不指定的情况下,找回主币
if len(perfRet.Assets) == 0 {
perfRet.Assets = append(perfRet.Assets, &types.Asset{Exec: "coins", Symbol: types.GetCoinSymbol()})
//return nil, nil
}
for _, asset := range perfRet.Assets {
accdb, err := account.NewAccountDB(asset.Exec, asset.Symbol, action.db)
if err != nil {
rlog.Error("RetrievePerform", "NewAccountDB", err)
return nil, err
}
acc := accdb.LoadExecAccount(defaultAddress, action.execaddr)
rlog.Debug("RetrievePerform", "acc.Balance", acc.Balance)
if acc.Balance > 0 {
receipt, err = action.coinsAccount.ExecTransfer(defaultAddress, perfRet.BackupAddress, action.execaddr, acc.Balance)
if err != nil {
rlog.Debug("RetrievePerform", "ExecTransfer", err)
return nil, err
}
logs = append(logs, receipt.Logs...)
kv = append(kv, receipt.KV...)
} else {
return nil, rt.ErrRetrieveNoBalance
}
}
receipt = &types.Receipt{Ty: types.ExecOk, KV: kv, Logs: logs}
return receipt, nil
}
// RetrievePerform Action // RetrievePerform Action
func (action *Action) RetrievePerform(perfRet *rt.PerformRetrieve) (*types.Receipt, error) { func (action *Action) RetrievePerform(perfRet *rt.PerformRetrieve) (*types.Receipt, error) {
var logs []*types.ReceiptLog var logs []*types.ReceiptLog
...@@ -239,6 +276,10 @@ func (action *Action) RetrievePerform(perfRet *rt.PerformRetrieve) (*types.Recei ...@@ -239,6 +276,10 @@ func (action *Action) RetrievePerform(perfRet *rt.PerformRetrieve) (*types.Recei
return nil, rt.ErrRetrievePeriodLimit return nil, rt.ErrRetrievePeriodLimit
} }
if types.IsDappFork(action.height, rt.RetrieveX, rt.ForkRetriveAssetX) {
return action.RetrievePerformAssets(perfRet, r.RetPara[index].DefaultAddress)
}
acc = action.coinsAccount.LoadExecAccount(r.RetPara[index].DefaultAddress, action.execaddr) acc = action.coinsAccount.LoadExecAccount(r.RetPara[index].DefaultAddress, action.execaddr)
rlog.Debug("RetrievePerform", "acc.Balance", acc.Balance) rlog.Debug("RetrievePerform", "acc.Balance", acc.Balance)
if acc.Balance > 0 { if acc.Balance > 0 {
......
...@@ -43,6 +43,7 @@ message PrepareRetrieve { ...@@ -43,6 +43,7 @@ message PrepareRetrieve {
message PerformRetrieve { message PerformRetrieve {
string backupAddress = 1; string backupAddress = 1;
string defaultAddress = 2; string defaultAddress = 2;
repeated Asset assets = 3;
} }
message CancelRetrieve { message CancelRetrieve {
...@@ -53,6 +54,8 @@ message CancelRetrieve { ...@@ -53,6 +54,8 @@ message CancelRetrieve {
message ReqRetrieveInfo { message ReqRetrieveInfo {
string backupAddress = 1; string backupAddress = 1;
string defaultAddress = 2; string defaultAddress = 2;
string assetExec = 3;
string assetSymbol = 4;
} }
message RetrieveQuery { message RetrieveQuery {
......
...@@ -19,11 +19,18 @@ type RetrievePrepareTx struct { ...@@ -19,11 +19,18 @@ type RetrievePrepareTx struct {
Fee int64 `json:"fee"` Fee int64 `json:"fee"`
} }
// Asset Asset
type Asset struct {
Exec string `json:"exec"`
Symbol string `json:"symbol"`
}
// RetrievePerformTx construction // RetrievePerformTx construction
type RetrievePerformTx struct { type RetrievePerformTx struct {
BackupAddr string `json:"backupAddr"` BackupAddr string `json:"backupAddr"`
DefaultAddr string `json:"defaultAddr"` DefaultAddr string `json:"defaultAddr"`
Fee int64 `json:"fee"` Assets []Asset `json:"assets"`
Fee int64 `json:"fee"`
} }
// RetrieveCancelTx construction // RetrieveCancelTx construction
......
...@@ -35,6 +35,9 @@ var ( ...@@ -35,6 +35,9 @@ var (
"Backup": RetrieveActionBackup, "Backup": RetrieveActionBackup,
"Cancel": RetrieveActionCancel, "Cancel": RetrieveActionCancel,
} }
ForkRetriveAssetX = "ForkRetriveAsset"
ForkRetriveX = "ForkRetrive"
) )
func init() { func init() {
......
This diff is collapsed.
...@@ -15,7 +15,8 @@ func init() { ...@@ -15,7 +15,8 @@ func init() {
// init executor type // init executor type
types.RegistorExecutor(RetrieveX, NewType()) types.RegistorExecutor(RetrieveX, NewType())
types.RegisterDappFork(RetrieveX, "Enable", 0) types.RegisterDappFork(RetrieveX, "Enable", 0)
types.RegisterDappFork(RetrieveX, "ForkRetrive", 180000) types.RegisterDappFork(RetrieveX, ForkRetriveX, 180000)
types.RegisterDappFork(RetrieveX, ForkRetriveAssetX, 3150000)
} }
// RetrieveType def // RetrieveType def
......
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