Commit 7968566c authored by suyanlong's avatar suyanlong

Update paracross

parent 060c3c67
...@@ -334,7 +334,7 @@ func (e *Evmxgo) pollAppChain() chan *types.Event { ...@@ -334,7 +334,7 @@ func (e *Evmxgo) pollAppChain() chan *types.Event {
burnEvent := action.BurnMap burnEvent := action.BurnMap
e.logger.Info("printf burnEvent", "burnEvent", util.FormatJSON(action)) e.logger.Info("printf burnEvent", "burnEvent", util.FormatJSON(action))
//销毁指定的token // 销毁指定的token
if strings.ToLower(burnEvent.Symbol) == strings.ToLower(e.config.Chain33.Symbol) { if strings.ToLower(burnEvent.Symbol) == strings.ToLower(e.config.Chain33.Symbol) {
// extra, _ := util.FromHex(burnEvent.Extra) // extra, _ := util.FromHex(burnEvent.Extra)
// 已销毁 // 已销毁
......
...@@ -163,9 +163,9 @@ func (p *Paracross) Initialize(configPath string, ID string, extra []byte) error ...@@ -163,9 +163,9 @@ func (p *Paracross) Initialize(configPath string, ID string, extra []byte) error
p.MinTxFeeRate = chain33Config.Chain33.Fee p.MinTxFeeRate = chain33Config.Chain33.Fee
p.isTest = chain33Config.Chain33.IsTest p.isTest = chain33Config.Chain33.IsTest
p.paraHeight = atomic.NewInt64(-1) p.paraHeight = atomic.NewInt64(-1)
//判断执行器地址类型 // 判断执行器地址类型
if strings.ToUpper(chain33Config.Chain33.Symbol) == "YCC" { if strings.ToUpper(chain33Config.Chain33.Symbol) == "YCC" {
//执行器地址类型,YCC是以太坊地址类型。 // 执行器地址类型,YCC是以太坊地址类型。
execAddress, err := address.GetExecAddress(p.title+execer, 2) execAddress, err := address.GetExecAddress(p.title+execer, 2)
if err != nil { if err != nil {
return errors.Wrap(err, "execAddress") return errors.Wrap(err, "execAddress")
...@@ -728,21 +728,21 @@ func (p *Paracross) SubmitIBTP(ibtp *pb.IBTP) (*pb.SubmitIBTPResponse, error) { ...@@ -728,21 +728,21 @@ 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 := "" tokenSymbol := p.chain33Config.Chain33.Symbol
if strings.ToUpper(p.chain33Config.Chain33.Symbol) == "YCC" { symbol := strings.ToLower(p.chain33Config.Chain33.Symbol)
//主链的token映射到平行链: coins.xxx if symbol == "ycc" || symbol == "bty" {
TokenSymbol = "coins.ycc" // 主链的token映射到平行链: coins.xxx
} else { tokenSymbol = fmt.Sprintf("coins.%s", symbol)
TokenSymbol = "coins.bty"
} }
p.logger.Info("SendTransaction ", "TokenSymbol", TokenSymbol)
p.logger.Info("SendTransaction ", "TokenSymbol", tokenSymbol)
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: TokenSymbol, TokenSymbol: tokenSymbol,
ExecName: p.title + execer, ExecName: p.title + execer,
}) })
p.logger.Info("SendTransaction ", "tx", tx) p.logger.Info("SendTransaction ", "tx", tx)
......
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