Commit b8780cef authored by suyanlong's avatar suyanlong

fix paracross exec address bug

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