Commit 3c8ce68e authored by suyanlong's avatar suyanlong

fix bug for execname

parent efaabcdc
...@@ -2,12 +2,13 @@ package paracross ...@@ -2,12 +2,13 @@ package paracross
import ( import (
"encoding/base64" "encoding/base64"
"testing"
"github.com/33cn/chain33/common/address" "github.com/33cn/chain33/common/address"
_ "github.com/33cn/chain33/system/address" _ "github.com/33cn/chain33/system/address"
"github.com/meshplus/bitxhub-kit/hexutil" "github.com/meshplus/bitxhub-kit/hexutil"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"gitlab.33.cn/link33/sidecar-client-chain33/util" "gitlab.33.cn/link33/sidecar-client-chain33/util"
"testing"
) )
func TestAddress(t *testing.T) { func TestAddress(t *testing.T) {
...@@ -44,5 +45,5 @@ func TestAddress(t *testing.T) { ...@@ -44,5 +45,5 @@ func TestAddress(t *testing.T) {
//"chainID": 999 //"chainID": 999
//} //}
//0a17757365722e702e7375706572782e7061726163726f7373126b10914e2a661080ade2041a22757365722e702e7375706572782e7061726163726f73732d3e7061726163726f73732217757365722e702e7375706572782e7061726163726f73732a223132647945773244653236445a4836626e576731704e78373246695069724e6b54551a6d080112210278ba706d605cbdb0d517e2b38f93711421b29f5d75b9ba4e0ac1aec2ba4a37ce1a46304402207017f4439162c8873ae04513c9079ede055e9a90fe5b5817995b481bba1bc5ea022067399d5461fe597fe65a27d46bad83a9134247783fdcf731ad90aa777b4be2f920b0db06308a8c948ce3e4bcee7b3a2a30783064323465323133666637356231323536613063613861633466323639316637663830303539316158e707 // 0a17757365722e702e7375706572782e7061726163726f7373126b10914e2a661080ade2041a22757365722e702e7375706572782e7061726163726f73732d3e7061726163726f73732217757365722e702e7375706572782e7061726163726f73732a223132647945773244653236445a4836626e576731704e78373246695069724e6b54551a6d080112210278ba706d605cbdb0d517e2b38f93711421b29f5d75b9ba4e0ac1aec2ba4a37ce1a46304402207017f4439162c8873ae04513c9079ede055e9a90fe5b5817995b481bba1bc5ea022067399d5461fe597fe65a27d46bad83a9134247783fdcf731ad90aa777b4be2f920b0db06308a8c948ce3e4bcee7b3a2a30783064323465323133666637356231323536613063613861633466323639316637663830303539316158e707
//0a17757365722e702e7375706572782e7061726163726f7373128f0210914e2a89021080b6dc051ac4010a4230783431393136663731336163666133303530306664646466343965613964656238383365303765373939303933666532376665353138336562346266303063653810e4a18b071a380a0130120665766d78676f1a2231365542505734757836484e6451444a7051416570746d454c7070414d393642316722074275726e4d6170223f080352223136506d6579745938435533414634554238377872717177637368587047785367375880b6dc05620359434370e4a18b07789bff8aa2a4d0eab9162217757365722e702e7375706572782e7061726163726f73732a223136506d6579745938435533414634554238377872717177637368587047785367371a6d08011221023d0c50b1241042ed0bf4a36e8c9fa281ddbc3d7aae298d00a99033bea6489db91a46304402201b5b83a73564131a5c0950765c3faf7e5fa67aa9f8026db8aa4b2cfa851122fa02203ebcec01bd11a5621b9d63724c2a332fed2b0cc6458ba3ef95ebbbdffa1cd29e20a08d06309bff8aa2a4d0eab9163a2a30783064323445323133666637354231323536613043413861633466323639314637663830303539316158e707 // 0a17757365722e702e7375706572782e7061726163726f7373128f0210914e2a89021080b6dc051ac4010a4230783431393136663731336163666133303530306664646466343965613964656238383365303765373939303933666532376665353138336562346266303063653810e4a18b071a380a0130120665766d78676f1a2231365542505734757836484e6451444a7051416570746d454c7070414d393642316722074275726e4d6170223f080352223136506d6579745938435533414634554238377872717177637368587047785367375880b6dc05620359434370e4a18b07789bff8aa2a4d0eab9162217757365722e702e7375706572782e7061726163726f73732a223136506d6579745938435533414634554238377872717177637368587047785367371a6d08011221023d0c50b1241042ed0bf4a36e8c9fa281ddbc3d7aae298d00a99033bea6489db91a46304402201b5b83a73564131a5c0950765c3faf7e5fa67aa9f8026db8aa4b2cfa851122fa02203ebcec01bd11a5621b9d63724c2a332fed2b0cc6458ba3ef95ebbbdffa1cd29e20a08d06309bff8aa2a4d0eab9163a2a30783064323445323133666637354231323536613043413861633466323639314637663830303539316158e707
...@@ -72,6 +72,7 @@ type Paracross struct { ...@@ -72,6 +72,7 @@ type Paracross struct {
heightDiff int64 // 高度差 heightDiff int64 // 高度差
step int64 step int64
execAddress string execAddress string
chain33Config *config.Config
isTest bool isTest bool
logger hclog.InterceptLogger logger hclog.InterceptLogger
...@@ -125,6 +126,7 @@ func (p *Paracross) Initialize(configPath string, ID string, extra []byte) error ...@@ -125,6 +126,7 @@ func (p *Paracross) Initialize(configPath string, ID string, extra []byte) error
if err != nil { if err != nil {
return fmt.Errorf("unmarshal config for plugin :%w", err) return fmt.Errorf("unmarshal config for plugin :%w", err)
} }
p.chain33Config = chain33Config
out, err := log.Initialize( out, err := log.Initialize(
log.WithReportCaller(chain33Config.Log.ReportCaller == true), log.WithReportCaller(chain33Config.Log.ReportCaller == true),
log.WithPersist(true), log.WithPersist(true),
...@@ -714,14 +716,20 @@ func (p *Paracross) SubmitIBTP(ibtp *pb.IBTP) (*pb.SubmitIBTPResponse, error) { ...@@ -714,14 +716,20 @@ func (p *Paracross) SubmitIBTP(ibtp *pb.IBTP) (*pb.SubmitIBTPResponse, error) {
if event.Payload.EventType == types.EventType_Burn { if event.Payload.EventType == types.EventType_Burn {
// 用户在联盟链一侧发起销毁。 // 用户在联盟链一侧发起销毁。
// 第一次提交。 // 第一次提交。
TokenSymbol := "" // TODO 销毁bty时,不要填写!!!
ExecName := p.title + execer // TODO 平行链执行器。
if strings.ToUpper(p.chain33Config.Chain33.Symbol) == "YCC" {
ExecName = "coins"
TokenSymbol = "ycc"
}
tx, err := p.CreateRawAssetTransferTxExt(&types33.CreateTx{ tx, err := p.CreateRawAssetTransferTxExt(&types33.CreateTx{
To: event.Payload.BurnAddress, To: event.Payload.BurnAddress,
Amount: event.Payload.BurnAmount, Amount: event.Payload.BurnAmount,
Fee: p.MinTxFeeRate, Fee: p.MinTxFeeRate,
Note: payload.Content, // 关联数据 Note: payload.Content, // 关联数据
IsWithdraw: true, IsWithdraw: true,
// TokenSymbol: event.Payload.Symbol, // TODO 销毁bty时,不要填写!!! TokenSymbol: TokenSymbol, // TODO 销毁bty时,不要填写!!!
ExecName: p.title + execer, // TODO 平行链执行器。 ExecName: ExecName, // TODO 平行链执行器。
}) })
if err != nil { if err != nil {
p.logger.Error("CreateRawAssetTransferTxExt error", "error", err) p.logger.Error("CreateRawAssetTransferTxExt error", "error", err)
......
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