From 6627df70b0455dd9bf24b77fd6ede36a2bbb906a Mon Sep 17 00:00:00 2001 From: John Letey Date: Mon, 4 Jul 2022 11:22:20 +0200 Subject: [PATCH] feat: include a percentage of deposit when submitting a proposal (#7) * feat: include a percentage of deposit when submitting a proposal * chore: correctly check protobuf breaking changes * fix: throw a custom error * fix: correctly adjust min deposit --- Makefile | 4 +- docs/core/proto-docs.md | 1 + proto/cosmos/gov/v1beta1/gov.proto | 8 + x/gov/client/testutil/cli_test.go | 2 +- x/gov/client/testutil/suite.go | 5 +- x/gov/keeper/deposit.go | 15 +- x/gov/keeper/grpc_query_test.go | 11 +- x/gov/legacy/v040/migrate_test.go | 1 + x/gov/legacy/v043/json_test.go | 1 + x/gov/simulation/genesis.go | 2 +- x/gov/types/errors.go | 1 + x/gov/types/genesis.go | 6 + x/gov/types/gov.pb.go | 257 +++++++++++++++++------------ x/gov/types/params.go | 21 ++- x/params/proposal_handler_test.go | 7 +- 15 files changed, 218 insertions(+), 124 deletions(-) diff --git a/Makefile b/Makefile index 049773edb69d..e29bb97ae081 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ BINDIR ?= $(GOPATH)/bin BUILDDIR ?= $(CURDIR)/build SIMAPP = ./simapp MOCKS_DIR = $(CURDIR)/tests/mocks -HTTPS_GIT := https://github.com/cosmos/cosmos-sdk.git +HTTPS_GIT := https://github.com/KYVENetwork/cosmos-sdk.git DOCKER := $(shell which docker) DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf @@ -396,7 +396,7 @@ proto-lint: @$(DOCKER_BUF) lint --error-format=json proto-check-breaking: - @$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=master + @$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=kyve-main TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.0-rc6/proto/tendermint diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 4aa6a09efe4a..0fc97cc5a7e2 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -5088,6 +5088,7 @@ DepositParams defines the params for deposits on governance proposals. | `min_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Minimum deposit for a proposal to enter voting period. | | `max_deposit_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | Maximum period for Atom holders to deposit on a proposal. Initial value: 2 months. | | `min_expedited_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Minimum expedited deposit for a proposal to enter voting period. | +| `min_deposit_percentage` | [bytes](#bytes) | | TODO | diff --git a/proto/cosmos/gov/v1beta1/gov.proto b/proto/cosmos/gov/v1beta1/gov.proto index 7171dee98459..147986971f8b 100644 --- a/proto/cosmos/gov/v1beta1/gov.proto +++ b/proto/cosmos/gov/v1beta1/gov.proto @@ -168,6 +168,14 @@ message DepositParams { (gogoproto.moretags) = "yaml:\"min_expedited_deposit\"", (gogoproto.jsontag) = "min_expedited_deposit,omitempty" ]; + + // TODO + bytes min_deposit_percentage = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "min_deposit_percentage,omitempty", + (gogoproto.moretags) = "yaml:\"min_deposit_percentage\"" + ]; } // VotingParams defines the params for voting on governance proposals. diff --git a/x/gov/client/testutil/cli_test.go b/x/gov/client/testutil/cli_test.go index 46252a20dafb..4db1f642678d 100644 --- a/x/gov/client/testutil/cli_test.go +++ b/x/gov/client/testutil/cli_test.go @@ -21,7 +21,7 @@ func TestIntegrationTestSuite(t *testing.T) { suite.Run(t, NewIntegrationTestSuite(cfg)) genesisState := types.DefaultGenesisState() - genesisState.DepositParams = types.NewDepositParams(sdk.NewCoins(sdk.NewCoin(cfg.BondDenom, types.DefaultMinDepositTokens)), time.Duration(15)*time.Second, sdk.NewCoins(sdk.NewCoin(cfg.BondDenom, types.DefaultMinExpeditedDepositTokens))) + genesisState.DepositParams = types.NewDepositParams(sdk.NewCoins(sdk.NewCoin(cfg.BondDenom, types.DefaultMinDepositTokens)), time.Duration(15)*time.Second, sdk.NewCoins(sdk.NewCoin(cfg.BondDenom, types.DefaultMinExpeditedDepositTokens)), types.DefaultMinDepositPercentage) genesisState.VotingParams = types.NewVotingParams(time.Duration(5)*time.Second, time.Duration(2)*time.Second, []types.ProposalVotingPeriod{}) bz, err := cfg.Codec.MarshalJSON(genesisState) require.NoError(t, err) diff --git a/x/gov/client/testutil/suite.go b/x/gov/client/testutil/suite.go index 2b7fe39f95d7..9b2d15936e4a 100644 --- a/x/gov/client/testutil/suite.go +++ b/x/gov/client/testutil/suite.go @@ -88,7 +88,7 @@ func (s *IntegrationTestSuite) TestCmdParams() { { "json output", []string{fmt.Sprintf("--%s=json", tmcli.OutputFlag)}, - `{"voting_params":{"voting_period":"172800000000000","proposal_voting_periods":null,"expedited_voting_period":"86400000000000"},"tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","expedited_threshold":"0.667000000000000000"},"deposit_params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800000000000","min_expedited_deposit":[{"denom":"stake","amount":"50000000"}]}}`, + `{"voting_params":{"voting_period":"172800000000000","proposal_voting_periods":null,"expedited_voting_period":"86400000000000"},"tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","expedited_threshold":"0.667000000000000000"},"deposit_params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800000000000","min_expedited_deposit":[{"denom":"stake","amount":"50000000"}],"min_deposit_percentage":"0.000000000000000000"}}`, }, { "text output", @@ -99,6 +99,7 @@ deposit_params: min_deposit: - amount: "10000000" denom: stake + min_deposit_percentage: "0.000000000000000000" min_expedited_deposit: - amount: "50000000" denom: stake @@ -159,7 +160,7 @@ func (s *IntegrationTestSuite) TestCmdParam() { "deposit", fmt.Sprintf("--%s=json", tmcli.OutputFlag), }, - `{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800000000000","min_expedited_deposit":[{"denom":"stake","amount":"50000000"}]}`, + `{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800000000000","min_expedited_deposit":[{"denom":"stake","amount":"50000000"}],"min_deposit_percentage":"0.000000000000000000"}`, }, } diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index 027416015ada..169053691a02 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -117,6 +117,20 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd return false, sdkerrors.Wrapf(types.ErrInactiveProposal, "%d", proposalID) } + // Check if deposit is enough. + depositParams := keeper.GetDepositParams(ctx) + minDepositAmount := proposal.GetMinDepositFromParams(depositParams) + + adjustedMinDeposit := sdk.NewCoins() + for _, coin := range minDepositAmount { + amount := coin.Amount.ToDec().Mul(depositParams.MinDepositPercentage).RoundInt() + adjustedMinDeposit = adjustedMinDeposit.Add(sdk.NewCoin(coin.Denom, amount)) + } + + if !depositAmount.IsAllGTE(adjustedMinDeposit) { + return false, sdkerrors.Wrapf(types.ErrInvalidDeposit, "%s", depositAmount.String()) + } + // update the governance module's account coins pool err := keeper.bankKeeper.SendCoinsFromAccountToModule(ctx, depositorAddr, types.ModuleName, depositAmount) if err != nil { @@ -130,7 +144,6 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd // Check if deposit has provided sufficient total funds to transition the proposal into the voting period activatedVotingPeriod := false - minDepositAmount := proposal.GetMinDepositFromParams(keeper.GetDepositParams(ctx)) if proposal.Status == types.StatusDepositPeriod && proposal.TotalDeposit.IsAllGTE(minDepositAmount) { keeper.ActivateVotingPeriod(ctx, proposal) diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 4beb6fd73d9c..fdf94c4c089b 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -4,6 +4,7 @@ import ( gocontext "context" "fmt" "strconv" + "time" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" @@ -483,8 +484,9 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { func() { req = &types.QueryParamsRequest{ParamsType: types.ParamVoting} expRes = &types.QueryParamsResponse{ - VotingParams: types.DefaultVotingParams(), - TallyParams: types.NewTallyParams(sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0)), + VotingParams: types.DefaultVotingParams(), + DepositParams: types.NewDepositParams(sdk.NewCoins(), time.Second*0, sdk.NewCoins(), sdk.ZeroDec()), + TallyParams: types.NewTallyParams(sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0)), } }, true, @@ -494,7 +496,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { func() { req = &types.QueryParamsRequest{ParamsType: types.ParamTallying} expRes = &types.QueryParamsResponse{ - TallyParams: types.DefaultTallyParams(), + DepositParams: types.NewDepositParams(sdk.NewCoins(), time.Second*0, sdk.NewCoins(), sdk.ZeroDec()), + TallyParams: types.DefaultTallyParams(), } }, true, @@ -517,7 +520,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { if testCase.expPass { suite.Require().NoError(err) - suite.Require().Equal(expRes.GetDepositParams(), params.GetDepositParams()) + suite.Require().True(expRes.GetDepositParams().Equal(params.GetDepositParams())) suite.Require().True(expRes.GetVotingParams().Equal(params.GetVotingParams())) suite.Require().Equal(expRes.GetTallyParams(), params.GetTallyParams()) } else { diff --git a/x/gov/legacy/v040/migrate_test.go b/x/gov/legacy/v040/migrate_test.go index 9d9fb3263399..e1e173bae571 100644 --- a/x/gov/legacy/v040/migrate_test.go +++ b/x/gov/legacy/v040/migrate_test.go @@ -98,6 +98,7 @@ func TestMigrate(t *testing.T) { "deposit_params": { "max_deposit_period": "0s", "min_deposit": [], + "min_deposit_percentage": "0", "min_expedited_deposit": [] }, "deposits": [], diff --git a/x/gov/legacy/v043/json_test.go b/x/gov/legacy/v043/json_test.go index 3e24b31aa2c1..2a9873b3d6cd 100644 --- a/x/gov/legacy/v043/json_test.go +++ b/x/gov/legacy/v043/json_test.go @@ -51,6 +51,7 @@ func TestMigrateJSON(t *testing.T) { "deposit_params": { "max_deposit_period": "0s", "min_deposit": [], + "min_deposit_percentage": "0", "min_expedited_deposit": [] }, "deposits": [], diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index c25fa6080fb0..41405dee0bf3 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -155,7 +155,7 @@ func RandomizedGenState(simState *module.SimulationState) { govGenesis := types.NewGenesisState( startingProposalID, - types.NewDepositParams(minDeposit, depositPeriod, minExpeditedDeposit), + types.NewDepositParams(minDeposit, depositPeriod, minExpeditedDeposit, sdk.ZeroDec()), types.NewVotingParams(votingPeriod, expeditedVotingPeriod, proposalVotingPeriods), types.NewTallyParams(quorum, threshold, expeditedThreshold, veto), ) diff --git a/x/gov/types/errors.go b/x/gov/types/errors.go index 96973f1751a2..3e60500fc4ab 100644 --- a/x/gov/types/errors.go +++ b/x/gov/types/errors.go @@ -14,4 +14,5 @@ var ( ErrInvalidVote = sdkerrors.Register(ModuleName, 7, "invalid vote option") ErrInvalidGenesis = sdkerrors.Register(ModuleName, 8, "invalid genesis state") ErrNoProposalHandlerExists = sdkerrors.Register(ModuleName, 9, "no handler exists for proposal type") + ErrInvalidDeposit = sdkerrors.Register(ModuleName, 1000, "invalid deposit amount") ) diff --git a/x/gov/types/genesis.go b/x/gov/types/genesis.go index f703863736c8..be8d59ece05f 100644 --- a/x/gov/types/genesis.go +++ b/x/gov/types/genesis.go @@ -86,6 +86,12 @@ func ValidateGenesis(data *GenesisState) error { minDeposit.String()) } + minDepositPercentage := data.DepositParams.MinDepositPercentage + if minDepositPercentage.IsNegative() || minDepositPercentage.GT(sdk.OneDec()) { + return fmt.Errorf("governance min deposit percentage should be positive and less or equal to one, is %s", + minDepositPercentage.String()) + } + return nil } diff --git a/x/gov/types/gov.pb.go b/x/gov/types/gov.pb.go index 28ca20326ab4..eda776472ce8 100644 --- a/x/gov/types/gov.pb.go +++ b/x/gov/types/gov.pb.go @@ -380,6 +380,8 @@ type DepositParams struct { MaxDepositPeriod time.Duration `protobuf:"bytes,2,opt,name=max_deposit_period,json=maxDepositPeriod,proto3,stdduration" json:"max_deposit_period,omitempty" yaml:"max_deposit_period"` // Minimum expedited deposit for a proposal to enter voting period. MinExpeditedDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=min_expedited_deposit,json=minExpeditedDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"min_expedited_deposit,omitempty" yaml:"min_expedited_deposit"` + // TODO + MinDepositPercentage github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=min_deposit_percentage,json=minDepositPercentage,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_deposit_percentage,omitempty" yaml:"min_deposit_percentage"` } func (m *DepositParams) Reset() { *m = DepositParams{} } @@ -559,110 +561,112 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1beta1/gov.proto", fileDescriptor_6e82113c1a9a4b7c) } var fileDescriptor_6e82113c1a9a4b7c = []byte{ - // 1634 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcf, 0x6f, 0xe2, 0xda, - 0x15, 0xc6, 0x40, 0x7e, 0x70, 0x81, 0x84, 0x77, 0x43, 0x12, 0x42, 0xf3, 0x6c, 0xc6, 0xaf, 0x7a, - 0x8a, 0x46, 0xf3, 0xc8, 0x7b, 0x69, 0xd5, 0xaa, 0x19, 0xa9, 0x2d, 0x04, 0xa7, 0x43, 0xf5, 0x04, - 0xc8, 0xf0, 0x88, 0xde, 0x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x24, 0x42, 0xe9, 0xc4, 0x60, 0x98, 0x89, 0x51, 0x4c, 0x45, - 0x35, 0x4d, 0xd4, 0x84, 0x9f, 0x83, 0xd4, 0xa4, 0xb7, 0x2c, 0xfd, 0x54, 0x3a, 0xaa, 0x49, 0x85, - 0x44, 0x38, 0x0d, 0x07, 0xc3, 0xcc, 0x1a, 0xf5, 0x97, 0xd1, 0xcf, 0x51, 0x83, 0xa0, 0x99, 0xfc, - 0xc7, 0xb9, 0xe2, 0x97, 0x52, 0x21, 0xb1, 0xe4, 0xe5, 0x3f, 0x56, 0xb5, 0x36, 0x6a, 0x52, 0x39, - 0xf3, 0xa5, 0xab, 0x37, 0x7c, 0xe0, 0xd5, 0x1b, 0x3e, 0xf0, 0xe4, 0x9a, 0x0f, 0x5c, 0x5d, 0xf3, - 0xdc, 0xcb, 0x6b, 0x9e, 0xfb, 0xf7, 0x35, 0xcf, 0x3d, 0xbb, 0xe1, 0x03, 0x2f, 0x6f, 0xf8, 0xc0, - 0xab, 0x1b, 0x3e, 0xf0, 0xcd, 0xfb, 0xef, 0xb4, 0x4b, 0xfb, 0x3f, 0x26, 0xf6, 0xec, 0x9d, 0x2e, - 0xdb, 0x5d, 0xfe, 0x9d, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xba, 0x25, 0x63, 0x35, 0x4c, 0x11, - 0x00, 0x00, + // 1675 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcf, 0x6f, 0xe3, 0xc6, + 0x15, 0x16, 0x25, 0xf9, 0x87, 0x46, 0x92, 0xad, 0x8c, 0x65, 0x5b, 0x56, 0xbd, 0x24, 0x97, 0x29, + 0x02, 0x63, 0xb1, 0x91, 0x13, 0xb7, 0x68, 0x51, 0x2f, 0xd0, 0x56, 0xb2, 0xe8, 0xae, 0x8a, 0x40, + 0x12, 0x28, 0x45, 0x46, 0xd2, 0x03, 0x41, 0x4b, 0x63, 0x99, 0xad, 0xc8, 0x51, 0xc5, 0x91, 0x63, + 0xa1, 0x97, 0x1c, 0x17, 0x3a, 0x14, 0x39, 0x6e, 0x51, 0x08, 0x58, 0xb4, 0xe8, 0xa1, 0xbd, 0xf4, + 0xd2, 0x43, 0xcf, 0x3d, 0x19, 0x45, 0x81, 0x06, 0x3d, 0x05, 0x3d, 0x28, 0x8d, 0x0d, 0x14, 0x81, + 0x8f, 0xfe, 0x0b, 0x0a, 0x72, 0x86, 0x14, 0x29, 0x29, 0xd1, 0xaa, 0x87, 0x9c, 0x4c, 0xbe, 0x79, + 0xdf, 0xf7, 0xde, 0xfb, 0xe6, 0xbd, 0x19, 0xca, 0x60, 0xbf, 0x89, 0x2d, 0x03, 0x5b, 0x87, 0x6d, + 0x7c, 0x75, 0x78, 0xf5, 0xee, 0x39, 0x22, 0xda, 0xbb, 0xf6, 0x73, 0xae, 0xdb, 0xc3, 0x04, 0x43, + 0x48, 0x57, 0x73, 0xb6, 0x85, 0xad, 0x66, 0x79, 0x86, 0x38, 0xd7, 0x2c, 0xe4, 0x41, 0x9a, 0x58, + 0x37, 0x29, 0x26, 0x9b, 0x6e, 0xe3, 0x36, 0x76, 0x1e, 0x0f, 0xed, 0x27, 0x66, 0xdd, 0xa3, 0x28, + 0x95, 0x2e, 0x30, 0x5a, 0xba, 0x24, 0xb4, 0x31, 0x6e, 0x77, 0xd0, 0xa1, 0xf3, 0x76, 0xde, 0xbf, + 0x38, 0x24, 0xba, 0x81, 0x2c, 0xa2, 0x19, 0x5d, 0x17, 0x3b, 0xed, 0xa0, 0x99, 0x03, 0xb6, 0xc4, + 0x4f, 0x2f, 0xb5, 0xfa, 0x3d, 0x8d, 0xe8, 0x98, 0x25, 0x23, 0xfd, 0x81, 0x03, 0xf0, 0x0c, 0xe9, + 0xed, 0x4b, 0x82, 0x5a, 0x0d, 0x4c, 0x50, 0xa5, 0x6b, 0x2f, 0xc2, 0xef, 0x81, 0x55, 0xec, 0x3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, 0x42, 0x82, 0x17, 0xe2, 0x0f, + 0xc0, 0xa3, 0x69, 0x70, 0xa3, 0x52, 0x2f, 0x95, 0x7f, 0xe2, 0x62, 0xc3, 0xd9, 0x9d, 0xe1, 0x48, + 0x84, 0x14, 0x1b, 0xe8, 0xa2, 0xa7, 0x60, 0x67, 0x1a, 0x5a, 0xcd, 0xd7, 0x6a, 0x72, 0x31, 0x15, + 0xc9, 0xa6, 0x86, 0x23, 0x31, 0x41, 0x31, 0x55, 0xcd, 0xb2, 0x50, 0x0b, 0xbe, 0x03, 0x32, 0xd3, + 0xde, 0x8a, 0xfc, 0x53, 0xf9, 0xa4, 0x2e, 0x17, 0x53, 0xd1, 0x2c, 0x1c, 0x8e, 0xc4, 0x0d, 0xea, + 0xaf, 0xa0, 0x9f, 0xa3, 0x26, 0x41, 0x73, 0xf9, 0x4f, 0xf3, 0xa5, 0xf7, 0xe4, 0x62, 0x6a, 0xc5, + 0xcf, 0x7f, 0xaa, 0xe9, 0x1d, 0xd4, 0xa2, 0x72, 0x16, 0xca, 0x37, 0x5f, 0xf0, 0xa1, 0xcf, 0xbe, + 0xe0, 0x43, 0x1f, 0xdf, 0xf2, 0xa1, 0x9b, 0x5b, 0x9e, 0xfb, 0xf4, 0x96, 0xe7, 0xfe, 0x73, 0xcb, + 0x73, 0x9f, 0xdc, 0xf1, 0xa1, 0x4f, 0xef, 0xf8, 0xd0, 0x67, 0x77, 0x7c, 0xe8, 0xc3, 0xaf, 0xbf, + 0x7f, 0xaf, 0x9d, 0xff, 0xee, 0x38, 0xb3, 0x77, 0xbe, 0xea, 0x74, 0xf9, 0x77, 0xfe, 0x17, 0x00, + 0x00, 0xff, 0xff, 0x90, 0xa0, 0x98, 0x3b, 0xf8, 0x11, 0x00, 0x00, } func (this *TextProposal) Equal(that interface{}) bool { @@ -1153,6 +1157,16 @@ func (m *DepositParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size := m.MinDepositPercentage.Size() + i -= size + if _, err := m.MinDepositPercentage.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 if len(m.MinExpeditedDeposit) > 0 { for iNdEx := len(m.MinExpeditedDeposit) - 1; iNdEx >= 0; iNdEx-- { { @@ -1510,6 +1524,8 @@ func (m *DepositParams) Size() (n int) { n += 1 + l + sovGov(uint64(l)) } } + l = m.MinDepositPercentage.Size() + n += 1 + l + sovGov(uint64(l)) return n } @@ -2735,6 +2751,39 @@ func (m *DepositParams) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinDepositPercentage", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MinDepositPercentage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) diff --git a/x/gov/types/params.go b/x/gov/types/params.go index 9f0792027682..32d06d2f5404 100644 --- a/x/gov/types/params.go +++ b/x/gov/types/params.go @@ -23,6 +23,7 @@ const ( var ( DefaultMinDepositTokens = sdk.NewInt(10000000) DefaultMinExpeditedDepositTokens = sdk.NewInt(10000000 * 5) + DefaultMinDepositPercentage = sdk.ZeroDec() DefaultQuorum = sdk.NewDecWithPrec(334, 3) DefaultThreshold = sdk.NewDecWithPrec(5, 1) DefaultExpeditedThreshold = sdk.NewDecWithPrec(667, 3) @@ -48,11 +49,12 @@ func ParamKeyTable() paramtypes.KeyTable { } // NewDepositParams creates a new DepositParams object -func NewDepositParams(minDeposit sdk.Coins, maxDepositPeriod time.Duration, minExpeditedDeposit sdk.Coins) DepositParams { +func NewDepositParams(minDeposit sdk.Coins, maxDepositPeriod time.Duration, minExpeditedDeposit sdk.Coins, minDepositPercentage sdk.Dec) DepositParams { return DepositParams{ - MinDeposit: minDeposit, - MaxDepositPeriod: maxDepositPeriod, - MinExpeditedDeposit: minExpeditedDeposit, + MinDeposit: minDeposit, + MaxDepositPeriod: maxDepositPeriod, + MinExpeditedDeposit: minExpeditedDeposit, + MinDepositPercentage: minDepositPercentage, } } @@ -62,6 +64,7 @@ func DefaultDepositParams() DepositParams { sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, DefaultMinDepositTokens)), DefaultPeriod, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, DefaultMinExpeditedDepositTokens)), + DefaultMinDepositPercentage, ) } @@ -72,8 +75,8 @@ func (dp DepositParams) String() string { } // Equal checks equality of DepositParams -func (dp DepositParams) Equal(dp2 DepositParams) bool { - return dp.MinDeposit.IsEqual(dp2.MinDeposit) && dp.MaxDepositPeriod == dp2.MaxDepositPeriod +func (dp DepositParams) Equal(other DepositParams) bool { + return dp.MinDeposit.IsEqual(other.MinDeposit) && other.MaxDepositPeriod == other.MaxDepositPeriod && dp.MinExpeditedDeposit.IsEqual(other.MinExpeditedDeposit) && dp.MinDepositPercentage.Equal(other.MinDepositPercentage) } func validateDepositParams(i interface{}) error { @@ -96,6 +99,12 @@ func validateDepositParams(i interface{}) error { if minExpeditedDeposit.IsAllLTE(minDeposit) { return fmt.Errorf("minimum expedited deposit %s must be greater than expedited deposit %s", minExpeditedDeposit, minDeposit) } + if v.MinDepositPercentage.IsNegative() { + return fmt.Errorf("minimum deposit percentage cannot be negative: %s", v.MinDepositPercentage) + } + if v.MinDepositPercentage.GT(sdk.OneDec()) { + return fmt.Errorf("minimum deposit percentage too large: %s", v) + } return nil } diff --git a/x/params/proposal_handler_test.go b/x/params/proposal_handler_test.go index 3005418d7b80..3f3cc6d40302 100644 --- a/x/params/proposal_handler_test.go +++ b/x/params/proposal_handler_test.go @@ -69,9 +69,10 @@ func (suite *HandlerTestSuite) TestProposalHandler() { func() { depositParams := suite.app.GovKeeper.GetDepositParams(suite.ctx) suite.Require().Equal(govtypes.DepositParams{ - MinDeposit: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(64000000))), - MaxDepositPeriod: govtypes.DefaultPeriod, - MinExpeditedDeposit: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(64000001))), + MinDeposit: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(64000000))), + MaxDepositPeriod: govtypes.DefaultPeriod, + MinExpeditedDeposit: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(64000001))), + MinDepositPercentage: govtypes.DefaultMinDepositPercentage, }, depositParams) }, false,