Skip to content

Commit

Permalink
Merge pull request #7026 from onflow/mpeter/fix-tx-replay-err-message…
Browse files Browse the repository at this point in the history
…-validation

Validation of error message on transaction replay is broken
  • Loading branch information
peterargue authored Feb 13, 2025
2 parents c895ec9 + 2159cc0 commit 77f4db5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fvm/evm/offchain/sync/replay.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,10 @@ func ValidateResult(
return fmt.Errorf("gas consumption mismatch %d != %d", res.GasConsumed, txEvent.GasConsumed)
}

// check error msg
if errMsg := res.ErrorMessageWithRevertReason(); errMsg != txEvent.ErrorMessage {
return fmt.Errorf("error msg mismatch %s != %s", errMsg, txEvent.ErrorMessage)
// check error code
txEventErrorCode := types.ErrorCode(txEvent.ErrorCode)
if errorCode := res.ResultSummary().ErrorCode; errorCode != txEventErrorCode {
return fmt.Errorf("error code mismatch %d != %d", errorCode, txEventErrorCode)
}

// check encoded logs
Expand Down

0 comments on commit 77f4db5

Please sign in to comment.