Closed
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4288 +/- ##
=======================================
Coverage 74.03% 74.04%
=======================================
Files 345 345
Lines 110047 110027 -20
=======================================
- Hits 81476 81468 -8
+ Misses 28571 28559 -12 ☔ View full report in Codecov by Sentry. |
3 tasks
Collaborator
Author
Understood. Thanks for comparing the two PRs! |
3 tasks
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.
Describe your changes
Based on the bug fix in #4287. An alternative to #4290 that simplifies the exchanging an amount to some past epoch. If the current epoch is 10 and it is desired to convert an asset from epoch 2 to epoch 6 when only conversions to the latest epoch, 10, are available. Then the following process is now done:
AB. (If we were converting to epoch 10, thenBwould equal 0 since that is the conversion from an epoch to itself.)C=A-B. Because of the way the conversion tree is constructed,Cis the conversion from epoch 2 to epoch 6 that would have been returned during epoch 6.So more generally
query_allowed_conversionnow returns the result of a subtractionA-B. And by definition, the second operand of the subtraction is 0 when converting to the latest epoch, which ultimately means the result is simplyAin that case. Additionally,compute_exchanged_amounthas been simplified removing the forward and backward conversions.Checklist before merging
breaking::labelsnamada-docsreponamada-indexerornamada-masp-indexer, a corresponding PR is opened in that repo