Skip to content

refactor: Extract escrow lock helpers and paychan test helpers - #7882

Open
dangell7 wants to merge 1 commit into
XRPLF:developfrom
Transia-RnD:dangell7/escrow-paychan-refactor
Open

refactor: Extract escrow lock helpers and paychan test helpers#7882
dangell7 wants to merge 1 commit into
XRPLF:developfrom
Transia-RnD:dangell7/escrow-paychan-refactor

Conversation

@dangell7

Copy link
Copy Markdown
Contributor

High Level Overview of Change

Pulls the refactoring out of #5448 (XLS-93d Token-Enabled Payment Channels) into its own PR so it can merge ahead of the feature. Code motion only, no functional change.

  • Moves the escrow lock/unlock helpers from the Escrow transactors into EscrowHelpers.h.
  • Moves the jtx paychan helpers from TestHelpers.h into their own test/jtx/paychan.h, and hoists the file-local helpers from PayChan_test.cpp into them.
  • Moves the escrowed balance test helpers from EscrowToken_test.cpp into the shared jtx TestHelpers.h.

Context of Change

Split out of #5448 per review feedback. The token paychan transactors reuse the escrow lock/unlock helpers, so the extraction lands here first and the feature PR becomes mostly additive.

API Impact

  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)

Test Plan

No new tests, the moved code is covered by the existing suites. Ran Escrow, EscrowToken, Sponsor, PayChan, MPToken, AMM.

@dangell7
dangell7 force-pushed the dangell7/escrow-paychan-refactor branch from 1bd10e0 to 866afee Compare July 28, 2026 00:23
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mvadari
mvadari requested review from TimothyBanks and pwang200 July 29, 2026 02:55

template <>
inline TER
escrowLockPreclaimHelper<Issue>(

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.

just a nit, but it might be worthwhile to considering moving these explicit template instantiations into a source file.

bool const recvLow = issuer > receiver;
bool const senderIssuer = issuer == sender;
bool const receiverIssuer = issuer == receiver;
bool const lineExisted = ctx.view.exists(trustLineKey);

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.

super nit and a problem not for this PR, but we don't need to construct most of these variables until after line 355.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants