Commit 13c2669f authored by vipwzw's avatar vipwzw

fix test

parent 8898b5a7
......@@ -7,14 +7,12 @@ package para
import (
"github.com/stretchr/testify/assert"
//"github.com/stretchr/testify/mock"
"testing"
"github.com/33cn/chain33/types"
"math/rand"
"testing"
"time"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/types"
pt "github.com/33cn/plugin/plugin/dapp/paracross/types"
)
......@@ -124,7 +122,7 @@ func createMainTx(exec string, to string) (*types.Transaction, error) {
To: to,
Amount: Amount,
Fee: 0,
Note: "test",
Note: []byte("test"),
TokenSymbol: "",
ExecName: exec,
}
......@@ -150,7 +148,7 @@ func createCrossMainTx(to string) (*types.Transaction, error) {
To: string(to),
Amount: Amount,
Fee: 0,
Note: "test asset transfer",
Note: []byte("test asset transfer"),
IsWithdraw: false,
IsToken: false,
TokenSymbol: "",
......@@ -178,7 +176,7 @@ func createCrossParaTx(to string, amount int64) (*types.Transaction, error) {
To: string(to),
Amount: amount,
Fee: 0,
Note: "test asset transfer",
Note: []byte("test asset transfer"),
IsWithdraw: false,
IsToken: false,
TokenSymbol: "",
......
......@@ -149,7 +149,7 @@ func SendToAddress(from string, to string, amount string, note string) {
return
}
amountInt64 := int64(amountFloat64 * 1e4)
tx := &types.ReqWalletSendToAddress{From: from, To: to, Amount: amountInt64 * 1e4, Note: note}
tx := &types.ReqWalletSendToAddress{From: from, To: to, Amount: amountInt64 * 1e4, Note: []byte(note)}
reply, err := c.SendToAddress(context.Background(), tx)
if err != nil {
......
......@@ -190,7 +190,7 @@ func createAssetTransferTx(s suite.Suite, privFrom string, to []byte) (*types.Tr
To: string(to),
Amount: Amount,
Fee: 0,
Note: "test asset transfer",
Note: []byte("test asset transfer"),
IsWithdraw: false,
IsToken: false,
TokenSymbol: "",
......@@ -294,7 +294,7 @@ func createAssetTransferTokenTx(s suite.Suite, privFrom string, to []byte) (*typ
To: string(to),
Amount: Amount,
Fee: 0,
Note: "test asset transfer",
Note: []byte("test asset transfer"),
IsWithdraw: false,
IsToken: false,
TokenSymbol: TestSymbol,
......
......@@ -252,7 +252,7 @@ func createAssetWithdrawTx(s suite.Suite, privFrom string, to []byte) (*types.Tr
To: string(to),
Amount: Amount,
Fee: 0,
Note: "test asset transfer",
Note: []byte("test asset transfer"),
IsWithdraw: true,
IsToken: false,
TokenSymbol: "",
......
......@@ -467,7 +467,7 @@ func createCrossMainTx(to []byte) (*types.Transaction, error) {
To: string(to),
Amount: Amount,
Fee: 0,
Note: "test asset transfer",
Note: []byte("test asset transfer"),
IsWithdraw: false,
IsToken: false,
TokenSymbol: "",
......@@ -495,7 +495,7 @@ func createCrossParaTx(s suite.Suite, to []byte) (*types.Transaction, error) {
To: string(to),
Amount: Amount,
Fee: 0,
Note: "test asset transfer",
Note: []byte("test asset transfer"),
IsWithdraw: false,
IsToken: false,
TokenSymbol: "",
......
......@@ -204,7 +204,7 @@ func (mock *PrivacyMock) createPublic2PrivacyTx(req *types.ReqCreateTransaction)
value := &ty.Public2Privacy{
Tokenname: req.Tokenname,
Amount: amount,
Note: req.GetNote(),
Note: string(req.GetNote()),
Output: privacyOutput,
}
action := &ty.PrivacyAction{
......
......@@ -6,18 +6,13 @@ package executor
import (
"context"
//crand "crypto/rand"
//"encoding/json"
"errors"
"fmt"
"math/rand"
"strconv"
//"strings"
"testing"
"time"
//"github.com/golang/protobuf/proto"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/common/crypto"
......@@ -243,7 +238,7 @@ func TestTransferToken(t *testing.T) {
fmt.Println("TestTransferToken start")
defer fmt.Println("TestTransferToken end")
v := &tokenty.TokenAction_Transfer{Transfer: &types.AssetsTransfer{Cointoken: tokenSym, Amount: transAmount, Note: "", To: transToAddr}}
v := &tokenty.TokenAction_Transfer{Transfer: &types.AssetsTransfer{Cointoken: tokenSym, Amount: transAmount, Note: []byte(""), To: transToAddr}}
transfer := &tokenty.TokenAction{Value: v, Ty: tokenty.ActionTransfer}
tx := &types.Transaction{Execer: []byte(execName), Payload: types.Encode(transfer), Fee: fee, To: addrexec}
......
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