Sponsored Content
Skip to content

refactor: Add const qualifier to SLE in verifyDepositPreauth parameter - #6555

Merged
bthomee merged 3 commits into
XRPLF:developfrom
tequdev:refactor-verifyDepositPreauth-sleDst
Mar 17, 2026
Merged

refactor: Add const qualifier to SLE in verifyDepositPreauth parameter#6555
bthomee merged 3 commits into
XRPLF:developfrom
tequdev:refactor-verifyDepositPreauth-sleDst

Conversation

@tequdev

@tequdev tequdev commented Mar 17, 2026

Copy link
Copy Markdown
Member

High Level Overview of Change

Add const qualifier to SLE in the verifyDepositPreauth function parameter, changing std::shared_ptr<SLE> const& to std::shared_ptr<SLE const> const&.

Context of Change

The sleDst parameter in verifyDepositPreauth is not modified within the function body. Using std::shared_ptr<SLE const> instead of std::shared_ptr<SLE> enforces const-correctness at the type
level, preventing accidental mutation of the ledger entry through this pointer.

This is a refactor to improve const-correctness with no behavioral change.

#5887 (comment)

@tequdev tequdev changed the title refactor: Add const qualifier to SLE in verifyDepositPreauth parameter refactor: Add const qualifier to SLE in verifyDepositPreauth parameter Mar 17, 2026
@tequdev tequdev mentioned this pull request Mar 17, 2026
5 tasks
@codecov

codecov Bot commented Mar 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.8%. Comparing base (72f4cb0) to head (167c154).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #6555   +/-   ##
=======================================
  Coverage     79.8%   79.8%           
=======================================
  Files          878     878           
  Lines        68026   68026           
  Branches      7556    7552    -4     
=======================================
+ Hits         54299   54304    +5     
+ Misses       13727   13722    -5     
Files with missing lines Coverage Δ
src/libxrpl/ledger/CredentialHelpers.cpp 97.6% <ø> (ø)
src/libxrpl/ledger/View.cpp 94.5% <100.0%> (ø)

... and 3 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.

@mvadari
mvadari requested a review from oleks-rip March 17, 2026 13:18
@mvadari mvadari added Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. Trivial Simple change with minimal effect, or already tested. Only needs one approval. labels Mar 17, 2026
@bthomee
bthomee enabled auto-merge March 17, 2026 15:53
@bthomee
bthomee added this pull request to the merge queue Mar 17, 2026
@bthomee
bthomee removed this pull request from the merge queue due to the queue being cleared Mar 17, 2026
@bthomee
bthomee enabled auto-merge (squash) March 17, 2026 19:16
AccountID const& src,
AccountID const& dst,
std::shared_ptr<SLE> const& sleDst,
std::shared_ptr<SLE const> const& sleDst,

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.

std::shared_ptr<SLE const> const& sleDst, -> SLE::const_ref sleDst

AccountID const& src,
AccountID const& dst,
std::shared_ptr<SLE> const& sleDst,
std::shared_ptr<SLE const> const& sleDst,

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.

SLE::const_ref sleDst

@oleks-rip oleks-rip removed 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 17, 2026
@bthomee
bthomee merged commit 013c2d6 into XRPLF:develop Mar 17, 2026
1 check 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Trivial Simple change with minimal effect, or already tested. Only needs one approval.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants