From 749c2ece9ac6ead29d01ceaeeee989ddabaa870b Mon Sep 17 00:00:00 2001 From: Alex Gartner Date: Tue, 8 Oct 2024 09:40:27 -0700 Subject: [PATCH] fix(e2e): tolerate revert message in both error and status message --- e2e/e2etests/test_eth_deposit_call.go | 7 ++++++- e2e/e2etests/test_solana_deposit_refund.go | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/e2e/e2etests/test_eth_deposit_call.go b/e2e/e2etests/test_eth_deposit_call.go index 46805f9f81..9484888cf3 100644 --- a/e2e/e2etests/test_eth_deposit_call.go +++ b/e2e/e2etests/test_eth_deposit_call.go @@ -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) + } } diff --git a/e2e/e2etests/test_solana_deposit_refund.go b/e2e/e2etests/test_solana_deposit_refund.go index 3176edee78..0a62b70ac6 100644 --- a/e2e/e2etests/test_solana_deposit_refund.go +++ b/e2e/e2etests/test_solana_deposit_refund.go @@ -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) + } }