-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Check if a withdrawal amount into the destination account exceeds any applicable receiving limit. #6117
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
base: ximinez/lending-XLS-66-ongoing
Are you sure you want to change the base?
Check if a withdrawal amount into the destination account exceeds any applicable receiving limit. #6117
Conversation
any applicable receiving limit.
| * MPT: The limit check is effectively skipped (returns true). This is | ||
| * because MPT MaximumAmount relates to token supply, and withdrawal does not | ||
| * involve minting new tokens that could exceed the global cap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- MPT: The limit check is effectively skipped (returns true). This is
- because MPT MaximumAmount relates to token supply, and withdrawal does not
- involve minting new tokens that could exceed the global cap.
Withdrawal could involve minting if from is the issuer. You'll need to write a case for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no minting even if from is the issuer. We are withdrawing the tokens that have already been minted and are in the vault. The tokens are transferred from the vault's pseudo account to the destination. I updated the comments.
| case NoTrustLine: | ||
| // don't create a trustline | ||
| break; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a default case in case something goes wonky.
default:
BEAST_EXPECT(false);
ximinez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the multiple reviews in short succession...
src/test/app/LoanBroker_test.cpp
Outdated
| env.fund(XRP(1'000), issuer, broker, dest); | ||
| env.close(); | ||
|
|
||
| auto token = [&]() -> MPT { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably need to make this return std::optional<MPT> and have a default case that returns nullopt. Then have the caller fail and exit early if the result is unseated.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## ximinez/lending-XLS-66-ongoing #6117 +/- ##
==============================================================
Coverage 79.1% 79.1%
==============================================================
Files 839 839
Lines 71380 71395 +15
Branches 8318 8315 -3
==============================================================
+ Hits 56476 56491 +15
Misses 14904 14904
🚀 New features to boost your workflow:
|
High Level Overview of Change
Fix RIPD-4274
Type of Change
.gitignore, formatting, dropping support for older tooling)Test Plan
Update LoanBroker_test