Skip to content

Conversation

@gregtatcam
Copy link
Collaborator

High Level Overview of Change

Fix RIPD-4274

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

Test Plan

Update LoanBroker_test

@gregtatcam gregtatcam requested a review from ximinez December 8, 2025 15:01
Comment on lines +1354 to +1356
* 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.
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Comment on lines 1488 to 1491
case NoTrustLine:
// don't create a trustline
break;
}
Copy link
Collaborator

@ximinez ximinez Dec 13, 2025

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

Copy link
Collaborator

@ximinez ximinez left a 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...

env.fund(XRP(1'000), issuer, broker, dest);
env.close();

auto token = [&]() -> MPT {
Copy link
Collaborator

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
Copy link

codecov bot commented Dec 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.1%. Comparing base (f7a5f35) to head (c46f7e1).

Additional details and impacted files

Impacted file tree graph

@@                      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           
Files with missing lines Coverage Δ
include/xrpl/ledger/View.h 100.0% <ø> (ø)
src/libxrpl/ledger/Credit.cpp 100.0% <ø> (ø)
src/libxrpl/ledger/View.cpp 94.5% <100.0%> (-<0.1%) ⬇️
src/xrpld/app/paths/Flow.cpp 94.3% <ø> (ø)
src/xrpld/app/paths/detail/DirectStep.cpp 83.1% <ø> (ø)
src/xrpld/app/paths/detail/StrandFlow.h 92.0% <ø> (ø)
src/xrpld/app/paths/detail/XRPEndpointStep.cpp 83.3% <ø> (ø)

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

3 participants