Skip to content

Commit

Permalink
fix(e2e): tolerate revert message in both error and status message
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Oct 8, 2024
1 parent 45a9b05 commit 248e9f8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion e2e/e2etests/test_eth_deposit_call.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,10 @@ 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")
// tolerate the error in both the ErrorMessage field and the StatusMessage field
if cctx.CctxStatus.ErrorMessage != "" {
require.Contains(r, cctx.CctxStatus.ErrorMessage, "revert executed")
} else {
require.Contains(r, cctx.CctxStatus.StatusMessage, utils.ErrHashRevertFoo)
}
}
7 changes: 6 additions & 1 deletion e2e/e2etests/test_solana_deposit_refund.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@ 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")
// tolerate the error in both the ErrorMessage field and the StatusMessage field
if cctx.CctxStatus.ErrorMessage != "" {
require.Contains(r, cctx.CctxStatus.ErrorMessage, "revert executed")
} else {
require.Contains(r, cctx.CctxStatus.StatusMessage, utils.ErrHashRevertFoo)
}
}

0 comments on commit 248e9f8

Please sign in to comment.