Commit 428c7583 authored by linj's avatar linj

make ; make fmt

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