Skip to content

fix: Add defensive check for permission to tx type cast#7047

Open
yinyiqian1 wants to merge 2 commits intoXRPLF:developfrom
yinyiqian1:fix-perm-type
Open

fix: Add defensive check for permission to tx type cast#7047
yinyiqian1 wants to merge 2 commits intoXRPLF:developfrom
yinyiqian1:fix-perm-type

Conversation

@yinyiqian1
Copy link
Copy Markdown
Collaborator

@yinyiqian1 yinyiqian1 commented Apr 29, 2026

In permissionToTxType,
values outside this range would silently truncate when cast to
uint16_t, for example, 65537 would become 1, mapping to the Payment transaction.

(Might have some overlap with #6613. but keeping it as a separate PR for clearer scope, review and tracking.)

High Level Overview of Change

Context of Change

API Impact

  • 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)

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.0%. Comparing base (46b997b) to head (02a2002).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #7047     +/-   ##
=========================================
- Coverage     82.1%   82.0%   -0.0%     
=========================================
  Files         1010    1010             
  Lines        75961   75965      +4     
  Branches      7392    7383      -9     
=========================================
- Hits         62330   62325      -5     
- Misses       13631   13640      +9     
Files with missing lines Coverage Δ
src/libxrpl/protocol/Permissions.cpp 97.1% <100.0%> (+0.2%) ⬆️

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

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.

1 participant