Skip to content

Commit

Permalink
reviews suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
fbac committed Oct 4, 2024
1 parent cd9818e commit e901161
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion e2e/e2etests/test_eth_deposit_call.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@ func TestEtherDepositAndCall(r *runner.E2ERunner, args []string) {
r.Logger.Info("Cross-chain call to reverter reverted")

// Check the error carries the revert executed.
require.Contains(r, cctx.CctxStatus.ErrorMessage, "Revert executed")
require.Contains(r, cctx.CctxStatus.ErrorMessage, "revert executed")
}
2 changes: 1 addition & 1 deletion e2e/e2etests/test_solana_deposit_refund.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ func TestSolanaDepositAndCallRefund(r *runner.E2ERunner, args []string) {
utils.RequireCCTXStatus(r, cctx, crosschaintypes.CctxStatus_Reverted)

// Check the error carries the revert executed.
require.Contains(r, cctx.CctxStatus.ErrorMessage, "Revert executed")
require.Contains(r, cctx.CctxStatus.ErrorMessage, "revert executed")
}
4 changes: 2 additions & 2 deletions proto/zetachain/zetacore/crosschain/cross_chain_tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ message OutboundParams {

message Status {
CctxStatus status = 1;
// status_message carries information about the status transitions
// specifying the old status and new status
// status_message carries information about the status transitions:
// why they were triggered, old and new status.
string status_message = 2;
// error_message carries information about the error that caused the tx
// to be PendingRevert, Reverted or Aborted.
Expand Down
6 changes: 5 additions & 1 deletion x/crosschain/keeper/cctx_gateway_zevm.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package keeper

import (
"fmt"

sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/zeta-chain/node/x/crosschain/types"
Expand Down Expand Up @@ -28,7 +30,9 @@ func (c CCTXGatewayZEVM) InitiateOutbound(

if err != nil && !isContractReverted {
// exceptional case; internal error; should abort CCTX
config.CCTX.SetAbort("error during deposit that is not smart contract revert", err.Error())
config.CCTX.SetAbort(
"aborted because of an error during deposit that is not smart contract revert",
fmt.Sprintf("deposit error: %s", err.Error()))
return types.CctxStatus_Aborted, err
}

Expand Down
6 changes: 3 additions & 3 deletions x/crosschain/keeper/cctx_orchestrator_validate_outbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func (k Keeper) processSuccessfulOutbound(
oldStatus := cctx.CctxStatus.Status
switch oldStatus {
case types.CctxStatus_PendingRevert:
cctx.SetReverted("Reverted as part of a successful outbound", "Revert executed")
cctx.SetReverted("", "revert executed")
case types.CctxStatus_PendingOutbound:
cctx.SetOutboundMined("")
default:
Expand Down Expand Up @@ -292,7 +292,7 @@ func (k Keeper) processFailedZETAOutboundOnZEVM(ctx sdk.Context, cctx *types.Cro
return fmt.Errorf("failed ZETARevertAndCallContract: %s", err.Error())
}

cctx.SetReverted("", "Outbound failed")
cctx.SetReverted("", "outbound failed")
if len(ctx.TxBytes()) > 0 {
// add event for tendermint transaction hash format
hash := tmbytes.HexBytes(tmtypes.Tx(ctx.TxBytes()).Hash())
Expand Down Expand Up @@ -356,7 +356,7 @@ func (k Keeper) processFailedOutboundV2(ctx sdk.Context, cctx *types.CrossChainT
}

// tx is reverted
cctx.SetReverted("", "Outbound failed")
cctx.SetReverted("", "outbound failed")

// add event for tendermint transaction hash format
if len(ctx.TxBytes()) > 0 {
Expand Down

0 comments on commit e901161

Please sign in to comment.