Skip to content

Commit

Permalink
account for inbound amount
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed Feb 8, 2024
1 parent 8b41e78 commit 4b41800
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion x/crosschain/keeper/msg_server_refund_aborted_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (k msgServer) RefundAbortedCCTX(goCtx context.Context, msg *types.MsgRefund
// Check if aborted amount is available to maintain zeta accounting
// NOTE: Need to verify if this check works / is required in athens 3
if cctx.InboundTxParams.CoinType == common.CoinType_Zeta {
err := k.RemoveZetaAbortedAmount(ctx, cctx.GetCurrentOutTxParam().Amount)
err := k.RemoveZetaAbortedAmount(ctx, cctx.InboundTxParams.Amount)
if err != nil {
return nil, errorsmod.Wrap(types.ErrUnableProcessRefund, err.Error())
}
Expand Down
5 changes: 5 additions & 0 deletions x/crosschain/keeper/refund.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ func (k Keeper) RefundAmountOnZetaChainGas(ctx sdk.Context, cctx types.CrossChai
func (k Keeper) RefundAmountOnZetaChainZeta(ctx sdk.Context, cctx types.CrossChainTx, refundAddress ethcommon.Address) error {
// if coin type is Zeta, handle this as a deposit ZETA to zEVM.
// deposit the amount to the tx origin instead of receiver as this is a refund
chainID := cctx.InboundTxParams.SenderChainId
// check if chain is supported
if chain := k.zetaObserverKeeper.GetSupportedChainFromChainID(ctx, chainID); chain == nil {
return zetaObserverTypes.ErrSupportedChains
}
if cctx.InboundTxParams.Amount.IsNil() || cctx.InboundTxParams.Amount.IsZero() {
return errors.New("no amount to refund")
}
Expand Down

0 comments on commit 4b41800

Please sign in to comment.