Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix account_objects to disallow filtering by types that an account ca… #5056

Merged
merged 6 commits into from
Jul 29, 2024

Conversation

yinyiqian1
Copy link
Collaborator

fix #4681

High Level Overview of Change

Context of Change

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

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

@shawnxie999 shawnxie999 self-requested a review June 24, 2024 20:51
@yinyiqian1 yinyiqian1 requested a review from mvadari June 26, 2024 14:51
Copy link
Collaborator

@scottschurr scottschurr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix looks good as far as I'm concerned. However,

  • I raised a concern about how test failures will be handled, and suggested how I would resolve it. But I'm open to other thoughts.
  • I also raised a concern about lambda naming (in general) in the test file.

I pushed commits with my suggested fixes to this branch: https://github.com/scottschurr/rippled/commits/yinyiqian1-br_fix_invalid_type/

  • My suggestions for improving test failure messages are in commit ad508ff
  • My suggestions for renaming the lambdas are in this commit: b419bd0

You are welcome to look at, cherry-pick, or ignore those commits as you wish. But at the very least I hope for some discussion.

Thanks for the contribution!

src/test/rpc/AccountObjects_test.cpp Outdated Show resolved Hide resolved
src/xrpld/rpc/handlers/AccountObjects.cpp Show resolved Hide resolved
src/test/rpc/AccountObjects_test.cpp Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jul 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.3%. Comparing base (21a0a64) to head (849276d).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #5056     +/-   ##
=========================================
- Coverage     71.4%   71.3%   -0.0%     
=========================================
  Files          796     796             
  Lines        67031   67039      +8     
  Branches     10865   10886     +21     
=========================================
- Hits         47830   47810     -20     
- Misses       19201   19229     +28     
Files Coverage Δ
src/xrpld/rpc/detail/RPCHelpers.cpp 82.2% <100.0%> (+0.2%) ⬆️
src/xrpld/rpc/detail/RPCHelpers.h 100.0% <ø> (ø)
src/xrpld/rpc/handlers/AccountObjects.cpp 93.7% <100.0%> (+0.1%) ⬆️

... and 8 files with indirect coverage changes

Impacted file tree graph

Copy link
Collaborator

@scottschurr scottschurr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me. Thanks for being willing to take on the drive-by naming fix! In my opinion things like that can help reduce bit rot in the code base.

@yinyiqian1 yinyiqian1 requested a review from cindyyan317 July 5, 2024 21:01
Copy link
Collaborator

@cindyyan317 cindyyan317 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ! 👍

Copy link
Collaborator

@shawnxie999 shawnxie999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@shawnxie999 shawnxie999 added the Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required. label Jul 25, 2024
@ximinez ximinez merged commit d54151e into XRPLF:develop Jul 29, 2024
21 of 22 checks passed
vlntb pushed a commit to vlntb/rippled that referenced this pull request Aug 23, 2024
* `account_objects` returns an invalid field error if `type` is not supported.
  This includes objects an account can't own, or which are unsupported by `account_objects`
* Includes:
  * Amendments
  * Directory Node
  * Fee Settings
  * Ledger Hashes
  * Negative UNL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

account_objects: Disallow filtering by types that an account can't own.
6 participants