rippled icon indicating copy to clipboard operation
rippled copied to clipboard

Decouple CredentialHelpers from xrpld/app/tx

Open a1q123456 opened this issue 7 months ago • 1 comments

High Level Overview of Change

This PR refactors CredentialHelpers and removes some unnecessary dependencies as a step of modularisation.

Context of Change

The ledger component is almost independent except that it references to MPTokenAuthorize and CredentialHelpers.h, and the later one further references to Transactor.h. This PR partially clears the path to modularising the ledger component and decouples CredentialHelpers from xrpld.

Type of Change

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [x] Refactor (non-breaking change that only restructures code)
  • [ ] Performance (increase or change in throughput and/or latency)
  • [ ] Tests (you added tests for code that already exists, or your new feature included in this PR)
  • [ ] Documentation update
  • [ ] Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • [ ] Release

API Impact

This PR doesn't affect any API

  • [ ] Public API: New feature (new methods and/or new fields)
  • [ ] Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • [ ] libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • [ ] Peer protocol change (must be backward compatible or bump the peer protocol version)

Test Plan

This PR doesn't introduce any functional changes so we should do some regression tests to double check if everything is still working properly.

Future Tasks

In the next PR, we should move some logic from MPTokenAuthorize.cpp to View.cpp so that it's possible to modularise the ledger module.

a1q123456 avatar Jun 11 '25 15:06 a1q123456

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 79.1%. Comparing base (c2f3e2e) to head (1dec6da). Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #5487   +/-   ##
=======================================
  Coverage     79.1%   79.1%           
=======================================
  Files          816     816           
  Lines        71605   71622   +17     
  Branches      8237    8237           
=======================================
+ Hits         56626   56643   +17     
  Misses       14979   14979           
Files with missing lines Coverage Δ
src/xrpld/app/misc/CredentialHelpers.cpp 97.8% <100.0%> (-<0.1%) :arrow_down:
src/xrpld/app/tx/detail/DeleteAccount.cpp 91.9% <100.0%> (+0.2%) :arrow_up:
src/xrpld/app/tx/detail/Escrow.cpp 93.6% <100.0%> (+<0.1%) :arrow_up:
src/xrpld/app/tx/detail/PayChan.cpp 90.5% <100.0%> (+0.1%) :arrow_up:
src/xrpld/app/tx/detail/Payment.cpp 93.7% <100.0%> (+0.2%) :arrow_up:

... and 3 files with indirect coverage changes

Impacted file tree graph

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Jun 11 '25 15:06 codecov[bot]

@a1q123456 this is really nice ! Please do update (and keep updating) this branch from develop so it can be eventually merged.

Bronek avatar Jun 23 '25 11:06 Bronek