Sponsored Content
Skip to content

refactor: clean up TxMeta - #5845

Merged
bthomee merged 21 commits into
XRPLF:developfrom
mvadari:meta-refactor
Oct 31, 2025
Merged

refactor: clean up TxMeta#5845
bthomee merged 21 commits into
XRPLF:developfrom
mvadari:meta-refactor

Conversation

@mvadari

@mvadari mvadari commented Oct 3, 2025

Copy link
Copy Markdown
Contributor

High Level Overview of Change

This PR:

  • Simplifies the TxMeta constructors - both were setting the same set of fields, and to make it harder for future bugs to arise and keep the code DRY, we can combine those into one helper function.
  • Removes an unused constructor.
  • Renames the variables to avoid Hungarian naming
  • Refactors to remove a bunch of now-unnecessary helper functions

Context of Change

DRY, pulled out of #5600

Type of Change

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

API Impact

N/A

Test Plan

CI passes.

@mvadari
mvadari requested a review from a team October 3, 2025 15:28
@mvadari mvadari added the Trivial Simple change with minimal effect, or already tested. Only needs one approval. label Oct 3, 2025
@mvadari mvadari changed the title refactor: simplify TxMeta setting of additional fields refactor: simplify TxMeta Oct 3, 2025
@mvadari mvadari changed the title refactor: simplify TxMeta refactor: simplify TxMeta constructors Oct 3, 2025
@codecov

codecov Bot commented Oct 3, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.50746% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.3%. Comparing base (fa69918) to head (9ef1f96).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
include/xrpl/protocol/TxMeta.h 94.4% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #5845     +/-   ##
=========================================
- Coverage     78.3%   78.3%   -0.0%     
=========================================
  Files          817     817             
  Lines        69003   68989     -14     
  Branches      8318    8318             
=========================================
- Hits         54028   54016     -12     
+ Misses       14975   14973      -2     
Files with missing lines Coverage Δ
src/libxrpl/ledger/ApplyStateTable.cpp 93.6% <100.0%> (ø)
src/libxrpl/protocol/TxMeta.cpp 99.0% <100.0%> (+2.5%) ⬆️
src/xrpld/rpc/detail/DeliveredAmount.cpp 84.3% <100.0%> (+0.3%) ⬆️
include/xrpl/protocol/TxMeta.h 93.3% <94.4%> (-0.4%) ⬇️

... and 2 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 added this to the 3.1.0 milestone Oct 3, 2025
@mvadari mvadari mentioned this pull request Oct 13, 2025
13 tasks
@mvadari mvadari changed the title refactor: simplify TxMeta constructors refactor: clean up TxMeta Oct 13, 2025
@mvadari
mvadari requested a review from vvysokikh1 October 14, 2025 13:47
@mvadari mvadari removed the Trivial Simple change with minimal effect, or already tested. Only needs one approval. label Oct 14, 2025

@vvysokikh1 vvysokikh1 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.

lgtm! small nit can be ignored

Comment thread include/xrpl/protocol/TxMeta.h Outdated
Comment thread include/xrpl/protocol/TxMeta.h Outdated
Comment thread include/xrpl/protocol/TxMeta.h
Comment thread src/libxrpl/protocol/TxMeta.cpp Outdated
Comment thread src/libxrpl/protocol/TxMeta.cpp Outdated
Comment thread src/libxrpl/protocol/TxMeta.cpp Outdated
Comment thread src/libxrpl/protocol/TxMeta.cpp Outdated
if (index != -1)
{
auto inner = dynamic_cast<STObject const*>(&it.peekAtIndex(index));
auto inner =

@oleks-rip oleks-rip Oct 31, 2025

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.

auto const *inner

@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 Oct 31, 2025
@bthomee
bthomee enabled auto-merge (squash) October 31, 2025 19:03
@bthomee
bthomee merged commit 4e32d2e into XRPLF:develop Oct 31, 2025
3 checks passed
@mvadari
mvadari deleted the meta-refactor branch February 4, 2026 22:43
@mvadari mvadari modified the milestones: 3.1.0, 3.2.0 May 20, 2026
beartec-jpg pushed a commit to beartec-jpg/FalconLedger that referenced this pull request Jun 1, 2026
This change:
* Simplifies the `TxMeta` constructors - both were setting the same set of fields, and to make it harder for future bugs to arise and keep the code DRY, we can combine those into one helper function.
* Removes an unused constructor.
* Renames the variables to avoid Hungarian naming.
* Removes a bunch of now-unnecessary helper functions.
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