Commit 428c7583 authored by linj's avatar linj

make ; make fmt

parent 5f25c6a4
......@@ -8,13 +8,15 @@ import (
"encoding/hex"
"encoding/json"
"fmt"
"github.com/spf13/cobra"
"github.com/33cn/chain33/rpc/jsonclient"
"os"
"strings"
pty "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/rpc/jsonclient"
rpctypes "github.com/33cn/chain33/rpc/types"
"github.com/spf13/cobra"
"github.com/33cn/chain33/types"
pty "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
)
func Cmd() *cobra.Command {
......@@ -230,10 +232,10 @@ func queryWithdraw(cmd *cobra.Command, args []string) {
return
}
param := &types.Query4Cli{
param := &rpctypes.Query4Jrpc{
Execer: getRealExecName(paraName, pty.UnfreezeX),
FuncName: "QueryWithdraw",
Payload: types.ReqString{Data: id},
Payload: types.MustPBToJSON(&types.ReqString{Data: id}),
}
var resp pty.ReplyQueryUnfreezeWithdraw
err = cli.Call("Chain33.Query", param, &resp)
......@@ -260,10 +262,10 @@ func show(cmd *cobra.Command, args []string) {
return
}
param := &types.Query4Cli{
param := &rpctypes.Query4Jrpc{
Execer: getRealExecName(paraName, pty.UnfreezeX),
FuncName: "GetUnfreeze",
Payload: types.ReqString{Data: id},
Payload: types.MustPBToJSON(&types.ReqString{Data: id}),
}
var resp pty.Unfreeze
err = cli.Call("Chain33.Query", param, &resp)
......
......@@ -7,9 +7,9 @@ package executor
import (
"github.com/33cn/chain33/account"
dbm "github.com/33cn/chain33/common/db"
pty "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
pty "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
)
func (u *Unfreeze) Exec_Create(payload *pty.UnfreezeCreate, tx *types.Transaction, index int) (*types.Receipt, error) {
......@@ -145,7 +145,8 @@ func (u *Unfreeze) create(unfreeze *pty.Unfreeze) (*types.Receipt, error) {
}
receiptLog := getUnfreezeLog(nil, unfreeze)
return &types.Receipt{KV: []*types.KeyValue{{k, v}}, Logs: []*types.ReceiptLog{receiptLog}}, nil
return &types.Receipt{Ty: types.ExecOk,
KV: []*types.KeyValue{{Key: k, Value: v}}, Logs: []*types.ReceiptLog{receiptLog}}, nil
}
func MergeReceipt(r1 *types.Receipt, r2 *types.Receipt) (*types.Receipt, error) {
......@@ -185,7 +186,7 @@ func (u *Unfreeze) withdraw(unfreeze *pty.Unfreeze) (int64, *types.Receipt, erro
return 0, nil, err
}
return amount, &types.Receipt{Ty: types.ExecOk, KV: []*types.KeyValue{{k, v}},
return amount, &types.Receipt{Ty: types.ExecOk, KV: []*types.KeyValue{{Key: k, Value: v}},
Logs: []*types.ReceiptLog{receiptLog}}, nil
}
......@@ -207,7 +208,7 @@ func (u *Unfreeze) terminator(unfreeze *pty.Unfreeze) (int64, *types.Receipt, er
return 0, nil, err
}
return amount, &types.Receipt{Ty: types.ExecOk, KV: []*types.KeyValue{{k, v}},
return amount, &types.Receipt{Ty: types.ExecOk, KV: []*types.KeyValue{{Key: k, Value: v}},
Logs: []*types.ReceiptLog{receiptLog}}, nil
}
......
......@@ -5,8 +5,8 @@
package executor
import (
uf "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/types"
uf "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
)
func (u *Unfreeze) execDelLocal(receiptData *types.ReceiptData) (*types.LocalDBSet, error) {
......
......@@ -5,8 +5,8 @@
package executor
import (
uf "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/types"
uf "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
)
func (u *Unfreeze) execLocal(receiptData *types.ReceiptData) (*types.LocalDBSet, error) {
......@@ -44,8 +44,8 @@ func (u *Unfreeze) ExecLocal_Terminate(payload *uf.UnfreezeTerminate, tx *types.
}
func localKeys(res *uf.ReceiptUnfreeze, value []byte) (kvs []*types.KeyValue) {
kvs = append(kvs, &types.KeyValue{initKey(res.Current.Initiator), value})
kvs = append(kvs, &types.KeyValue{beneficiaryKey(res.Current.Beneficiary), value})
kvs = append(kvs, &types.KeyValue{Key: initKey(res.Current.Initiator), Value: value})
kvs = append(kvs, &types.KeyValue{Key: beneficiaryKey(res.Current.Beneficiary), Value: value})
return
}
......
......@@ -5,16 +5,17 @@
package executor
import (
"github.com/stretchr/testify/assert"
"testing"
"github.com/stretchr/testify/assert"
"github.com/33cn/chain33/account"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/common/crypto"
dbm "github.com/33cn/chain33/common/db"
pty "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/types"
pty "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
)
type execEnv struct {
......
......@@ -5,8 +5,8 @@
package executor
import (
pty "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/types"
pty "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
)
type Means interface {
......
......@@ -8,8 +8,8 @@ import (
"time"
dbm "github.com/33cn/chain33/common/db"
pty "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/types"
pty "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
)
func (u *Unfreeze) Query_GetUnfreezeWithdraw(in *types.ReqString) (types.Message, error) {
......
......@@ -6,9 +6,9 @@ package executor
import (
log "github.com/33cn/chain33/common/log/log15"
uf "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
drivers "github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
uf "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
)
var uflog = log.New("module", "execs.unfreeze")
......
......@@ -5,11 +5,11 @@
package unfreeze
import (
"github.com/33cn/chain33/pluginmgr"
"github.com/33cn/plugin/plugin/dapp/unfreeze/commands"
"github.com/33cn/plugin/plugin/dapp/unfreeze/executor"
"github.com/33cn/plugin/plugin/dapp/unfreeze/rpc"
uf "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/pluginmgr"
)
func init() {
......
......@@ -7,8 +7,9 @@ package rpc
import (
"context"
"encoding/hex"
pty "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/types"
pty "github.com/33cn/plugin/plugin/dapp/unfreeze/types"
)
func (c *channelClient) GetUnfreeze(ctx context.Context, in *types.ReqString) (*pty.Unfreeze, error) {
......
......@@ -10,8 +10,8 @@ import (
"reflect"
"time"
log "github.com/33cn/chain33/common/log/log15"
"github.com/33cn/chain33/common/address"
log "github.com/33cn/chain33/common/log/log15"
"github.com/33cn/chain33/types"
)
......
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