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

[storage] Protect Against Nil Block Balance #207

Merged
merged 6 commits into from
Oct 26, 2020

Conversation

patrick-ogrady
Copy link
Contributor

@patrick-ogrady patrick-ogrady commented Oct 26, 2020

This PR prevents the caller from fetching the balance at a nil block and allows the caller to update a previously set balance.

Changes

  • Error if nil block provided to GetBalance
  • Add test for nil block balance request
  • Allow balance updates at last block (needed for bootstrap balance with genesis tx)

@coveralls
Copy link

coveralls commented Oct 26, 2020

Pull Request Test Coverage Report for Build 9905

  • 16 of 21 (76.19%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.03%) to 78.326%

Changes Missing Coverage Covered Lines Changed/Added Lines %
storage/balance_storage.go 16 21 76.19%
Totals Coverage Status
Change from base Build 9817: -0.03%
Covered Lines: 7054
Relevant Lines: 9006

💛 - Coveralls

@patrick-ogrady patrick-ogrady merged commit 0921b62 into master Oct 26, 2020
@patrick-ogrady patrick-ogrady deleted the patrick/protect-nil-block branch October 26, 2020 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants