Skip to content

Commit

Permalink
prevent hiding smart contract error
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Nov 27, 2024
1 parent 8d5caac commit c35c086
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion x/crosschain/keeper/cctx_orchestrator_validate_outbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion x/crosschain/types/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit c35c086

Please sign in to comment.