-
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
Factor getAccountBalance
into getCachedAccountBalance
and fetchAccountBalances
#2694
Conversation
1. Rename existing getAccountBalance to getCachedAccountBalance to make its behaviour clearer. 2. Add new `fetchAccountBalances` to `NetworkLayer`. 3. Remove unused `ErrGetAccountBalance` error The error wasn't used, so it was just a cause for confusion and complexity. 4. Make listStakeKeys use use fetchAccountBalances instead of `getCachedAccountBalance`. getCachedAccountBalance will return 0 the first time it is called for a new stake key. This might not be appropriate for listing stake keys. Let's block and wait for new values from the node instead. If we see any performance problems in the future we can re-consider / go for a third option.
1988dcd
to
aa41945
Compare
-- account to the internal set of observed account, such that it will be | ||
-- fetched later. | ||
|
||
, fetchAccountBalances |
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.
occasionally I think that fetchRewardAccountBalances
and getCachedRewardAccountBalance
would be better here in spite of being long...
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.
👍 fair -> d81089b
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.
I like this decomposition. If we have a proof that it helps with flaky integration testing then it is great
Thanks for having a look.
This wasn't intended to fix flaky tests, although that's a good point, this caching-behaviour could be involved 🤔 (This PR only changes the behaviour of listStakeKeys. Wallet reward balances still use the cached version.) |
bors r+ |
2693: Allow specifying purpose for acc x pub r=paweljakubas a=paweljakubas # Issue Number <!-- Put here a reference to the issue that this PR relates to and which requirements it tackles. Jira issues of the form ADP- will be auto-linked. --> adp-950 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] updated swagger - [x] enable passing purpose - [x] adjust core unit tests - [x] add integration test - [x] guard purpose with integration test # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket ✓ Acknowledge any changes required to the Wiki ✓ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages. --> 2694: Factor `getAccountBalance` into `getCachedAccountBalance` and `fetchAccountBalances` r=Anviking a=Anviking # Issue Number <!-- Put here a reference to the issue that this PR relates to and which requirements it tackles. Jira issues of the form ADP- will be auto-linked. --> Split off from #2684 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] Rename `getAccountBalance` to `getCachedAccountBalance` for clarity - [x] Add `fetchAccountBalances` function for un-cached behaviour - [x] `fetchAccountBalances` from `listStakeKeys` # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket ✓ Acknowledge any changes required to the Wiki ✓ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages. --> Co-authored-by: Pawel Jakubas <[email protected]> Co-authored-by: Johannes Lund <[email protected]>
Build failed (retrying...):
|
bors r- |
Canceled. |
d81089b
to
3b8b160
Compare
bors r+ |
2694: Factor `getAccountBalance` into `getCachedAccountBalance` and `fetchAccountBalances` r=Anviking a=Anviking # Issue Number <!-- Put here a reference to the issue that this PR relates to and which requirements it tackles. Jira issues of the form ADP- will be auto-linked. --> Split off from #2684 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] Rename `getAccountBalance` to `getCachedAccountBalance` for clarity - [x] Add `fetchAccountBalances` function for un-cached behaviour - [x] `fetchAccountBalances` from `listStakeKeys` # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket ✓ Acknowledge any changes required to the Wiki ✓ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages. --> Co-authored-by: Johannes Lund <[email protected]>
Build failed:
|
bors r+ |
2694: Factor `getAccountBalance` into `getCachedAccountBalance` and `fetchAccountBalances` r=Anviking a=Anviking # Issue Number <!-- Put here a reference to the issue that this PR relates to and which requirements it tackles. Jira issues of the form ADP- will be auto-linked. --> Split off from #2684 # Overview <!-- Detail in a few bullet points the work accomplished in this PR --> - [x] Rename `getAccountBalance` to `getCachedAccountBalance` for clarity - [x] Add `fetchAccountBalances` function for un-cached behaviour - [x] `fetchAccountBalances` from `listStakeKeys` # Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket ✓ Acknowledge any changes required to the Wiki ✓ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages. --> Co-authored-by: Johannes Lund <[email protected]>
Build failed:
Cascade of more and more failures (137 in total), starting with the above. Wallet syncing problems, starting before WALLETS_UTXO_02 failed. But if they caused the failure, or the other way around. |
bors r+ |
Build succeeded: |
Issue Number
Split off from #2684
Overview
getAccountBalance
togetCachedAccountBalance
for clarityfetchAccountBalances
function for un-cached behaviourfetchAccountBalances
fromlistStakeKeys
Comments