-
Notifications
You must be signed in to change notification settings - Fork 217
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
Light-mode: Fixes for Ada balance and rewards #3386
Merged
Merged
Conversation
This file contains 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
HeinrichApfelmus
force-pushed
the
HeinrichApfelmus/ADP-2013/light-mode-fixes
branch
3 times, most recently
from
July 19, 2022 13:24
3db2873
to
0eeab11
Compare
Move `blockfrostLightSyncSource` to the outermost scope. Doing this also requires moving `fetchCurrentNodeTip` to the outermost scope.
`bfGetAccountWithdrawals` fetches all transactions, but we only want those that are within the range set by `bhFrom` and `bhTo`.
HeinrichApfelmus
force-pushed
the
HeinrichApfelmus/ADP-2013/light-mode-fixes
branch
from
July 20, 2022 14:27
6668d39
to
b306c6d
Compare
It turns out that list `_transactionUtxosOutputs` may be unsorted, which messes up the output indices.
Unisay
reviewed
Jul 25, 2022
Unisay
approved these changes
Jul 25, 2022
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.
Thanks for all the nice improvements as well as the fix :)
Co-authored-by: Yura Lazarev <[email protected]>
bors merge |
iohk-bors bot
added a commit
that referenced
this pull request
Jul 25, 2022
3386: Light-mode: Fixes for Ada balance and rewards r=HeinrichApfelmus a=HeinrichApfelmus ### Issue number ADP-2013 ### Overview This pull request fixes a couple of issues with light-mode, specifically those relating to the ADA and reward balances. ### Details * Fix accidental interchange of regular and collateral inputs in `fromInputs`. * Fix usage of `wholeList`. This function only makes sense when we fetch an entire block — only then do we know that we have the whole list, not just a sublist. * Use `_accountInfoWithdrawableAmount` instead of`_accountInfoRewardsSum`. It looks like the latter function shows all rewards that were ever accumulated, while we want the balance of rewards that can still be withdrawn from the account. * Fix filtering of transactions for RewardAccount — we only want those transactions that fall within the bounds `bhFrom` and `bhTo`. * Fix sorting of transaction outputs — it turns out that `_transactionUtxosOutputs` does not necessarily yield the transaction outputs in order, which messes up the output indices. Co-authored-by: Heinrich Apfelmus <[email protected]>
Build failed:
|
bors retry |
iohk-bors bot
added a commit
that referenced
this pull request
Jul 25, 2022
3386: Light-mode: Fixes for Ada balance and rewards r=HeinrichApfelmus a=HeinrichApfelmus ### Issue number ADP-2013 ### Overview This pull request fixes a couple of issues with light-mode, specifically those relating to the ADA and reward balances. ### Details * Fix accidental interchange of regular and collateral inputs in `fromInputs`. * Fix usage of `wholeList`. This function only makes sense when we fetch an entire block — only then do we know that we have the whole list, not just a sublist. * Use `_accountInfoWithdrawableAmount` instead of`_accountInfoRewardsSum`. It looks like the latter function shows all rewards that were ever accumulated, while we want the balance of rewards that can still be withdrawn from the account. * Fix filtering of transactions for RewardAccount — we only want those transactions that fall within the bounds `bhFrom` and `bhTo`. * Fix sorting of transaction outputs — it turns out that `_transactionUtxosOutputs` does not necessarily yield the transaction outputs in order, which messes up the output indices. Co-authored-by: Heinrich Apfelmus <[email protected]>
Build failed:
|
bors retry |
Build succeeded: |
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.
Issue number
ADP-2013
Overview
This pull request fixes a couple of issues with light-mode, specifically those relating to the ADA and reward balances.
Details
fromInputs
.wholeList
. This function only makes sense when we fetch an entire block — only then do we know that we have the whole list, not just a sublist._accountInfoWithdrawableAmount
instead of_accountInfoRewardsSum
. It looks like the latter function shows all rewards that were ever accumulated, while we want the balance of rewards that can still be withdrawn from the account.bhFrom
andbhTo
._transactionUtxosOutputs
does not necessarily yield the transaction outputs in order, which messes up the output indices.