Skip to content

Conversation

@mvadari
Copy link
Collaborator

@mvadari mvadari commented Oct 3, 2025

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 as a code owner 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
Copy link

codecov bot commented Oct 3, 2025

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
Copy link
Collaborator

@vvysokikh1 vvysokikh1 left a comment

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

if (index != -1)
{
auto inner = dynamic_cast<STObject const*>(&it.peekAtIndex(index));
auto inner =
Copy link
Collaborator

@oleks-rip oleks-rip Oct 31, 2025

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
37 checks passed
Bronek pushed a commit that referenced this pull request Nov 3, 2025
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