Commit b8780cef authored by suyanlong's avatar suyanlong

fix paracross exec address bug

parent 5d8d0160
...@@ -9,6 +9,8 @@ import ( ...@@ -9,6 +9,8 @@ import (
"strings" "strings"
"time" "time"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/address" "github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/common/db" "github.com/33cn/chain33/common/db"
types33 "github.com/33cn/chain33/types" types33 "github.com/33cn/chain33/types"
...@@ -565,7 +567,7 @@ func (e *Evmxgo) SubmitIBTP(ibtp *pb.IBTP) (*pb.SubmitIBTPResponse, error) { ...@@ -565,7 +567,7 @@ func (e *Evmxgo) SubmitIBTP(ibtp *pb.IBTP) (*pb.SubmitIBTPResponse, error) {
tx.Nonce = int64(ibtp.Nonce) tx.Nonce = int64(ibtp.Nonce)
res, err := e.client.SendTransactionSync(e.pk, tx) // TODO why use async? res, err := e.client.SendTransactionSync(e.pk, tx) // TODO why use async?
if err != nil { if err != nil {
e.logger.Error("e.client.SendTransactionSync(e.pk,tx)", "error", err) e.logger.Error("e.client.SendTransactionSync(e.pk,tx)", "hash", common.HashHex(tx.Hash()), "error", err)
return nil, err return nil, err
} }
ibtpRes := &pb.SubmitIBTPResponse{} ibtpRes := &pb.SubmitIBTPResponse{}
......
...@@ -12,7 +12,7 @@ fee = 100000 ...@@ -12,7 +12,7 @@ fee = 100000
#被监听链ID #被监听链ID
chain_id = 0 chain_id = 0
step = 10 step = 10
symbol = "bty" symbol = "BTY"
[log] [log]
#日志级别 #日志级别
......
...@@ -17,6 +17,7 @@ import ( ...@@ -17,6 +17,7 @@ import (
"github.com/33cn/chain33/common/crypto" "github.com/33cn/chain33/common/crypto"
"github.com/33cn/chain33/common/db" "github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/rpc/grpcclient" "github.com/33cn/chain33/rpc/grpcclient"
_ "github.com/33cn/chain33/system/address"
types33 "github.com/33cn/chain33/types" types33 "github.com/33cn/chain33/types"
util33 "github.com/33cn/chain33/util" util33 "github.com/33cn/chain33/util"
"github.com/33cn/plugin/plugin/dapp/paracross/executor" "github.com/33cn/plugin/plugin/dapp/paracross/executor"
...@@ -169,6 +170,7 @@ func (p *Paracross) Initialize(configPath string, ID string, extra []byte) error ...@@ -169,6 +170,7 @@ func (p *Paracross) Initialize(configPath string, ID string, extra []byte) error
} else { } else {
p.execAddress = address.ExecAddress(ID) p.execAddress = address.ExecAddress(ID)
} }
p.logger.Info("print execAddress", "execAddress", p.execAddress)
config33 = fmt.Sprintf(config33, p.title, chain33Config.Chain33.Addr) config33 = fmt.Sprintf(config33, p.title, chain33Config.Chain33.Addr)
p.logger.Info(config33) p.logger.Info(config33)
...@@ -729,7 +731,7 @@ func (p *Paracross) SubmitIBTP(ibtp *pb.IBTP) (*pb.SubmitIBTPResponse, error) { ...@@ -729,7 +731,7 @@ func (p *Paracross) SubmitIBTP(ibtp *pb.IBTP) (*pb.SubmitIBTPResponse, error) {
tx.Sign(types33.SECP256K1, p.privateKey) tx.Sign(types33.SECP256K1, p.privateKey)
ret, err := p.grpcClient.SendTransaction(p.ctx, tx) ret, err := p.grpcClient.SendTransaction(p.ctx, tx)
if err != nil { if err != nil {
p.logger.Error("SendTransaction ", "error", err) p.logger.Error("SendTransaction ", "hash", common.HashHex(tx.Hash()), "error", err)
return nil, err return nil, err
} }
ibtpRes.Result = ibtp ibtpRes.Result = ibtp
...@@ -739,7 +741,7 @@ func (p *Paracross) SubmitIBTP(ibtp *pb.IBTP) (*pb.SubmitIBTPResponse, error) { ...@@ -739,7 +741,7 @@ func (p *Paracross) SubmitIBTP(ibtp *pb.IBTP) (*pb.SubmitIBTPResponse, error) {
ibtpRes.Status = true ibtpRes.Status = true
} else { } else {
ibtpRes.Status = false ibtpRes.Status = false
p.logger.Error("SendTransaction error", "msg", string(ret.Msg)) p.logger.Error("SendTransaction error", "hash", common.HashHex(tx.Hash()), "msg", string(ret.Msg))
} }
return ibtpRes, nil return ibtpRes, nil
} }
......
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