Commit 91d239f
Improve and fix bugs in Lending Protocol - XLS-66 (#6156)
- Fix overpayment asserts (#6084)
- MPTTester::operator() parameter should be std::int64_t
- Originally defined as uint64_t, but the testIssuerLoan() test called
it with a negative number, causing an overflow to a very large number
that in some circumstances could be silently cast back to an int64_t,
but might not be. I believe this is UB, and we don't want to rely on
that.
- Fix Overpayment Calculation (#6087)
- Adds additional unit tests to cover math calculations.
- Removes unused methods.
- Fix LoanBrokerSet debtMaximum limits (#6116)
- Fix some minor bugs in Lending Protocol (#6101)
- add nodiscard to unimpairLoan, and check result in LoanPay
- add a check to verify that issuer exists
- improve LoanManage error code for dust amounts
- In overpayment results, the management fee was being calculated twice:
once as part of the value change, and as part of the fees paid.
Exclude it from the value change.
- Round the initial total value computation upward, unless there is
0-interest.
- Rename getVaultScale to getAssetsTotalScale, and convert one incorrect
computation to use it.
- Use adjustImpreciseNumber for LossUnrealized.
- Add some logging to computeLoanProperties.
- Check permissions in LoanSet and LoanPay (#6108)
- Disallow pseudo accounts to be Destination for LoanBrokerCoverWithdraw (#6106)
- Ensure vault asset cap is not exceeded (#6124)
- Fix Overpayment ValueChange calculation in Lending Protocol (#6114)
- Adds loan state to LoanProperties.
- Cleans up computeLoanProperties.
- Fixes missing management fee from overpayment.
- fix: Enable LP Deposits when the broker is the asset issuer (#6119)
- Add a few minor changes (#6158)
- Updates or fixes a couple of things I noticed while reviewing changes
to the spec.
- Rename sfPreviousPaymentDate to sfPreviousPaymentDueDate.
- Make the vault asset cap check added in #6124 a little more robust:
1. Check in preflight if the vault is _already_ over the limit.
2. Prevent overflow when checking with the loan value. (Subtract
instead of adding, in case the values are near maxint. Both return
the same result. Also add a unit test so each case is covered.
- Add minimum grace period validation (#6133)
- Fix bugs: frozen pseudo-account, and FLC cutoff (#6170)
- Fixes LoanManage tfBAD_LEDGER case by capping the amount of FLC to use to cover a loss at the amount of cover available.
- Check if the Vault pseudo-account is frozen in LoanBrokerSet
- refactor: Rename raw state to theoretical state (#6187)
- Check if a withdrawal amount exceeds any applicable receiving limit. (#6117)
- Check the trust line limit is not exceeded for a withdraw to a third party Destination account.
- Fix test failures from interaction between #6120 and #6133
- LoanSet transaction added in #6120 failed the minimum grace period
added by #6133.
- Fix overpayment result calculation (#6195)
- Address review feedback from Lending Protocol re-review (#6161)
- Reduce code duplication in LoanBrokerDelete
- Reorder "canWithdraw" parameters to put "view" first
- Combine accountSpendable into accountHolds
- Avoid copies by taking a reference for the claw amount
- Return function results directly
- Fix typo for "parseLoan" in ledger_entry RPC
- Improve some comments and unused variables
- No need for late payment components lambda
- Add explanatory comment for computeLoanProperties
- Add comment linking computeRawLoanState to spec
- Fix typo: TrueTotalPrincipalOutstanding
- Fix missed ripple -> xrpl update
- Remove unnecessary "else"s.
- Clean up std::visit in accountHolds.
---------
Co-authored-by: Vito Tumas <5780819+Tapanito@users.noreply.github.com>
Co-authored-by: Shawn Xie <35279399+shawnxie999@users.noreply.github.com>
Co-authored-by: Jingchen <a1q123456@users.noreply.github.com>
Co-authored-by: Gregory Tsipenyuk <gregtatcam@users.noreply.github.com>1 parent 418ce68 commit 91d239f
File tree
30 files changed
+3238
-745
lines changed- include/xrpl
- ledger
- protocol/detail
- src
- libxrpl/ledger
- test
- app
- jtx
- impl
- xrpld
- app
- misc
- detail
- paths
- detail
- tx/detail
- rpc/handlers
30 files changed
+3238
-745
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
| 20 | + | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
| |||
324 | 327 | | |
325 | 328 | | |
326 | 329 | | |
327 | | - | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
328 | 341 | | |
329 | 342 | | |
330 | 343 | | |
| |||
334 | 347 | | |
335 | 348 | | |
336 | 349 | | |
337 | | - | |
| 350 | + | |
| 351 | + | |
338 | 352 | | |
339 | 353 | | |
340 | 354 | | |
341 | 355 | | |
342 | 356 | | |
343 | 357 | | |
344 | 358 | | |
345 | | - | |
| 359 | + | |
| 360 | + | |
346 | 361 | | |
347 | 362 | | |
348 | 363 | | |
| |||
351 | 366 | | |
352 | 367 | | |
353 | 368 | | |
354 | | - | |
| 369 | + | |
| 370 | + | |
355 | 371 | | |
356 | 372 | | |
357 | 373 | | |
| |||
360 | 376 | | |
361 | 377 | | |
362 | 378 | | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
| 379 | + | |
| 380 | + | |
407 | 381 | | |
408 | 382 | | |
409 | 383 | | |
| |||
674 | 648 | | |
675 | 649 | | |
676 | 650 | | |
677 | | - | |
| 651 | + | |
678 | 652 | | |
679 | 653 | | |
680 | 654 | | |
| |||
729 | 703 | | |
730 | 704 | | |
731 | 705 | | |
| 706 | + | |
| 707 | + | |
732 | 708 | | |
733 | 709 | | |
734 | 710 | | |
735 | | - | |
736 | 711 | | |
| 712 | + | |
737 | 713 | | |
738 | 714 | | |
| 715 | + | |
739 | 716 | | |
740 | 717 | | |
741 | 718 | | |
| |||
749 | 726 | | |
750 | 727 | | |
751 | 728 | | |
| 729 | + | |
| 730 | + | |
752 | 731 | | |
753 | 732 | | |
754 | 733 | | |
755 | | - | |
756 | 734 | | |
| 735 | + | |
757 | 736 | | |
| 737 | + | |
758 | 738 | | |
759 | 739 | | |
760 | 740 | | |
| |||
768 | 748 | | |
769 | 749 | | |
770 | 750 | | |
| 751 | + | |
| 752 | + | |
771 | 753 | | |
772 | 754 | | |
773 | 755 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
563 | | - | |
| 563 | + | |
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
File renamed without changes.
0 commit comments