feat(backend): rework fixed send fee calculation#3376
Merged
Conversation
✅ Deploy Preview for brilliant-pasca-3e80ec canceled.
|
🚀 Performance Test ResultsTest Configuration:
Test Metrics:
📜 Logs |
mkurapov
reviewed
Apr 9, 2025
Contributor
mkurapov
left a comment
There was a problem hiding this comment.
Looks good! will also request @BlairCurrey to take a look
Co-authored-by: Max Kurapov <max@interledger.org>
mkurapov
approved these changes
Apr 10, 2025
BlairCurrey
approved these changes
Apr 10, 2025
Contributor
BlairCurrey
left a comment
There was a problem hiding this comment.
Looks great. Appreciate the detailed description in the PR body.
| "path-to-regexp@>=0.1.7": "^0.1.12", | ||
| "path-to-regexp@>=6.3.0": "^6.3.0" | ||
| "path-to-regexp@>=6.3.0": "^6.3.0", | ||
| "next": "^15.2.3" |
Contributor
There was a problem hiding this comment.
I assume this was to resolve some issue with the docker trivy scan?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes proposed in this pull request
For fixed debit amounts:
For fixed receive amounts:
Changed
mockQuote's receiveAmount logic a bit because one of the tests were failing:debitAmountValue | fixedFee | basisPointFee | exchangeRate | expectedReceiveAmountValue
${200n} | ${20} | ${200} | ${0.455} | ${80n}
Fees: (200 * (200 * 0.0001)) - 20 = 24
Debit - fees: 200 - 24 = 176
Receive: 176 USD * 0.455 = 80.08 XRP (this returned 81 instead of 80 and it should be
Math.floor'd instead ofMath.ceil'd because the peer will deliver 80 XRP for 175.82417582 USD)Context
fixes #3055
Checklist
fixes #numberuser-docslabel (if necessary)