Sponsored Content
Skip to content

refactor: Replace !=/== tesSuccess with using isTesSuccess - #6409

Merged
bthomee merged 13 commits into
XRPLF:developfrom
mvadari:is-tes-success
Mar 18, 2026
Merged

refactor: Replace !=/== tesSuccess with using isTesSuccess#6409
bthomee merged 13 commits into
XRPLF:developfrom
mvadari:is-tes-success

Conversation

@mvadari

@mvadari mvadari commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

High Level Overview of Change

This PR replaces all instances of <variable> != tesSUCCESS with !isTesSuccess(<variable>) and <variable> == tesSUCCESS with isTesSuccess(<variable>).

Context of Change

General code cleanup

Type of Change

  • Refactor (non-breaking change that only restructures code)

API Impact

N/A

Test Plan

CI passes.

Copilot AI review requested due to automatic review settings February 23, 2026 16:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the codebase to replace direct comparisons with tesSUCCESS (i.e., != tesSUCCESS and == tesSUCCESS) with calls to the isTesSuccess() helper function. This is a code cleanup refactoring aimed at improving code consistency and readability.

However, the automated refactoring introduced several critical syntax errors and type mismatches that will prevent compilation:

  1. Syntax errors in three files where the negation operator was incorrectly placed
  2. Type mismatches in XChainBridge.cpp where std::optional<TER> values are passed to isTesSuccess() which expects TER

Changes:

  • Replaced == tesSUCCESS with isTesSuccess()
  • Replaced != tesSUCCESS with !isTesSuccess()
  • Applied changes across transaction transactors, invariant checks, and protocol files

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/libxrpl/tx/transactors/XChainBridge.cpp Refactored success checks but introduced critical bugs with optional types
src/libxrpl/tx/transactors/SetTrust.cpp Refactored permission check
src/libxrpl/tx/transactors/SetSignerList.cpp Refactored preflight and preclaim checks
src/libxrpl/tx/transactors/Payment.cpp Refactored multiple authorization and result checks
src/libxrpl/tx/transactors/Offer/CreateOffer.cpp Refactored offer creation success checks
src/libxrpl/tx/transactors/NFT/NFTokenUtils.cpp Refactored trustline authorization checks
src/libxrpl/tx/transactors/NFT/NFTokenMint.cpp Refactored token insertion check
src/libxrpl/tx/transactors/NFT/NFTokenAcceptOffer.cpp Refactored multiple authorization and payment checks
src/libxrpl/tx/transactors/MPT/MPTokenIssuanceSet.cpp Refactored permission check
src/libxrpl/tx/transactors/Escrow.cpp Refactored multiple authorization checks
src/libxrpl/tx/transactors/DeleteAccount.cpp Refactored cleanup result check
src/libxrpl/tx/transactors/Check/CashCheck.cpp Refactored flow result checks
src/libxrpl/tx/transactors/Batch.cpp Refactored preflight check but introduced syntax error
src/libxrpl/tx/transactors/AMM/AMMWithdraw.cpp Refactored withdrawal and deletion checks
src/libxrpl/tx/transactors/AMM/AMMUtils.cpp Refactored trustline deletion check
src/libxrpl/tx/transactors/AMM/AMMDeposit.cpp Refactored deposit result checks
src/libxrpl/tx/transactors/AMM/AMMDelete.cpp Refactored deletion result check
src/libxrpl/tx/transactors/AMM/AMMCreate.cpp Refactored creation authorization and send checks
src/libxrpl/tx/transactors/AMM/AMMClawback.cpp Refactored clawback application checks
src/libxrpl/tx/transactors/AMM/AMMBid.cpp Refactored bid result checks
src/libxrpl/tx/paths/Flow.cpp Refactored flow result check but introduced syntax error
src/libxrpl/tx/applySteps.cpp Refactored preclaim check but introduced syntax error
src/libxrpl/tx/Transactor.cpp Refactored apply and fee payment checks
src/libxrpl/tx/InvariantCheck.cpp Refactored multiple invariant result checks
src/libxrpl/protocol/NFTokenOfferID.cpp Refactored transaction result check
src/libxrpl/protocol/NFTokenID.cpp Refactored transaction result check
src/libxrpl/ledger/View.cpp Refactored multiple credit and send result checks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/libxrpl/tx/transactors/XChainBridge.cpp Outdated
Comment thread src/libxrpl/tx/transactors/XChainBridge.cpp Outdated
Comment thread src/libxrpl/tx/transactors/Batch.cpp Outdated
Comment thread src/libxrpl/tx/paths/Flow.cpp Outdated
Comment thread src/libxrpl/tx/applySteps.cpp Outdated
Comment thread src/libxrpl/tx/transactors/XChainBridge.cpp Outdated
Copilot AI review requested due to automatic review settings February 24, 2026 22:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/libxrpl/tx/transactors/XChainBridge.cpp Outdated
Comment thread src/libxrpl/tx/transactors/XChainBridge.cpp Outdated
Comment thread src/libxrpl/tx/transactors/XChainBridge.cpp Outdated
Comment thread src/libxrpl/tx/transactors/XChainBridge.cpp Outdated
Copilot AI review requested due to automatic review settings February 26, 2026 17:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/libxrpl/tx/transactors/bridge/XChainBridge.cpp
Comment thread src/libxrpl/tx/transactors/bridge/XChainBridge.cpp Outdated
@codecov

codecov Bot commented Feb 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.24060% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.8%. Comparing base (6fbeb04) to head (612d7d5).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
src/xrpld/app/paths/detail/PaySteps.cpp 57.1% 3 Missing ⚠️
src/libxrpl/tx/transactors/bridge/XChainBridge.cpp 90.0% 1 Missing ⚠️
src/xrpld/app/paths/PathRequest.cpp 0.0% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #6409   +/-   ##
=======================================
  Coverage     79.8%   79.8%           
=======================================
  Files          878     878           
  Lines        68030   68031    +1     
  Branches      7558    7551    -7     
=======================================
+ Hits         54296   54314   +18     
+ Misses       13734   13717   -17     
Files with missing lines Coverage Δ
include/xrpl/tx/applySteps.h 100.0% <100.0%> (ø)
src/libxrpl/ledger/View.cpp 94.5% <100.0%> (ø)
src/libxrpl/protocol/NFTokenID.cpp 95.2% <100.0%> (ø)
src/libxrpl/protocol/NFTokenOfferID.cpp 90.9% <100.0%> (ø)
src/libxrpl/tx/Transactor.cpp 93.2% <100.0%> (ø)
src/libxrpl/tx/applySteps.cpp 79.1% <100.0%> (ø)
src/libxrpl/tx/invariants/AMMInvariant.cpp 95.3% <100.0%> (ø)
src/libxrpl/tx/invariants/InvariantCheck.cpp 95.8% <100.0%> (ø)
src/libxrpl/tx/invariants/MPTInvariant.cpp 73.3% <100.0%> (ø)
src/libxrpl/tx/invariants/NFTInvariant.cpp 79.5% <100.0%> (ø)
... and 35 more

... and 6 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/libxrpl/tx/transactors/dex/AMMWithdraw.cpp
Comment thread src/libxrpl/tx/transactors/bridge/XChainBridge.cpp Outdated
Comment thread src/libxrpl/tx/transactors/bridge/XChainBridge.cpp Outdated
@mvadari mvadari changed the title refactor: replace !=/== tesSuccess with using isTesSuccess refactor: Replace !=/== tesSuccess with using isTesSuccess Mar 16, 2026
@bthomee
bthomee requested a review from godexsoft March 17, 2026 14:53

@godexsoft godexsoft left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an obvious win.
One thing that i like to do is to write 'not' instead of '!' when it makes the condition read more like plain English. This is of course optional and a matter of taste so feel free to ignore 👍

@mvadari mvadari added the Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. label Mar 18, 2026
@bthomee
bthomee enabled auto-merge (squash) March 18, 2026 13:54
@bthomee
bthomee merged commit dcaef82 into XRPLF:develop Mar 18, 2026
3 checks passed
@mvadari mvadari added this to the 3.2.0 milestone May 20, 2026
beartec-jpg pushed a commit to beartec-jpg/FalconLedger that referenced this pull request Jun 1, 2026
This change replaces all instances of `<variable> != tesSUCCESS` with `!isTesSuccess(<variable>)` and `<variable> == tesSUCCESS` with `isTesSuccess(<variable>)`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants