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

Add public and private plan creation #11

Merged
merged 45 commits into from
Aug 2, 2021

Conversation

jaybxyz
Copy link
Contributor

@jaybxyz jaybxyz commented Jul 19, 2021

Description

This PR adds a functionality to create public and private farming plans.

How to test this functionality

In order to test this functionality, I created a gist that contains sample json structure for different types of plans and useful CLI commands and REST APIs in here.

closes: #1

jaybxyz added 3 commits July 19, 2021 14:57
* master:
  update querier and msg server logic
  fix query service to reflect updated spec; WIP
@jaybxyz jaybxyz self-assigned this Jul 19, 2021
@jaybxyz jaybxyz added the enhancement New feature or request label Jul 19, 2021
jaybxyz added 11 commits July 19, 2021 17:19
- update proposal proto messages
* master:
  Fix core logic (tendermint#15)
  refactoring for RemoveStakingCoinDenomIndex
  fix name to workflows
  apply suggested issues from code review
  Add kv indexing and iterator functions

# Conflicts:
#	x/farming/keeper/msg_server.go
#	x/farming/keeper/plan.go
#	x/farming/types/farming.pb.go
#	x/farming/types/plan.go
* master:
  Add farming fee collector (tendermint#22)
  Update CLI tx commands and fix bugs (tendermint#23)

# Conflicts:
#	x/farming/types/farming.pb.go
@codecov
Copy link

codecov bot commented Jul 26, 2021

Codecov Report

Merging #11 (2c69acc) into master (639a96b) will decrease coverage by 6.38%.
The diff coverage is 11.11%.

❗ Current head 2c69acc differs from pull request most recent head d707cfd. Consider uploading reports for the commit d707cfd to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master      #11      +/-   ##
==========================================
- Coverage   36.87%   30.48%   -6.39%     
==========================================
  Files          23       26       +3     
  Lines        1413     1801     +388     
==========================================
+ Hits          521      549      +28     
- Misses        846     1190     +344     
- Partials       46       62      +16     
Impacted Files Coverage Δ
x/farming/client/cli/tx.go 0.00% <0.00%> (ø)
x/farming/handler.go 31.03% <0.00%> (ø)
x/farming/keeper/plan.go 17.61% <0.00%> (-0.23%) ⬇️
x/farming/keeper/proposal_handler.go 0.00% <0.00%> (ø)
x/farming/keeper/staking.go 94.73% <ø> (-0.45%) ⬇️
x/farming/types/genesis.go 32.60% <ø> (+1.99%) ⬆️
x/farming/types/proposal.go 4.16% <0.00%> (-1.61%) ⬇️
x/farming/client/cli/utils.go 50.00% <50.00%> (ø)
x/farming/types/msgs.go 73.23% <66.66%> (-0.68%) ⬇️
x/farming/types/plan.go 40.17% <78.57%> (+19.95%) ⬆️
... and 4 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 639a96b...d707cfd. Read the comment docs.

@jaybxyz jaybxyz changed the title Add public plan proposal Add public and private plan creation Jul 27, 2021
@jaybxyz jaybxyz marked this pull request as ready for review July 27, 2021 08:59
@jaybxyz jaybxyz requested review from hallazzang and dongsam July 27, 2021 09:01
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.

Could you add validation functions for PublicPlans with AddRequestProposal, AddRequestProposal, DeleteRequestProposal

and test codes for HandlePublicPlanProposal, AddPublicPlanProposal,
UpdatePublicPlanProposal,
DeletePublicPlanProposal

If the PR is likely to be too long, we can just do structural modifications and continue the rest from other PRs.

x/farming/types/proposal.go Show resolved Hide resolved
@jaybxyz jaybxyz requested review from hallazzang and dongsam July 28, 2021 04:57
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.

I appreciate your efforts!
How about adding this document to the #21 format? It could be How-To or Tutorials.

x/farming/keeper/proposal_handler.go Show resolved Hide resolved
x/farming/client/rest/rest.go Outdated Show resolved Hide resolved
x/farming/types/plan.go Show resolved Hide resolved
@jaybxyz
Copy link
Contributor Author

jaybxyz commented Jul 28, 2021

@dongsam Sure, I thought about adding this gist when we implement #21. But I will just go ahead and create folder in this PR.

@jaybxyz jaybxyz requested a review from dongsam July 30, 2021 02:03
x/farming/types/proposal.go Outdated Show resolved Hide resolved
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.

Could you merge the latest master branch to solve the conflict? #25 was merged and there are some conflicts

x/farming/keeper/proposal_handler.go Show resolved Hide resolved
x/farming/keeper/proposal_handler.go Outdated Show resolved Hide resolved
x/farming/keeper/proposal_handler.go Outdated Show resolved Hide resolved
x/farming/types/plan.go Outdated Show resolved Hide resolved
* master:
  bump sdk version to v0.43.0-rc2
  Implement reward distribution (tendermint#25)
  Add issue, pr templates

# Conflicts:
#	x/farming/keeper/msg_server.go
#	x/farming/keeper/plan.go
#	x/farming/keeper/plan_test.go
#	x/farming/keeper/proposal_handler.go
#	x/farming/types/errors.go
#	x/farming/types/plan.go
jaybxyz added 4 commits August 2, 2021 10:49
…add-public-plan

* commit '639a96bb38ab9bda41ab15cc74534f520bf4302b':
  Add pre-commit hook and corresponding doc (tendermint#37)
- add validation logic for ratio plans
- add test codes for the validation
- clean up error messages
@jaybxyz jaybxyz requested a review from dongsam August 2, 2021 07:22
@dongsam dongsam merged commit 3bb3264 into tendermint:master Aug 2, 2021
@jaybxyz jaybxyz mentioned this pull request Sep 8, 2021
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add public and private farming plans
3 participants