rippled
rippled copied to clipboard
Frozen IOUs should still be transferable to/from the issuer
High Level Overview of Change
The freeze logic was incorrectly blocking IOU issuers from transacting with their own frozen currency. This violated the XRP Ledger protocol, which specifies that "Counterparties of the frozen issuer can still send and receive payments directly to and from the issuing address."
Context of Change
Three issues were fixed:
-
isFrozen()function was returning true for issuers checking their own currency during global freeze, causing the issuer to be treated as frozen. The early return prevented reaching the later issuer exemption check. -
LoanBrokerCoverDeposit::preclaim()was using accountHolds() with FreezeHandling::fhZERO_IF_FROZEN for all accounts, including issuers. Since issuers don't have a "balance" of their own tokens (infinite issuance ability), the balance check would return 0 and fail with tecINSUFFICIENT_FUNDS. -
VaultWithdraw::preclaim()had checkFrozen() calls that were always executed, even when the destination or submitter was the asset issuer. Now skips freeze checks when either the destination or submitter is the IOU issuer.
Type of Change
- [x] 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)
- [ ]
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl) - [ ] Peer protocol change (must be backward compatible or bump the peer protocol version)
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 79.1%. Comparing base (0aa4eed) to head (8523f42).
Additional details and impacted files
@@ Coverage Diff @@
## ximinez/lending-XLS-66-ongoing #6113 +/- ##
==============================================================
Coverage 79.1% 79.1%
==============================================================
Files 839 839
Lines 71385 71399 +14
Branches 8317 8315 -2
==============================================================
+ Hits 56481 56497 +16
+ Misses 14904 14902 -2
| Files with missing lines | Coverage Δ | |
|---|---|---|
| src/libxrpl/ledger/View.cpp | 94.5% <100.0%> (+<0.1%) |
:arrow_up: |
| src/xrpld/app/tx/detail/LoanBrokerCoverDeposit.cpp | 95.0% <100.0%> (+0.2%) |
:arrow_up: |
| src/xrpld/app/tx/detail/VaultWithdraw.cpp | 99.2% <100.0%> (+0.1%) |
:arrow_up: |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.