Commit 0b169565 authored by hezhengjun's avatar hezhengjun

correct event type to ClaimTypeWithdraw

parent 165af6d9
...@@ -814,7 +814,7 @@ func (ethRelayer *Relayer4Ethereum) newTx(from, to common.Address, input []byte, ...@@ -814,7 +814,7 @@ func (ethRelayer *Relayer4Ethereum) newTx(from, to common.Address, input []byte,
func (ethRelayer *Relayer4Ethereum) handleLogLockBurn(chain33Msg *events.Chain33Msg) { func (ethRelayer *Relayer4Ethereum) handleLogLockBurn(chain33Msg *events.Chain33Msg) {
//对于通过代理人登录的中继器,不处理lock和burn事件 //对于通过代理人登录的中继器,不处理lock和burn事件
if ethRelayer.processWithDraw { if ethRelayer.processWithDraw {
relayerLog.Info("handleLogWithdraw", "Needn't process lock and burn for this withdraw process specified validator", ethRelayer.ethSender) relayerLog.Info("handleLogLockBurn", "Needn't process lock and burn for this withdraw process specified validator", ethRelayer.ethSender)
return return
} }
relayerLog.Info("handleLogLockBurn", "Received chain33Msg", chain33Msg, "tx hash string", common.Bytes2Hex(chain33Msg.TxHash)) relayerLog.Info("handleLogLockBurn", "Received chain33Msg", chain33Msg, "tx hash string", common.Bytes2Hex(chain33Msg.TxHash))
......
...@@ -51,13 +51,13 @@ type LockEventOnChain33 struct { ...@@ -51,13 +51,13 @@ type LockEventOnChain33 struct {
// 发生在chain33 evm上的withdraw事件,当用户发起通过代理人提币交易时,则弹射出该事件信息 // 发生在chain33 evm上的withdraw事件,当用户发起通过代理人提币交易时,则弹射出该事件信息
type WithdrawEventOnChain33 struct { type WithdrawEventOnChain33 struct {
BridgeToken chain33EvmCommon.Hash160Address BridgeToken chain33EvmCommon.Hash160Address
Symbol string Symbol string
Amount *big.Int Amount *big.Int
OwnerFrom chain33EvmCommon.Hash160Address OwnerFrom chain33EvmCommon.Hash160Address
EthereumReceiver []byte EthereumReceiver []byte
ProxyReceiver chain33EvmCommon.Hash160Address ProxyReceiver chain33EvmCommon.Hash160Address
Nonce *big.Int Nonce *big.Int
} }
// 发生在chain33evm上的burn事件,当eth/erc20资产需要提币回到以太坊链上时,会发生该种事件 // 发生在chain33evm上的burn事件,当eth/erc20资产需要提币回到以太坊链上时,会发生该种事件
...@@ -125,8 +125,6 @@ func UnpackLogWithdraw(contractAbi abi.ABI, eventName string, eventData []byte) ...@@ -125,8 +125,6 @@ func UnpackLogWithdraw(contractAbi abi.ABI, eventName string, eventData []byte)
return withdrawEvent, nil return withdrawEvent, nil
} }
// ParseBurnLock4chain33 ParseBurnLockTxReceipt : parses data from a Burn/Lock/Withdraw event witnessed on chain33 into a Chain33Msg struct // ParseBurnLock4chain33 ParseBurnLockTxReceipt : parses data from a Burn/Lock/Withdraw event witnessed on chain33 into a Chain33Msg struct
func ParseBurnLock4chain33(evmEventType Chain33EvmEvent, data []byte, bridgeBankAbi abi.ABI, chain33TxHash []byte) (*Chain33Msg, error) { func ParseBurnLock4chain33(evmEventType Chain33EvmEvent, data []byte, bridgeBankAbi abi.ABI, chain33TxHash []byte) (*Chain33Msg, error) {
if Chain33EventLogLock == evmEventType { if Chain33EventLogLock == evmEventType {
...@@ -171,7 +169,7 @@ func ParseBurnLock4chain33(evmEventType Chain33EvmEvent, data []byte, bridgeBank ...@@ -171,7 +169,7 @@ func ParseBurnLock4chain33(evmEventType Chain33EvmEvent, data []byte, bridgeBank
} }
chain33Msg := &Chain33Msg{ chain33Msg := &Chain33Msg{
ClaimType: ClaimTypeBurn, ClaimType: ClaimTypeWithdraw,
Chain33Sender: burnEvent.OwnerFrom.ToAddress(), Chain33Sender: burnEvent.OwnerFrom.ToAddress(),
EthereumReceiver: common.BytesToAddress(burnEvent.EthereumReceiver), EthereumReceiver: common.BytesToAddress(burnEvent.EthereumReceiver),
TokenContractAddress: burnEvent.BridgeToken.ToAddress(), TokenContractAddress: burnEvent.BridgeToken.ToAddress(),
......
...@@ -31,5 +31,5 @@ func (d Event) String() string { ...@@ -31,5 +31,5 @@ func (d Event) String() string {
} }
func (d ClaimType) String() string { func (d ClaimType) String() string {
return [...]string{"unknown-LOG", "burn", "lock"}[d] return [...]string{"unknown-LOG", "burn", "lock", "withdraw"}[d]
} }
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