Commit 612de9e8 authored by suyanlong's avatar suyanlong

add evmxgo contract recipitent field

parent ede98301
...@@ -306,9 +306,10 @@ func (e *Evmxgo) pollAppChain() chan *types.Event { ...@@ -306,9 +306,10 @@ func (e *Evmxgo) pollAppChain() chan *types.Event {
if log.Ty == evmxgotypes.TyLogEvmxgoBurnMap { if log.Ty == evmxgotypes.TyLogEvmxgoBurnMap {
type ( type (
BurnMap struct { BurnMap struct {
Symbol string `json:"symbol,omitempty"` Symbol string `json:"symbol,omitempty"`
Amount string `json:"amount,omitempty"` Amount string `json:"amount,omitempty"`
Extra []byte `json:"extra,omitempty"` Extra []byte `json:"extra,omitempty"`
Recipient string `json:"recipient,omitempty"`
} }
Action struct { Action struct {
BurnMap *BurnMap `json:"burnMap,omitempty"` BurnMap *BurnMap `json:"burnMap,omitempty"`
...@@ -329,6 +330,10 @@ func (e *Evmxgo) pollAppChain() chan *types.Event { ...@@ -329,6 +330,10 @@ func (e *Evmxgo) pollAppChain() chan *types.Event {
e.logger.Info("printf burnEvent", "burnEvent", util.FormatJSON(action)) e.logger.Info("printf burnEvent", "burnEvent", util.FormatJSON(action))
// extra, _ := util.FromHex(burnEvent.Extra) // extra, _ := util.FromHex(burnEvent.Extra)
// 已销毁 // 已销毁
burnAddress := burnEvent.Recipient
if burnAddress == "" {
burnAddress = tx.From // 用户地址
}
event := &types.Event{ event := &types.Event{
TxID: tx.Hash, TxID: tx.Hash,
BlockNumber: uint64(item.Block.Height), BlockNumber: uint64(item.Block.Height),
...@@ -340,7 +345,7 @@ func (e *Evmxgo) pollAppChain() chan *types.Event { ...@@ -340,7 +345,7 @@ func (e *Evmxgo) pollAppChain() chan *types.Event {
}, },
Payload: &types.MapAssetInfo{ Payload: &types.MapAssetInfo{
EventType: types.EventType_Burn, EventType: types.EventType_Burn,
BurnAddress: tx.From, // 用户地址 BurnAddress: burnAddress,
BurnAmount: cast.ToInt64(burnEvent.Amount), BurnAmount: cast.ToInt64(burnEvent.Amount),
Symbol: types.Symbol(burnEvent.Symbol), Symbol: types.Symbol(burnEvent.Symbol),
Height: height1, Height: height1,
......
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