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

feat: add genesis functionality #87

Merged
merged 4 commits into from
Sep 2, 2021

Conversation

dongsam
Copy link
Contributor

@dongsam dongsam commented Aug 20, 2021

Description

closes: #66

Bullet Points

  • Export, Init
  • Validation
  • test codes

References


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 Aug 20, 2021

Codecov Report

Merging #87 (5315801) into master (d721098) will increase coverage by 0.59%.
The diff coverage is 62.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #87      +/-   ##
==========================================
+ Coverage   56.28%   56.88%   +0.59%     
==========================================
  Files          24       24              
  Lines        1766     1830      +64     
==========================================
+ Hits          994     1041      +47     
- Misses        670      682      +12     
- Partials      102      107       +5     
Impacted Files Coverage Δ
x/farming/types/plan.go 30.62% <0.00%> (-2.05%) ⬇️
x/farming/types/genesis.go 38.23% <42.42%> (+5.62%) ⬆️
x/farming/keeper/genesis.go 75.00% <69.69%> (+25.00%) ⬆️
x/farming/keeper/invariants.go 100.00% <100.00%> (ø)
x/farming/keeper/plan.go 65.68% <100.00%> (+4.14%) ⬆️
x/farming/types/params.go 77.04% <100.00%> (-1.42%) ⬇️
x/farming/keeper/reward.go 81.92% <0.00%> (+3.38%) ⬆️

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 d721098...5315801. Read the comment docs.


return types.NewGenesisState(params, planRecords, nil, nil)
epochTime, _ := k.GetLastEpochTime(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

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

LastEpochTime may be not present on the store so the second return value found can be false. In that case, calling NewGenesisState with concrete time.Time value will not act as expected.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's right. If there's no value(false), the expectation is to return time.Time{} and set it to this empty time.Time{} value for export genesis. Can't we do this?

@dongsam dongsam requested a review from hallazzang September 2, 2021 06:17
@dongsam dongsam merged commit 6dea151 into tendermint:master Sep 2, 2021
@dongsam dongsam self-assigned this Sep 2, 2021
jaybxyz added a commit to jaybxyz/farming that referenced this pull request Sep 2, 2021
…64-simulation-test

* commit '6dea151437ce42ffd0b68c5486fa210195ce6696':
  feat: add genesis functionality (tendermint#87)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Genesis Init, Export with Records and Test codes
2 participants