Commit 13c2669f authored by vipwzw's avatar vipwzw

fix test

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