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

test: Add genesis tests #132

Merged
merged 14 commits into from
Oct 1, 2021
Merged

Conversation

hallazzang
Copy link
Contributor

Description

Ref: #119


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Appropriate labels applied
  • Targeted PR against correct branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@codecov
Copy link

codecov bot commented Sep 23, 2021

Codecov Report

Merging #132 (4a6bf17) into master (85846ba) will increase coverage by 1.08%.
The diff coverage is 97.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #132      +/-   ##
==========================================
+ Coverage   69.71%   70.80%   +1.08%     
==========================================
  Files          25       25              
  Lines        2262     2295      +33     
==========================================
+ Hits         1577     1625      +48     
+ Misses        533      528       -5     
+ Partials      152      142      -10     
Impacted Files Coverage Δ
x/farming/abci.go 66.66% <0.00%> (ø)
x/farming/keeper/grpc_query.go 85.40% <90.90%> (+2.18%) ⬆️
x/farming/keeper/genesis.go 93.70% <100.00%> (+13.70%) ⬆️
x/farming/keeper/plan.go 70.37% <100.00%> (+1.13%) ⬆️
x/farming/keeper/proposal_handler.go 36.84% <100.00%> (ø)
x/farming/keeper/reward.go 84.46% <100.00%> (-3.97%) ⬇️
x/farming/keeper/staking.go 91.54% <100.00%> (+0.59%) ⬆️
x/farming/simulation/operations.go 92.85% <100.00%> (+0.73%) ⬆️
x/farming/simulation/proposals.go 80.67% <100.00%> (ø)
... and 1 more

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 85846ba...4a6bf17. Read the comment docs.

@hallazzang hallazzang self-assigned this Sep 23, 2021
@hallazzang hallazzang added the test and simulation test and simulation label Sep 23, 2021
@hallazzang hallazzang linked an issue Sep 23, 2021 that may be closed by this pull request
also:
- rename GetAllPlans to GetPlans, IterateAllPlans to IteratePlans
for consistency
- add k.ValidateOutstandingRewards
these methods are for convenient calculation of rewards,
getting rid of the usage of cached context when calculating rewards

also use Querier's Keeper field to prevent name conflict
since Querier and Keeper both have Rewards method now
also fix a bug in UnpackAny that it accepts nil input or
an Any with empty type url
also remove staking_reserve_coins field
@hallazzang hallazzang marked this pull request as ready for review September 28, 2021 04:46
When starting chain from an exported state, ValidateGenesis
is not called automatically. To validate GenesisState in this
case too, we call types.ValidateGenesis inside InitGenesis.
Copy link
Contributor

@dongsam dongsam left a comment

Choose a reason for hiding this comment

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

LGTM

@dongsam dongsam merged commit 783b942 into tendermint:master Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test and simulation test and simulation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test: Genesis testing
2 participants