Commit 5d527518 authored by vipwzw's avatar vipwzw

auto ci

parent 3ffe01ad
......@@ -348,7 +348,6 @@ func jsonOutput(resp types.Message) {
fmt.Println(buf.String())
}
func listUnfreezeCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "list",
......@@ -359,7 +358,6 @@ func listUnfreezeCmd() *cobra.Command {
cmd.Flags().Int32P("count", "", 10, "list count")
cmd.Flags().Int32P("direction", "d", 0, "list direction: 0/1")
cmd.Flags().StringP("create", "c", "", "list by creator")
cmd.Flags().StringP("beneficiary", "b", "", "list by beneficiary")
......@@ -381,16 +379,16 @@ func listUnfreeze(cmd *cobra.Command, args []string) {
funcName = "ListUnfreezeByCreator"
}
direction, err := cmd.Flags().GetInt32("direction")
count, _ := cmd.Flags().GetInt32("count")
last_key, _ := cmd.Flags().GetString("last_key")
direction, err := cmd.Flags().GetInt32("direction")
count, _ := cmd.Flags().GetInt32("count")
last_key, _ := cmd.Flags().GetString("last_key")
req := &pty.ReqUnfreezes{
Direction: direction,
Count: count,
FromKey: last_key,
Initiator: create,
Beneficiary: beneficiary,
Direction: direction,
Count: count,
FromKey: last_key,
Initiator: create,
Beneficiary: beneficiary,
}
param := &rpctypes.Query4Jrpc{
......
......@@ -5,9 +5,9 @@
package executor
import (
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
uf "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/system/dapp"
)
func (u *Unfreeze) execDelLocal(receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
......
......@@ -5,9 +5,9 @@
package executor
import (
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
uf "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/system/dapp"
)
func (u *Unfreeze) execLocal(receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
......@@ -37,8 +37,8 @@ func (u *Unfreeze) execLocal(receiptData *types.ReceiptData, index int) (*types.
return nil, err
}
u := uf.LocalUnfreeze{
Unfreeze: receipt.Current,
TxIndex: txIndex,
Unfreeze: receipt.Current,
TxIndex: txIndex,
}
err = table.Add(&u)
if err != nil {
......
......@@ -77,7 +77,7 @@ func NewAddrTable(kvdb dbm.KV) *table.Table {
return t
}
func update(ldb *table.Table, unfreeze *pty.Unfreeze) (error) {
func update(ldb *table.Table, unfreeze *pty.Unfreeze) error {
xs, err := ldb.ListIndex("id", []byte(unfreeze.UnfreezeID), nil, 1, 0)
if err != nil || len(xs) != 1 {
return nil
......@@ -91,7 +91,6 @@ func update(ldb *table.Table, unfreeze *pty.Unfreeze) (error) {
return ldb.Update([]byte(u.TxIndex), u)
}
func list(db dbm.KVDB, indexName string, data *pty.LocalUnfreeze, count, direction int32) ([]*table.Row, error) {
query := NewAddrTable(db).GetQuery(db)
var primary []byte
......
......@@ -97,7 +97,6 @@ func withdraw(unfreeze *pty.Unfreeze, frozen int64) (*pty.Unfreeze, int64) {
return unfreeze, amount
}
type fixAmountV2 struct {
}
......
......@@ -8,9 +8,9 @@ import (
"time"
dbm "github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/common/db/table"
"github.com/33cn/chain33/types"
pty "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/common/db/table"
)
// Query_GetUnfreezeWithdraw 查询合约可提币量
......@@ -87,7 +87,7 @@ func ListUnfreezeByCreator(ldb dbm.KVDB, req *pty.ReqUnfreezes) (types.Message,
rows, err := list(ldb, "init", u, req.Count, req.Direction)
if err != nil {
uflog.Error("ListUnfreezeByCreator ", "err", err, "params", req)
uflog.Error("ListUnfreezeByCreator ", "err", err, "params", req)
return nil, err
}
......@@ -107,7 +107,7 @@ func ListUnfreezeByBeneficiary(ldb dbm.KVDB, req *pty.ReqUnfreezes) (types.Messa
rows, err := list(ldb, "beneficiary", u, req.Count, req.Direction)
if err != nil {
uflog.Error("ListUnfreezeByBeneficiary ", "err", err, "params", req)
uflog.Error("ListUnfreezeByBeneficiary ", "err", err, "params", req)
return nil, err
}
......@@ -119,21 +119,21 @@ func fmtLocalUnfreeze(rows []*table.Row) (*pty.ReplyUnfreezes, error) {
for _, row := range rows {
r, ok := row.Data.(*pty.LocalUnfreeze)
if !ok {
uflog.Error("ListUnfreeze", "err", "bad row type")
uflog.Error("ListUnfreeze", "err", "bad row type")
return nil, types.ErrDecode
}
v := &pty.ReplyUnfreeze{
UnfreezeID: r.Unfreeze.UnfreezeID,
StartTime: r.Unfreeze.StartTime,
AssetExec: r.Unfreeze.AssetExec,
AssetSymbol: r.Unfreeze.AssetSymbol,
TotalCount: r.Unfreeze.TotalCount,
Initiator: r.Unfreeze.Initiator,
Beneficiary: r.Unfreeze.Beneficiary,
Remaining: r.Unfreeze.Remaining,
Means: r.Unfreeze.Means,
Terminated: r.Unfreeze.Terminated,
Key: r.TxIndex,
v := &pty.ReplyUnfreeze{
UnfreezeID: r.Unfreeze.UnfreezeID,
StartTime: r.Unfreeze.StartTime,
AssetExec: r.Unfreeze.AssetExec,
AssetSymbol: r.Unfreeze.AssetSymbol,
TotalCount: r.Unfreeze.TotalCount,
Initiator: r.Unfreeze.Initiator,
Beneficiary: r.Unfreeze.Beneficiary,
Remaining: r.Unfreeze.Remaining,
Means: r.Unfreeze.Means,
Terminated: r.Unfreeze.Terminated,
Key: r.TxIndex,
}
if v.Means == pty.FixAmountX {
v.MeansOpt = &pty.ReplyUnfreeze_FixAmount{FixAmount: r.Unfreeze.GetFixAmount()}
......
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