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

Update numeric store getters to return bool if value is missing #2169

Merged
merged 9 commits into from
Jul 27, 2023

Conversation

robert-zaremba
Copy link
Member

In Numeric getters (Big Int, Dec, int, int64...) returned zero value if the value was not present in the store, without letting know if the value is there. That can cause unexpected behavior when zero is a proper value, but we want to know if it was present in the store or not.

This PR adds bool return type to numeric getters and the time getter.

@robert-zaremba robert-zaremba requested a review from a team as a code owner July 26, 2023 20:26
@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Merging #2169 (0863e9f) into main (7f05ad4) will decrease coverage by 5.09%.
Report is 153 commits behind head on main.
The diff coverage is 81.17%.

❗ Current head 0863e9f differs from pull request most recent head f8bfd36. Consider uploading reports for the commit f8bfd36 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2169      +/-   ##
==========================================
- Coverage   75.38%   70.30%   -5.09%     
==========================================
  Files         100      148      +48     
  Lines        8025    11310    +3285     
==========================================
+ Hits         6050     7951    +1901     
- Misses       1589     2816    +1227     
- Partials      386      543     +157     
Files Changed Coverage Δ
ante/spam_prevention.go 75.92% <ø> (ø)
x/incentive/codec.go 47.82% <ø> (+9.89%) ⬆️
x/incentive/keeper/invariants.go 0.00% <0.00%> (ø)
x/incentive/keeper/unbonding.go 80.45% <ø> (ø)
x/incentive/keeper/update.go 52.11% <ø> (ø)
x/incentive/keys.go 100.00% <ø> (ø)
x/incentive/msgs.go 77.41% <ø> (-0.81%) ⬇️
x/incentive/params.go 89.28% <ø> (-10.72%) ⬇️
x/leverage/client/tests/suite.go 100.00% <ø> (ø)
x/leverage/client/tests/tests.go 100.00% <ø> (ø)
... and 54 more

... and 54 files with indirect coverage changes

util/store/store.go Outdated Show resolved Hide resolved
x/metoken/keeper/metoken.go Show resolved Hide resolved
util/store/store.go Outdated Show resolved Hide resolved
x/incentive/keeper/store.go Outdated Show resolved Hide resolved
robert-zaremba and others added 2 commits July 27, 2023 14:22
Co-authored-by: Adam Moser <63419657+toteki@users.noreply.github.com>
@robert-zaremba robert-zaremba added the skip-e2e-test Skip the e2e tests label Jul 27, 2023
@robert-zaremba robert-zaremba added this pull request to the merge queue Jul 27, 2023
Merged via the queue into main with commit a2b51ee Jul 27, 2023
20 of 28 checks passed
@robert-zaremba robert-zaremba deleted the robert/store-helpers branch July 27, 2023 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-e2e-test Skip the e2e tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants