Skip to content

Commit

Permalink
Add public and private plan creation (#11)
Browse files Browse the repository at this point in the history
* add proposal proto for public proposal plan messages

* update proto files

* temp

* change method name to prevent from duplicate

* WIP: designing what args to accept for adding plan proposal...

* change binary name to farmingd

* change proposal design
- update proposal proto messages

* add private plans and public plans are work in progress

* update cli commands for private plans

* add tests for private farming plan command line interfaces

* add public plan proposal

* add nolint:errcheck for now

* fix golint by adding return value for sdkerrors.Wrapf

* add name filed in both create fixed amount plan and ratio plan messages

* apply feedback

* add validation and fix public ratio plan creation logic

* remove empty name field and use the one from the passed argument

* remove unused rest code

* move the name field inside the AddRequestProposal

* add description on PublicPlanProposal message

* fix typo and add 09_proposal.md

* add name field in update plan proposal

* make indentation consistent and change variable name

* reformat json

* fix broken app

* use three ifs instead of switch case and use else if to prevent from creating more than one plan type

* add detailed validation logics for AddRequestProposal, UpdateRequestProposal, DeleteRequestProposal

* re: add detailed validation logics for AddRequestProposal, UpdateRequestProposal, DeleteRequestProposal

* add skeleton for docs #21

* add How-To farming_plans.md

* update comment

* add validation for duplicate plan name

* update date time format to RFC3339

* feat: update public plan proposal

* feat: adding validation logic for an epoch ratio must not exceed 1 with the same account

* feat: add validation logic for overflow epoch ratio

* fix: add another if statement to check when both epoch amount and ratio are provided

* chore: update public plan proposal logics
- add validation logic for ratio plans
- add test codes for the validation
- clean up error messages

* docs: add command-line interfaces and update context
  • Loading branch information
jaybxyz authored Aug 2, 2021
1 parent 639a96b commit 3bb3264
Show file tree
Hide file tree
Showing 33 changed files with 3,298 additions and 449 deletions.
2 changes: 2 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ import (

farmingparams "github.com/tendermint/farming/app/params"
"github.com/tendermint/farming/x/farming"
farmingclient "github.com/tendermint/farming/x/farming/client"
farmingkeeper "github.com/tendermint/farming/x/farming/keeper"
farmingtypes "github.com/tendermint/farming/x/farming/types"

Expand All @@ -114,6 +115,7 @@ var (
distr.AppModuleBasic{},
gov.NewAppModuleBasic(
paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.ProposalHandler, upgradeclient.CancelProposalHandler,
farmingclient.ProposalHandler,
// todo: farming proposal handler
),
params.AppModuleBasic{},
Expand Down
1 change: 0 additions & 1 deletion contrib/devtools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ ENV GOLANG_PROTOBUF_VERSION=1.3.5 \
GOGO_PROTOBUF_VERSION=1.3.2 \
GRPC_GATEWAY_VERSION=1.14.7


RUN GO111MODULE=on go get \
github.com/golang/protobuf/protoc-gen-go@v${GOLANG_PROTOBUF_VERSION} \
github.com/gogo/protobuf/protoc-gen-gogo@v${GOGO_PROTOBUF_VERSION} \
Expand Down
11 changes: 11 additions & 0 deletions docs/Explanation/ADR/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Architecture Decision Records (ADR)

Use this location to record all high-level architecture decisions in the farming module

## Definitions

## Rationale

## Creating new ADR

## ADR Table of Contents
Empty file added docs/How-To/README.md
Empty file.
Loading

0 comments on commit 3bb3264

Please sign in to comment.