From c35c08699381980c88301e05dad539976b22455b Mon Sep 17 00:00:00 2001 From: lumtis Date: Wed, 27 Nov 2024 15:49:48 +0100 Subject: [PATCH] prevent hiding smart contract error --- x/crosschain/keeper/cctx_orchestrator_validate_outbound.go | 2 +- x/crosschain/types/status.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go b/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go index ffc8e9aa7d..173093c771 100644 --- a/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go +++ b/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go @@ -240,7 +240,7 @@ func (k Keeper) processSuccessfulOutbound( oldStatus := cctx.CctxStatus.Status switch oldStatus { case types.CctxStatus_PendingRevert: - cctx.SetReverted("", "revert executed") + cctx.SetReverted("", "") case types.CctxStatus_PendingOutbound: cctx.SetOutboundMined("") default: diff --git a/x/crosschain/types/status.go b/x/crosschain/types/status.go index 00c08bf6f7..8f788209dc 100644 --- a/x/crosschain/types/status.go +++ b/x/crosschain/types/status.go @@ -13,7 +13,8 @@ func (m *Status) AbortRefunded() { func (m *Status) UpdateStatusAndErrorMessages(newStatus CctxStatus, statusMsg, errorMsg string) { m.UpdateStatus(newStatus, statusMsg) - if newStatus == CctxStatus_Aborted || newStatus == CctxStatus_Reverted || newStatus == CctxStatus_PendingRevert { + if errorMsg != "" && + (newStatus == CctxStatus_Aborted || newStatus == CctxStatus_Reverted || newStatus == CctxStatus_PendingRevert) { m.UpdateErrorMessage(errorMsg) } }