Skip to content
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

Ledger: Refactor online totals #3770

Merged
merged 2 commits into from
Mar 18, 2022

Conversation

ghost
Copy link

@ghost ghost commented Mar 14, 2022

Summary

The existing Ledger.OnlineTotals is going ( at the end of the 320 project ), be using the onlineAccountsTracker to get its information from.
But unlike the existing l.accts.Totals(rnd) call, it won't get the totals, but only the amount of online totals ( i.e. basics.MicroAlgos ).

Prepare the Ledger implementation for that change by deprecating the accountUpdates.Totals and naming it OnlineTotals. As such, it would return just the online portion of that structure ( i.e. totals.Online.Money ).

Test Plan

Ran existing tests on Ledger.OnlineTotals

@ghost ghost self-assigned this Mar 14, 2022
@ghost ghost marked this pull request as draft March 14, 2022 23:20
@codecov-commenter
Copy link

codecov-commenter commented Mar 14, 2022

Codecov Report

Merging #3770 (29f45a3) into master (d3dc437) will decrease coverage by 0.01%.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##           master    #3770      +/-   ##
==========================================
- Coverage   49.68%   49.66%   -0.02%     
==========================================
  Files         392      392              
  Lines       68588    68585       -3     
==========================================
- Hits        34076    34063      -13     
- Misses      30766    30779      +13     
+ Partials     3746     3743       -3     
Impacted Files Coverage Δ
ledger/ledger.go 60.79% <0.00%> (+0.59%) ⬆️
ledger/acctupdates.go 68.42% <100.00%> (-0.67%) ⬇️
ledger/blockqueue.go 82.18% <0.00%> (-2.88%) ⬇️
node/node.go 23.33% <0.00%> (-1.86%) ⬇️
data/abi/abi_type.go 87.67% <0.00%> (-0.95%) ⬇️
network/wsNetwork.go 62.79% <0.00%> (ø)
network/wsPeer.go 68.88% <0.00%> (+0.83%) ⬆️
catchup/service.go 70.12% <0.00%> (+1.48%) ⬆️
cmd/algoh/blockWatcher.go 80.95% <0.00%> (+3.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3dc437...29f45a3. Read the comment docs.

@tsachiherman
Copy link
Contributor

Please don't forget to elimimate account update Totals - I think that now it's only used by tests.

@ghost ghost marked this pull request as ready for review March 16, 2022 20:33
Copy link
Contributor

@tsachiherman tsachiherman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes here looks great, but I'd like @algorandskiy to be familiar with these changes as well before merging this in.

@tsachiherman tsachiherman merged commit 8ac7c8b into algorand:master Mar 18, 2022
tsachiherman pushed a commit that referenced this pull request Mar 19, 2022
## Summary

The changes in #3770 didn't include the changes in #3769 and so tests don't compile on master currently — this updates another test that uses `Totals` to use `LatestTotals` instead.

## Test Plan

Fixes tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants