Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed Feb 15, 2024
1 parent 5e5e25d commit aaea061
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion common/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func DecodeBtcAddress(inputAddress string, chainID int64) (address btcutil.Addre
}
address, err = btcutil.DecodeAddress(inputAddress, chainParams)
if err != nil {
return nil, fmt.Errorf("decode address failed: %s", err.Error())
return nil, fmt.Errorf("decode address failed: %s , for input address %s", err.Error(), inputAddress)
}
ok := address.IsForNet(chainParams)
if !ok {
Expand Down
16 changes: 5 additions & 11 deletions x/crosschain/keeper/evm_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,10 @@ func (k Keeper) ProcessLogs(ctx sdk.Context, logs []*ethtypes.Log, emittingContr
if err := k.ProcessZRC20WithdrawalEvent(ctx, eventWithdrawal, emittingContract, txOrigin); err != nil {
return err
}
}
// We were able to parse the ZRC20 withdrawal event. However, we were unable to process it as the information was incorrect
// This means that there are some funds locked in the contract which cannot have an outbound , this can be a candidate for a refund
// TODO : Consider returning error or auto refunding the funds to the user
if eventWithdrawal != nil {
// We were able to parse the ZRC20 withdrawal event. However, we were unable to process it as the information was incorrect
// This means that there are some funds locked in the contract which cannot have an outbound , this can be a candidate for a refund
// TODO : Consider returning error or auto refunding the funds to the user
} else if eventWithdrawal != nil {
ctx.Logger().Error(fmt.Sprintf("Error processing ZRC20 withdrawal event , from Address: %s m ,to : %s,value %s,gasfee %s, protocolfee %s, err %s",
eventWithdrawal.From.Hex(), string(eventWithdrawal.To), eventWithdrawal.Value.String(), eventWithdrawal.Gasfee.String(), eventWithdrawal.ProtocolFlatFee.String(), err.Error()))
}
Expand All @@ -88,11 +87,6 @@ func (k Keeper) ProcessLogs(ctx sdk.Context, logs []*ethtypes.Log, emittingContr
return err
}
}
// We were able to parse the ZetaSent event. However, we were unable to process it as the information was incorrect
if eZeta != nil {
ctx.Logger().Error(fmt.Sprintf("Error processing Zeta Sent event , from Address: %s ,to : %s,value %s, err %s",
eZeta.Raw.Address.Hex(), string(eZeta.DestinationAddress), eZeta.ZetaValueAndGas.String(), err.Error()))
}
}
return nil
}
Expand Down Expand Up @@ -310,7 +304,7 @@ func ParseZetaSentEvent(log ethtypes.Log, connectorZEVM ethcommon.Address) (*con
}

if event.Raw.Address != connectorZEVM {
return event, fmt.Errorf("ParseZetaSentEvent: event address %s does not match connectorZEVM %s", event.Raw.Address.Hex(), connectorZEVM.Hex())
return nil, fmt.Errorf("ParseZetaSentEvent: event address %s does not match connectorZEVM %s", event.Raw.Address.Hex(), connectorZEVM.Hex())
}
return event, nil
}

0 comments on commit aaea061

Please sign in to comment.