diff --git a/proto/atomone/gov/v1/gov.proto b/proto/atomone/gov/v1/gov.proto index 8780de153..c217422f1 100644 --- a/proto/atomone/gov/v1/gov.proto +++ b/proto/atomone/gov/v1/gov.proto @@ -179,6 +179,18 @@ message TallyParams { // Minimum proportion of Yes votes for proposal to pass. Default value: 2/3. string threshold = 2 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // quorum for constitution amendment proposals + string constitution_amendment_quorum = 3 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum proportion of Yes votes for a Constitution Amendment proposal to pass. Default value: 0.9. + string constitution_amendment_threshold = 4 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // quorum for law proposals + string law_quorum = 5 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum proportion of Yes votes for a Law proposal to pass. Default value: 0.9. + string law_threshold = 6 [(cosmos_proto.scalar) = "cosmos.Dec"]; } // Params defines the parameters for the x/gov module. @@ -213,9 +225,6 @@ message Params { // burn deposits if the proposal does not enter voting period bool burn_proposal_deposit_prevote = 14; - // burn deposits if quorum with vote type no_veto is met - bool burn_vote_veto = 15; - // The ratio representing the proportion of the deposit value minimum that // must be met when making a deposit. Default value: 0.01. Meaning that for a // chain with a min_deposit of 100stake, a deposit of 1stake would be @@ -223,5 +232,17 @@ message Params { // // Since: cosmos-sdk 0.50 // NOTE: backported from v50 (https://github.com/cosmos/cosmos-sdk/pull/18146) - string min_deposit_ratio = 16 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; + string min_deposit_ratio = 15 [ (cosmos_proto.scalar) = "cosmos.Dec" ]; + + // quorum for constitution amendment proposals + string constitution_amendment_quorum = 16 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum proportion of Yes votes for a Constitution Amendment proposal to pass. Default value: 0.9. + string constitution_amendment_threshold = 17 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // quorum for law proposals + string law_quorum = 18 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum proportion of Yes votes for a Law proposal to pass. Default value: 0.9. + string law_threshold = 19 [(cosmos_proto.scalar) = "cosmos.Dec"]; } diff --git a/proto/atomone/gov/v1beta1/gov.proto b/proto/atomone/gov/v1beta1/gov.proto index f0923808c..067b8b858 100644 --- a/proto/atomone/gov/v1beta1/gov.proto +++ b/proto/atomone/gov/v1beta1/gov.proto @@ -65,6 +65,32 @@ message TextProposal { string description = 2; } +message LawProposal { + option (cosmos_proto.implements_interface) = "atomone.gov.v1beta1.Content"; + option (amino.name) = "atomone/LawProposal"; + + option (gogoproto.equal) = true; + + // title of the proposal. + string title = 1; + + // description associated with the proposal. + string description = 2; +} + +message ConstitutionAmendmentProposal { + option (cosmos_proto.implements_interface) = "atomone.gov.v1beta1.Content"; + option (amino.name) = "atomone/ConstitutionAmendmentProposal"; + + option (gogoproto.equal) = true; + + // title of the proposal. + string title = 1; + + // description associated with the proposal. + string description = 2; +} + // Deposit defines an amount deposited by an account address to an active // proposal. message Deposit { diff --git a/tests/e2e/genesis.go b/tests/e2e/genesis.go index e7dfcb1a0..2107c40e1 100644 --- a/tests/e2e/genesis.go +++ b/tests/e2e/genesis.go @@ -124,6 +124,10 @@ func modifyGenesis(path, moniker, amountStr string, addrAll []sdk.AccAddress, de amnt := sdk.NewInt(10000) quorum, _ := sdk.NewDecFromStr("0.000000000000000001") threshold, _ := sdk.NewDecFromStr("0.000000000000000001") + lawQuorum, _ := sdk.NewDecFromStr("0.000000000000000001") + lawThreshold, _ := sdk.NewDecFromStr("0.000000000000000001") + amendmentsQuorum, _ := sdk.NewDecFromStr("0.000000000000000001") + amendmentsThreshold, _ := sdk.NewDecFromStr("0.000000000000000001") maxDepositPeriod := 10 * time.Minute votingPeriod := 15 * time.Second @@ -133,6 +137,7 @@ func modifyGenesis(path, moniker, amountStr string, addrAll []sdk.AccAddress, de sdk.NewCoins(sdk.NewCoin(denom, amnt)), maxDepositPeriod, votingPeriod, quorum.String(), threshold.String(), + amendmentsQuorum.String(), amendmentsThreshold.String(), lawQuorum.String(), lawThreshold.String(), sdk.ZeroDec().String(), false, false, govv1.DefaultMinDepositRatio.String(), ), diff --git a/x/gov/keeper/common_test.go b/x/gov/keeper/common_test.go index 6cdb17007..054bb9f2f 100644 --- a/x/gov/keeper/common_test.go +++ b/x/gov/keeper/common_test.go @@ -28,9 +28,11 @@ import ( ) var ( - _, _, addr = testdata.KeyTestPubAddr() - govAcct = authtypes.NewModuleAddress(types.ModuleName) - TestProposal = getTestProposal() + _, _, addr = testdata.KeyTestPubAddr() + govAcct = authtypes.NewModuleAddress(types.ModuleName) + TestProposal = getTestProposal() + TestAmendmentProposal = getTestConstitutionAmendmentProposal() + TestLawProposal = getTestLawProposal() ) // getTestProposal creates and returns a test proposal message. @@ -46,6 +48,32 @@ func getTestProposal() []sdk.Msg { } } +// getTestConstitutionAmendmentProposal creates and returns a test constitution amendment proposal message. +func getTestConstitutionAmendmentProposal() []sdk.Msg { + legacyProposalMsg, err := v1.NewLegacyContent(v1beta1.NewConstitutionAmendmentProposal("Title", "description"), authtypes.NewModuleAddress(types.ModuleName).String()) + if err != nil { + panic(err) + } + + return []sdk.Msg{ + banktypes.NewMsgSend(govAcct, addr, sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(1000)))), + legacyProposalMsg, + } +} + +// getTestLawProposal creates and returns a test law proposal message. +func getTestLawProposal() []sdk.Msg { + legacyProposalMsg, err := v1.NewLegacyContent(v1beta1.NewLawProposal("Title", "description"), authtypes.NewModuleAddress(types.ModuleName).String()) + if err != nil { + panic(err) + } + + return []sdk.Msg{ + banktypes.NewMsgSend(govAcct, addr, sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(1000)))), + legacyProposalMsg, + } +} + type mocks struct { acctKeeper *govtestutil.MockAccountKeeper bankKeeper *govtestutil.MockBankKeeper diff --git a/x/gov/keeper/msg_server_test.go b/x/gov/keeper/msg_server_test.go index 6dc5f2890..2489db4f3 100644 --- a/x/gov/keeper/msg_server_test.go +++ b/x/gov/keeper/msg_server_test.go @@ -905,7 +905,7 @@ func (suite *KeeperTestSuite) TestMsgUpdateParams() { } }, expErr: true, - expErrMsg: "quorom cannot be negative", + expErrMsg: "quorum must be positive", }, { name: "quorum > 1", @@ -919,7 +919,7 @@ func (suite *KeeperTestSuite) TestMsgUpdateParams() { } }, expErr: true, - expErrMsg: "quorom too large", + expErrMsg: "quorum too large", }, { name: "invalid threshold", @@ -963,6 +963,118 @@ func (suite *KeeperTestSuite) TestMsgUpdateParams() { expErr: true, expErrMsg: "vote threshold too large", }, + { + name: "negative constitution amendment quorum", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.ConstitutionAmendmentQuorum = "-0.1" + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "constitution amendment quorum must be positive", + }, + { + name: "constitution amendments quorum > 1", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.ConstitutionAmendmentQuorum = "2" + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "constitution amendment quorum too large", + }, + { + name: "negative constitution amendment threshold", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.ConstitutionAmendmentThreshold = "-0.1" + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "constitution amendment threshold must be positive", + }, + { + name: "constitution amendments threshold > 1", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.ConstitutionAmendmentThreshold = "2" + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "constitution amendment threshold too large", + }, + { + name: "negative law quorum", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.LawQuorum = "-0.1" + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "law quorum must be positive", + }, + { + name: "law quorum > 1", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.LawQuorum = "2" + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "law quorum too large", + }, + { + name: "negative law threshold", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.LawThreshold = "-0.1" + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "law threshold must be positive", + }, + { + name: "law threshold > 1", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.LawThreshold = "2" + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "law threshold too large", + }, { name: "invalid voting period", input: func() *v1.MsgUpdateParams { diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index 33e73c066..b84760335 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -7,6 +7,7 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" v1 "github.com/atomone-hub/atomone/x/gov/types/v1" + "github.com/atomone-hub/atomone/x/gov/types/v1beta1" ) // TODO: Break into several smaller functions for clarity @@ -85,6 +86,48 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, // If there is not enough quorum of votes, the proposal fails percentVoting := totalVotingPower.Quo(sdk.NewDecFromInt(totalBondedTokens)) quorum, _ := sdk.NewDecFromStr(params.Quorum) + threshold, _ := sdk.NewDecFromStr(params.Threshold) + + // Check if a proposal message is an ExecLegacyContent message + if len(proposal.Messages) > 0 { + var sdkMsg sdk.Msg + for _, msg := range proposal.Messages { + if err := keeper.cdc.UnpackAny(msg, &sdkMsg); err == nil { + execMsg, ok := sdkMsg.(*v1.MsgExecLegacyContent) + if !ok { + continue + } + var content v1beta1.Content + if err := keeper.cdc.UnpackAny(execMsg.Content, &content); err != nil { + return false, false, tallyResults + } + + // Check if proposal is a law or constitution amendment and adjust the + // quorum and threshold accordingly + switch content.(type) { + case *v1beta1.ConstitutionAmendmentProposal: + q, _ := sdk.NewDecFromStr(params.ConstitutionAmendmentQuorum) + if quorum.LT(q) { + quorum = q + } + t, _ := sdk.NewDecFromStr(params.ConstitutionAmendmentThreshold) + if threshold.LT(t) { + threshold = t + } + case *v1beta1.LawProposal: + q, _ := sdk.NewDecFromStr(params.LawQuorum) + if quorum.LT(q) { + quorum = q + } + t, _ := sdk.NewDecFromStr(params.LawThreshold) + if threshold.LT(t) { + threshold = t + } + } + } + } + } + if percentVoting.LT(quorum) { return false, params.BurnVoteQuorum, tallyResults } @@ -95,7 +138,6 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, } // If more than 2/3 of non-abstaining voters vote Yes, proposal passes - threshold, _ := sdk.NewDecFromStr(params.Threshold) if results[v1.OptionYes].Quo(totalVotingPower.Sub(results[v1.OptionAbstain])).GT(threshold) { return true, false, tallyResults } diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index 79aed2dd9..74e5438ad 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -121,6 +121,7 @@ func TestTally(t *testing.T) { tests := []struct { name string setup func(*tallyFixture) + proposalMsgs []sdk.Msg expectedPass bool expectedBurn bool expectedTally v1.TallyResult @@ -128,6 +129,7 @@ func TestTally(t *testing.T) { }{ { name: "no votes: prop fails/burn deposit", + proposalMsgs: TestProposal, expectedPass: false, expectedBurn: true, expectedTally: v1.TallyResult{ @@ -141,6 +143,7 @@ func TestTally(t *testing.T) { setup: func(s *tallyFixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_NO) }, + proposalMsgs: TestProposal, expectedPass: false, expectedBurn: true, // burn because quorum not reached expectedTally: v1.TallyResult{ @@ -154,6 +157,7 @@ func TestTally(t *testing.T) { setup: func(s *tallyFixture) { s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_YES) }, + proposalMsgs: TestProposal, expectedPass: false, expectedBurn: true, // burn because quorum not reached expectedTally: v1.TallyResult{ @@ -168,6 +172,7 @@ func TestTally(t *testing.T) { s.delegate(s.delAddrs[0], s.valAddrs[0], 2) s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_YES) }, + proposalMsgs: TestProposal, expectedPass: false, expectedBurn: true, // burn because quorum not reached expectedTally: v1.TallyResult{ @@ -183,6 +188,7 @@ func TestTally(t *testing.T) { s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) }, + proposalMsgs: TestProposal, expectedPass: false, expectedBurn: true, // burn because quorum not reached expectedTally: v1.TallyResult{ @@ -198,6 +204,7 @@ func TestTally(t *testing.T) { s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_NO) }, + proposalMsgs: TestProposal, expectedPass: false, expectedBurn: true, // burn because quorum not reached expectedTally: v1.TallyResult{ @@ -213,6 +220,7 @@ func TestTally(t *testing.T) { s.delegate(s.delAddrs[1], s.valAddrs[0], 2) s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_NO) }, + proposalMsgs: TestProposal, expectedPass: false, expectedBurn: true, // burn because quorum not reached expectedTally: v1.TallyResult{ @@ -236,6 +244,7 @@ func TestTally(t *testing.T) { s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_ABSTAIN) }, + proposalMsgs: TestProposal, expectedPass: true, expectedBurn: false, expectedTally: v1.TallyResult{ @@ -252,6 +261,7 @@ func TestTally(t *testing.T) { s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_ABSTAIN) s.validatorVote(s.valAddrs[3], v1.VoteOption_VOTE_OPTION_ABSTAIN) }, + proposalMsgs: TestProposal, expectedPass: false, expectedBurn: false, expectedTally: v1.TallyResult{ @@ -268,6 +278,7 @@ func TestTally(t *testing.T) { s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_NO) s.validatorVote(s.valAddrs[3], v1.VoteOption_VOTE_OPTION_NO) }, + proposalMsgs: TestProposal, expectedPass: false, expectedBurn: false, expectedTally: v1.TallyResult{ @@ -286,6 +297,7 @@ func TestTally(t *testing.T) { s.validatorVote(s.valAddrs[4], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[5], v1.VoteOption_VOTE_OPTION_NO) }, + proposalMsgs: TestProposal, expectedPass: true, expectedBurn: false, expectedTally: v1.TallyResult{ @@ -304,6 +316,7 @@ func TestTally(t *testing.T) { s.validatorVote(s.valAddrs[4], v1.VoteOption_VOTE_OPTION_ABSTAIN) s.validatorVote(s.valAddrs[5], v1.VoteOption_VOTE_OPTION_ABSTAIN) }, + proposalMsgs: TestProposal, expectedPass: true, expectedBurn: false, expectedTally: v1.TallyResult{ @@ -312,6 +325,117 @@ func TestTally(t *testing.T) { NoCount: "1", }, }, + { + name: "amendment quorum not reached: prop fails", + setup: func(s *tallyFixture) { + s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) + s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) + s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_NO) + }, + proposalMsgs: TestAmendmentProposal, + expectedPass: false, + expectedBurn: true, + expectedTally: v1.TallyResult{ + YesCount: "2", + AbstainCount: "0", + NoCount: "1", + }, + }, + { + name: "amendment quorum reached and threshold not reached: prop fails", + setup: func(s *tallyFixture) { + s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) + s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) + s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_NO) + s.validatorVote(s.valAddrs[3], v1.VoteOption_VOTE_OPTION_ABSTAIN) + s.validatorVote(s.valAddrs[4], v1.VoteOption_VOTE_OPTION_ABSTAIN) + s.validatorVote(s.valAddrs[5], v1.VoteOption_VOTE_OPTION_ABSTAIN) + }, + proposalMsgs: TestAmendmentProposal, + expectedPass: false, + expectedBurn: false, + expectedTally: v1.TallyResult{ + YesCount: "2", + AbstainCount: "3", + NoCount: "1", + }, + }, + { + name: "amendment quorum reached and threshold reached: prop passes", + setup: func(s *tallyFixture) { + s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) + s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) + s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_NO) + s.validatorVote(s.valAddrs[3], v1.VoteOption_VOTE_OPTION_YES) + s.validatorVote(s.valAddrs[4], v1.VoteOption_VOTE_OPTION_YES) + s.delegate(s.delAddrs[0], s.valAddrs[5], 2) + s.delegate(s.delAddrs[0], s.valAddrs[6], 2) + s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_YES) + s.delegate(s.delAddrs[1], s.valAddrs[5], 1) + s.delegate(s.delAddrs[1], s.valAddrs[6], 1) + s.vote(s.delAddrs[1], v1.VoteOption_VOTE_OPTION_YES) + }, + proposalMsgs: TestAmendmentProposal, + expectedPass: true, + expectedBurn: false, + expectedTally: v1.TallyResult{ + YesCount: "10", + AbstainCount: "0", + NoCount: "1", + }, + }, + { + name: "law quorum not reached: prop fails", + setup: func(s *tallyFixture) { + s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) + s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) + s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_NO) + }, + proposalMsgs: TestLawProposal, + expectedPass: false, + expectedBurn: true, + expectedTally: v1.TallyResult{ + YesCount: "2", + AbstainCount: "0", + NoCount: "1", + }, + }, + { + name: "law quorum reached and threshold not reached: prop fails", + setup: func(s *tallyFixture) { + s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) + s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) + s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_NO) + s.validatorVote(s.valAddrs[3], v1.VoteOption_VOTE_OPTION_ABSTAIN) + s.validatorVote(s.valAddrs[4], v1.VoteOption_VOTE_OPTION_ABSTAIN) + s.validatorVote(s.valAddrs[5], v1.VoteOption_VOTE_OPTION_ABSTAIN) + }, + proposalMsgs: TestLawProposal, + expectedPass: false, + expectedBurn: false, + expectedTally: v1.TallyResult{ + YesCount: "2", + AbstainCount: "3", + NoCount: "1", + }, + }, + { + name: "law quorum reached and threshold reached: prop passes", + setup: func(s *tallyFixture) { + s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) + s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) + s.validatorVote(s.valAddrs[3], v1.VoteOption_VOTE_OPTION_YES) + s.validatorVote(s.valAddrs[5], v1.VoteOption_VOTE_OPTION_ABSTAIN) + }, + proposalMsgs: TestLawProposal, + expectedPass: true, + expectedBurn: false, + expectedTally: v1.TallyResult{ + YesCount: "3", + AbstainCount: "1", + NoCount: "0", + }, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -329,7 +453,7 @@ func TestTally(t *testing.T) { delAddrs = addrs[numVals:] ) // Submit and activate a proposal - proposal, err := govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", delAddrs[0]) + proposal, err := govKeeper.SubmitProposal(ctx, tt.proposalMsgs, "", "title", "summary", delAddrs[0]) require.NoError(t, err) govKeeper.ActivateVotingPeriod(ctx, proposal) // Create the test fixture diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index 7b16b031a..810131040 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -20,13 +20,16 @@ import ( // Simulation parameter constants const ( - DepositParamsMinDeposit = "deposit_params_min_deposit" - DepositParamsDepositPeriod = "deposit_params_deposit_period" - DepositMinInitialRatio = "deposit_params_min_initial_ratio" - VotingParamsVotingPeriod = "voting_params_voting_period" - TallyParamsQuorum = "tally_params_quorum" - TallyParamsThreshold = "tally_params_threshold" - TallyParamsVeto = "tally_params_veto" + DepositParamsMinDeposit = "deposit_params_min_deposit" + DepositParamsDepositPeriod = "deposit_params_deposit_period" + DepositMinInitialRatio = "deposit_params_min_initial_ratio" + VotingParamsVotingPeriod = "voting_params_voting_period" + TallyParamsQuorum = "tally_params_quorum" + TallyParamsThreshold = "tally_params_threshold" + TallyParamsConstitutionAmendmentQuorum = "tally_params_constitution_amendment_quorum" + TallyParamsConstitutionAmendmentThreshold = "tally_params_constitution_amendment_threshold" + TallyParamsLawQuorum = "tally_params_law_quorum" + TallyParamsLawThreshold = "tally_params_law_threshold" // NOTE: backport from v50 MinDepositRatio = "min_deposit_ratio" @@ -67,6 +70,18 @@ func GenMinDepositRatio(r *rand.Rand) math.LegacyDec { return math.LegacyMustNewDecFromStr("0.01") } +// GenTallyParamsQuorum returns randomized TallyParamsQuorum +func GenTallyParamsConstitutionalQuorum(r *rand.Rand, minDec sdk.Dec) math.LegacyDec { + min := int(minDec.Mul(sdk.NewDec(1000)).RoundInt64()) + return sdk.NewDecWithPrec(int64(simulation.RandIntBetween(r, min, 600)), 3) +} + +// GenTallyParamsThreshold returns randomized TallyParamsThreshold +func GenTallyParamsConstitutionalThreshold(r *rand.Rand, minDec sdk.Dec) math.LegacyDec { + min := int(minDec.Mul(sdk.NewDec(1000)).RoundInt64()) + return sdk.NewDecWithPrec(int64(simulation.RandIntBetween(r, min, 950)), 3) +} + // RandomizedGenState generates a random GenesisState for gov func RandomizedGenState(simState *module.SimulationState) { startingProposalID := uint64(simState.Rand.Intn(100)) @@ -110,9 +125,33 @@ func RandomizedGenState(simState *module.SimulationState) { var minDepositRatio math.LegacyDec simState.AppParams.GetOrGenerate(simState.Cdc, MinDepositRatio, &minDepositRatio, simState.Rand, func(r *rand.Rand) { minDepositRatio = GenMinDepositRatio(r) }) + var lawQuorum sdk.Dec + simState.AppParams.GetOrGenerate( + simState.Cdc, TallyParamsLawQuorum, &lawQuorum, simState.Rand, + func(r *rand.Rand) { lawQuorum = GenTallyParamsConstitutionalQuorum(r, quorum) }, + ) + + var lawThreshold sdk.Dec + simState.AppParams.GetOrGenerate( + simState.Cdc, TallyParamsLawThreshold, &lawThreshold, simState.Rand, + func(r *rand.Rand) { lawThreshold = GenTallyParamsConstitutionalThreshold(r, threshold) }, + ) + + var amendmentsQuorum sdk.Dec + simState.AppParams.GetOrGenerate( + simState.Cdc, TallyParamsConstitutionAmendmentQuorum, &amendmentsQuorum, simState.Rand, + func(r *rand.Rand) { amendmentsQuorum = GenTallyParamsConstitutionalQuorum(r, lawQuorum) }, + ) + + var amendmentsThreshold sdk.Dec + simState.AppParams.GetOrGenerate( + simState.Cdc, TallyParamsConstitutionAmendmentThreshold, &amendmentsThreshold, simState.Rand, + func(r *rand.Rand) { amendmentsThreshold = GenTallyParamsConstitutionalThreshold(r, lawThreshold) }, + ) + govGenesis := v1.NewGenesisState( startingProposalID, - v1.NewParams(minDeposit, depositPeriod, votingPeriod, quorum.String(), threshold.String(), minInitialDepositRatio.String(), simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, minDepositRatio.String()), + v1.NewParams(minDeposit, depositPeriod, votingPeriod, quorum.String(), threshold.String(), amendmentsQuorum.String(), amendmentsThreshold.String(), lawQuorum.String(), lawThreshold.String(), minInitialDepositRatio.String(), simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, minDepositRatio.String()), ) bz, err := json.MarshalIndent(&govGenesis, "", " ") diff --git a/x/gov/simulation/genesis_test.go b/x/gov/simulation/genesis_test.go index 1437109ad..23a8de2c0 100644 --- a/x/gov/simulation/genesis_test.go +++ b/x/gov/simulation/genesis_test.go @@ -46,6 +46,10 @@ func TestRandomizedGenState(t *testing.T) { const ( tallyQuorum = "0.362000000000000000" tallyThreshold = "0.639000000000000000" + amendmentQuorum = "0.579000000000000000" + amendmentThreshold = "0.895000000000000000" + lawQuorum = "0.552000000000000000" + lawThreshold = "0.816000000000000000" minInitialDepositDec = "0.590000000000000000" ) @@ -54,6 +58,11 @@ func TestRandomizedGenState(t *testing.T) { require.Equal(t, float64(275567), govGenesis.Params.VotingPeriod.Seconds()) require.Equal(t, tallyQuorum, govGenesis.Params.Quorum) require.Equal(t, tallyThreshold, govGenesis.Params.Threshold) + require.Equal(t, amendmentQuorum, govGenesis.Params.ConstitutionAmendmentQuorum) + require.Equal(t, amendmentThreshold, govGenesis.Params.ConstitutionAmendmentThreshold) + require.Equal(t, lawQuorum, govGenesis.Params.LawQuorum) + require.Equal(t, lawThreshold, govGenesis.Params.LawThreshold) + require.Equal(t, minInitialDepositDec, govGenesis.Params.MinInitialDepositRatio) require.Equal(t, uint64(0x28), govGenesis.StartingProposalId) require.Equal(t, []*v1.Deposit{}, govGenesis.Deposits) require.Equal(t, []*v1.Vote{}, govGenesis.Votes) diff --git a/x/gov/simulation/proposals.go b/x/gov/simulation/proposals.go index eb270c6f3..d48c0b661 100644 --- a/x/gov/simulation/proposals.go +++ b/x/gov/simulation/proposals.go @@ -40,6 +40,16 @@ func ProposalContents() []simtypes.WeightedProposalContent { DefaultWeightTextProposal, SimulateLegacyTextProposalContent, ), + simulation.NewWeightedProposalContent( + OpWeightMsgDeposit, + DefaultWeightTextProposal, + SimulateConstitutionAmendmentProposalContent, + ), + simulation.NewWeightedProposalContent( + OpWeightMsgDeposit, + DefaultWeightTextProposal, + SimulateLawProposalContent, + ), } } @@ -52,3 +62,23 @@ func SimulateLegacyTextProposalContent(r *rand.Rand, _ sdk.Context, _ []simtypes simtypes.RandStringOfLength(r, 5000), ) } + +// SimulateConstitutionAmendmentProposalContent returns a random constitution amendment proposal content. +// +//nolint:staticcheck +func SimulateConstitutionAmendmentProposalContent(r *rand.Rand, _ sdk.Context, _ []simtypes.Account) simtypes.Content { + return v1beta1.NewConstitutionAmendmentProposal( + simtypes.RandStringOfLength(r, 140), + simtypes.RandStringOfLength(r, 5000), + ) +} + +// SimulateLawProposalContent returns a random law proposal content. +// +//nolint:staticcheck +func SimulateLawProposalContent(r *rand.Rand, _ sdk.Context, _ []simtypes.Account) simtypes.Content { + return v1beta1.NewLawProposal( + simtypes.RandStringOfLength(r, 140), + simtypes.RandStringOfLength(r, 5000), + ) +} diff --git a/x/gov/simulation/proposals_test.go b/x/gov/simulation/proposals_test.go index f9837ba83..8948f45bd 100644 --- a/x/gov/simulation/proposals_test.go +++ b/x/gov/simulation/proposals_test.go @@ -46,18 +46,17 @@ func TestProposalContents(t *testing.T) { // execute ProposalContents function weightedProposalContent := simulation.ProposalContents() - assert.Assert(t, len(weightedProposalContent) == 1) + assert.Assert(t, len(weightedProposalContent) == 3) - w0 := weightedProposalContent[0] + for _, w := range weightedProposalContent { + // tests w interface: + assert.Equal(t, simulation.OpWeightMsgDeposit, w.AppParamsKey()) + assert.Equal(t, simulation.DefaultWeightTextProposal, w.DefaultWeight()) - // tests w0 interface: - assert.Equal(t, simulation.OpWeightMsgDeposit, w0.AppParamsKey()) - assert.Equal(t, simulation.DefaultWeightTextProposal, w0.DefaultWeight()) - - content := w0.ContentSimulatorFn()(r, ctx, accounts) + content := w.ContentSimulatorFn()(r, ctx, accounts) - assert.Equal(t, "NxImpptHBIFDQfnxaTiOBJUgNzvqHbVcVJYlIFWFlzFqqRTTyFzDUMntPzyRamUFqeJAEaSHIuUHZoTWDjWXsYxYvwXwXZEsjRQKgKMselyUqWXMbHzRNDHnMzhWSirUgVggjiBxtWDfhzPDgrorEoNmDEiDdBldYegphCBTYWrmFFXNjxhtygsGBFHTejaKjMsqNdikEzDalEyWRHfJhKqifCKsedVuuJbQMbmRVuIPDluAWGpngjgBjOxuRFwSadayHNIhVVmNWBbfaTOldclxTTLUMvaBnLfwjHTtsKetEIvgrxLijhKJNablmvqpWIWsmhWQAYNLycREypoASHnyKWrxpoNLBJuyCGysZJgXbQAAmSIbGxMFXuwMVGZgBiZWfPWorAfjBeekCFvljHAtVZaTOsRxbPIioNxLTnWUTzGTvaNhplQQPmMADRRDuUIsiBpnGqPheKmLnopieVseFdTSAvOCacxaqFWFuXzsrVZzlGfeR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oFBIHxvimmIZwLfFyKUfEWAnNBdtdzDmTPXtpHRGdIbuucfTjOygZsTxPjf", content.GetDescription()) - assert.Equal(t, "XhSUkMhPjMaxKlMIJMOXcnQfyzeOcbWwNbeHVIkPZBSpYuLyYggwexjxusrBqDOTtGTOWeLrQKjLxzIivHSlcxgdXhhuTSkuxKGLwQvuyNhYFmBZHeAerqyNEUzXPFGkqEGqiQWIXnku", content.GetTitle()) - assert.Equal(t, "gov", content.ProposalRoute()) - assert.Equal(t, "Text", content.ProposalType()) + assert.Assert(t, content != nil) + assert.Equal(t, "gov", content.ProposalRoute()) + assert.Assert(t, content.ProposalType() == "Text" || content.ProposalType() == "Law" || content.ProposalType() == "ConstitutionAmendment") + } } diff --git a/x/gov/types/v1/genesis_test.go b/x/gov/types/v1/genesis_test.go index ddd75fd90..f5b3a0307 100644 --- a/x/gov/types/v1/genesis_test.go +++ b/x/gov/types/v1/genesis_test.go @@ -70,7 +70,7 @@ func TestValidateGenesis(t *testing.T) { return v1.NewGenesisState(v1.DefaultStartingProposalID, params1) }, - expErrMsg: "quorom too large", + expErrMsg: "quorum too large", }, { name: "invalid threshold", @@ -82,6 +82,46 @@ func TestValidateGenesis(t *testing.T) { }, expErrMsg: "vote threshold too large", }, + { + name: "invalid constitution amendment quorum", + genesisState: func() *v1.GenesisState { + params1 := params + params1.ConstitutionAmendmentQuorum = "2" + + return v1.NewGenesisState(v1.DefaultStartingProposalID, params1) + }, + expErrMsg: "constitution amendment quorum too large", + }, + { + name: "invalid constitution amendment threshold", + genesisState: func() *v1.GenesisState { + params1 := params + params1.ConstitutionAmendmentThreshold = "-1" + + return v1.NewGenesisState(v1.DefaultStartingProposalID, params1) + }, + expErrMsg: "constitution amendment threshold must be positive", + }, + { + name: "invalid law quorum", + genesisState: func() *v1.GenesisState { + params1 := params + params1.LawQuorum = "2" + + return v1.NewGenesisState(v1.DefaultStartingProposalID, params1) + }, + expErrMsg: "law quorum too large", + }, + { + name: "invalid law threshold", + genesisState: func() *v1.GenesisState { + params1 := params + params1.LawThreshold = "-2" + + return v1.NewGenesisState(v1.DefaultStartingProposalID, params1) + }, + expErrMsg: "law threshold must be positive", + }, { name: "duplicate proposals", genesisState: func() *v1.GenesisState { diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index ca88d4ade..fbe9bcaf9 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -647,6 +647,14 @@ type TallyParams struct { Quorum string `protobuf:"bytes,1,opt,name=quorum,proto3" json:"quorum,omitempty"` // Minimum proportion of Yes votes for proposal to pass. Default value: 2/3. Threshold string `protobuf:"bytes,2,opt,name=threshold,proto3" json:"threshold,omitempty"` + // quorum for constitution amendment proposals + ConstitutionAmendmentQuorum string `protobuf:"bytes,3,opt,name=constitution_amendment_quorum,json=constitutionAmendmentQuorum,proto3" json:"constitution_amendment_quorum,omitempty"` + // Minimum proportion of Yes votes for a Constitution Amendment proposal to pass. Default value: 0.9. + ConstitutionAmendmentThreshold string `protobuf:"bytes,4,opt,name=constitution_amendment_threshold,json=constitutionAmendmentThreshold,proto3" json:"constitution_amendment_threshold,omitempty"` + // quorum for law proposals + LawQuorum string `protobuf:"bytes,5,opt,name=law_quorum,json=lawQuorum,proto3" json:"law_quorum,omitempty"` + // Minimum proportion of Yes votes for a Law proposal to pass. Default value: 0.9. + LawThreshold string `protobuf:"bytes,6,opt,name=law_threshold,json=lawThreshold,proto3" json:"law_threshold,omitempty"` } func (m *TallyParams) Reset() { *m = TallyParams{} } @@ -696,6 +704,34 @@ func (m *TallyParams) GetThreshold() string { return "" } +func (m *TallyParams) GetConstitutionAmendmentQuorum() string { + if m != nil { + return m.ConstitutionAmendmentQuorum + } + return "" +} + +func (m *TallyParams) GetConstitutionAmendmentThreshold() string { + if m != nil { + return m.ConstitutionAmendmentThreshold + } + return "" +} + +func (m *TallyParams) GetLawQuorum() string { + if m != nil { + return m.LawQuorum + } + return "" +} + +func (m *TallyParams) GetLawThreshold() string { + if m != nil { + return m.LawThreshold + } + return "" +} + // Params defines the parameters for the x/gov module. // // Since: cosmos-sdk 0.47 @@ -718,8 +754,6 @@ type Params struct { BurnVoteQuorum bool `protobuf:"varint,13,opt,name=burn_vote_quorum,json=burnVoteQuorum,proto3" json:"burn_vote_quorum,omitempty"` // burn deposits if the proposal does not enter voting period BurnProposalDepositPrevote bool `protobuf:"varint,14,opt,name=burn_proposal_deposit_prevote,json=burnProposalDepositPrevote,proto3" json:"burn_proposal_deposit_prevote,omitempty"` - // burn deposits if quorum with vote type no_veto is met - BurnVoteVeto bool `protobuf:"varint,15,opt,name=burn_vote_veto,json=burnVoteVeto,proto3" json:"burn_vote_veto,omitempty"` // The ratio representing the proportion of the deposit value minimum that // must be met when making a deposit. Default value: 0.01. Meaning that for a // chain with a min_deposit of 100stake, a deposit of 1stake would be @@ -727,7 +761,15 @@ type Params struct { // // Since: cosmos-sdk 0.50 // NOTE: backported from v50 (https://github.com/cosmos/cosmos-sdk/pull/18146) - MinDepositRatio string `protobuf:"bytes,16,opt,name=min_deposit_ratio,json=minDepositRatio,proto3" json:"min_deposit_ratio,omitempty"` + MinDepositRatio string `protobuf:"bytes,15,opt,name=min_deposit_ratio,json=minDepositRatio,proto3" json:"min_deposit_ratio,omitempty"` + // quorum for constitution amendment proposals + ConstitutionAmendmentQuorum string `protobuf:"bytes,16,opt,name=constitution_amendment_quorum,json=constitutionAmendmentQuorum,proto3" json:"constitution_amendment_quorum,omitempty"` + // Minimum proportion of Yes votes for a Constitution Amendment proposal to pass. Default value: 0.9. + ConstitutionAmendmentThreshold string `protobuf:"bytes,17,opt,name=constitution_amendment_threshold,json=constitutionAmendmentThreshold,proto3" json:"constitution_amendment_threshold,omitempty"` + // quorum for law proposals + LawQuorum string `protobuf:"bytes,18,opt,name=law_quorum,json=lawQuorum,proto3" json:"law_quorum,omitempty"` + // Minimum proportion of Yes votes for a Law proposal to pass. Default value: 0.9. + LawThreshold string `protobuf:"bytes,19,opt,name=law_threshold,json=lawThreshold,proto3" json:"law_threshold,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -819,16 +861,37 @@ func (m *Params) GetBurnProposalDepositPrevote() bool { return false } -func (m *Params) GetBurnVoteVeto() bool { +func (m *Params) GetMinDepositRatio() string { + if m != nil { + return m.MinDepositRatio + } + return "" +} + +func (m *Params) GetConstitutionAmendmentQuorum() string { if m != nil { - return m.BurnVoteVeto + return m.ConstitutionAmendmentQuorum } - return false + return "" } -func (m *Params) GetMinDepositRatio() string { +func (m *Params) GetConstitutionAmendmentThreshold() string { if m != nil { - return m.MinDepositRatio + return m.ConstitutionAmendmentThreshold + } + return "" +} + +func (m *Params) GetLawQuorum() string { + if m != nil { + return m.LawQuorum + } + return "" +} + +func (m *Params) GetLawThreshold() string { + if m != nil { + return m.LawThreshold } return "" } @@ -850,85 +913,90 @@ func init() { func init() { proto.RegisterFile("atomone/gov/v1/gov.proto", fileDescriptor_ecf0f9950ff6986c) } var fileDescriptor_ecf0f9950ff6986c = []byte{ - // 1242 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcf, 0x6e, 0xdb, 0xc6, - 0x13, 0x36, 0xf5, 0xcf, 0xf2, 0xc8, 0x96, 0x99, 0x8d, 0x7f, 0x09, 0xad, 0x24, 0x92, 0x7f, 0x42, - 0x10, 0xb8, 0x69, 0x2c, 0xd5, 0x4e, 0x91, 0x43, 0x91, 0x8b, 0x6c, 0x31, 0x29, 0x83, 0xd4, 0x52, - 0x29, 0xc5, 0x45, 0x7a, 0x21, 0x56, 0xe6, 0x46, 0x26, 0x2a, 0x72, 0x55, 0xee, 0x4a, 0x8d, 0xde, - 0x22, 0xc7, 0xa2, 0xa7, 0x1e, 0x7b, 0xec, 0x21, 0x40, 0x1f, 0xa0, 0x97, 0x9c, 0x8a, 0x20, 0xe8, - 0xa1, 0xbd, 0xa4, 0x45, 0x72, 0x28, 0x90, 0xa7, 0x28, 0x76, 0xb9, 0x94, 0x64, 0x59, 0x85, 0x9c, - 0x5c, 0x24, 0xee, 0xcc, 0xf7, 0xcd, 0xec, 0xcc, 0x7e, 0xb3, 0x24, 0x18, 0x98, 0x53, 0x9f, 0x06, - 0xa4, 0xda, 0xa5, 0xc3, 0xea, 0x70, 0x57, 0xfc, 0x55, 0xfa, 0x21, 0xe5, 0x14, 0xe5, 0x95, 0xa7, - 0x22, 0x4c, 0xc3, 0xdd, 0x42, 0xf1, 0x98, 0x32, 0x9f, 0xb2, 0x6a, 0x07, 0x33, 0x52, 0x1d, 0xee, - 0x76, 0x08, 0xc7, 0xbb, 0xd5, 0x63, 0xea, 0x05, 0x11, 0xbe, 0xb0, 0xd1, 0xa5, 0x5d, 0x2a, 0x1f, - 0xab, 0xe2, 0x49, 0x59, 0x4b, 0x5d, 0x4a, 0xbb, 0x3d, 0x52, 0x95, 0xab, 0xce, 0xe0, 0x49, 0x95, - 0x7b, 0x3e, 0x61, 0x1c, 0xfb, 0x7d, 0x05, 0xd8, 0x9c, 0x05, 0xe0, 0x60, 0xa4, 0x5c, 0xc5, 0x59, - 0x97, 0x3b, 0x08, 0x31, 0xf7, 0x68, 0x9c, 0x71, 0x33, 0xda, 0x91, 0x13, 0x25, 0x8d, 0x16, 0xca, - 0x75, 0x01, 0xfb, 0x5e, 0x40, 0xab, 0xf2, 0x37, 0x32, 0x95, 0xfb, 0x80, 0xbe, 0x22, 0x5e, 0xf7, - 0x84, 0x13, 0xf7, 0x88, 0x72, 0xd2, 0xe8, 0x8b, 0x48, 0x68, 0x0f, 0x32, 0x54, 0x3e, 0x19, 0xda, - 0x96, 0xb6, 0x9d, 0xdf, 0x2b, 0x54, 0x4e, 0x97, 0x5d, 0x99, 0x60, 0x6d, 0x85, 0x44, 0x37, 0x20, - 0xf3, 0x9d, 0x8c, 0x64, 0x24, 0xb6, 0xb4, 0xed, 0x95, 0xfd, 0xfc, 0xab, 0xe7, 0x3b, 0xa0, 0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a8, 0x3d, 0x7b, 0x5b, - 0x5c, 0x7a, 0xf9, 0xb6, 0xb8, 0xf4, 0xc7, 0xdb, 0xe2, 0xd2, 0xd7, 0x3b, 0x5d, 0x8f, 0x9f, 0x0c, - 0x3a, 0x95, 0x63, 0xea, 0x57, 0xd5, 0xf5, 0xbc, 0x73, 0x32, 0xe8, 0xc4, 0xcf, 0xd5, 0xa7, 0xf2, - 0xd3, 0x9b, 0x8f, 0xfa, 0x84, 0x89, 0xcf, 0xea, 0x8c, 0x9c, 0x8e, 0xdb, 0xff, 0x06, 0x00, 0x00, - 0xff, 0xff, 0xdf, 0x70, 0xb9, 0x59, 0x99, 0x0b, 0x00, 0x00, + // 1325 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcf, 0x6f, 0xdb, 0xc6, + 0x12, 0x36, 0xf5, 0xcb, 0xf2, 0xc8, 0x96, 0xe9, 0x8d, 0x5f, 0x42, 0xcb, 0xb1, 0xe4, 0x27, 0x3c, + 0x04, 0x7e, 0x69, 0x2c, 0xd5, 0x4e, 0x91, 0x43, 0x91, 0x8b, 0x6c, 0x31, 0x29, 0x83, 0xd4, 0x52, + 0x29, 0xc5, 0x6d, 0x7a, 0x21, 0x56, 0xe6, 0x46, 0x26, 0x2a, 0x72, 0x55, 0x72, 0x69, 0x47, 0xff, + 0x45, 0x8e, 0x45, 0x4f, 0x3d, 0xf6, 0xd8, 0x43, 0x80, 0x5e, 0x0b, 0xf4, 0x92, 0x53, 0x11, 0xe4, + 0xd4, 0x5e, 0xd2, 0x22, 0x39, 0x14, 0xc8, 0xbd, 0xf7, 0x62, 0x97, 0x4b, 0x49, 0x96, 0x15, 0xc8, + 0x09, 0xda, 0x8b, 0x4d, 0xce, 0x7c, 0xdf, 0xcc, 0xec, 0xce, 0x37, 0xbb, 0x14, 0x68, 0x98, 0x51, + 0x97, 0x7a, 0xa4, 0xda, 0xa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, 0xc6, 0xc1, 0xdd, 0x18, 0x92, 0x40, + 0x05, 0xb8, 0x3c, 0x09, 0x69, 0xd6, 0x5a, 0x2d, 0xbd, 0xae, 0x26, 0xd1, 0x55, 0xd0, 0x26, 0x7d, + 0xa6, 0x7e, 0x4f, 0xdf, 0x6f, 0xeb, 0x75, 0x35, 0x35, 0x8d, 0x79, 0xa7, 0x66, 0xdc, 0xd7, 0xeb, + 0x6a, 0x7a, 0xef, 0xee, 0xb3, 0x57, 0x45, 0xe5, 0xf9, 0xab, 0xa2, 0xf2, 0xc7, 0xab, 0xa2, 0xf2, + 0xe4, 0x75, 0x71, 0xee, 0xf9, 0xeb, 0xe2, 0xdc, 0xaf, 0xaf, 0x8b, 0x73, 0x5f, 0x6e, 0x77, 0x1d, + 0x76, 0x1c, 0x76, 0x2a, 0x47, 0xd4, 0xad, 0xca, 0xdb, 0x79, 0xfb, 0x38, 0xec, 0xc4, 0xcf, 0xd5, + 0xc7, 0xe2, 0x97, 0x17, 0x1b, 0xf4, 0x49, 0xc0, 0x7f, 0x55, 0x65, 0xc4, 0x49, 0x70, 0xf3, 0xef, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xbc, 0x09, 0x4c, 0x70, 0x98, 0x0d, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { @@ -1356,6 +1424,34 @@ func (m *TallyParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.LawThreshold) > 0 { + i -= len(m.LawThreshold) + copy(dAtA[i:], m.LawThreshold) + i = encodeVarintGov(dAtA, i, uint64(len(m.LawThreshold))) + i-- + dAtA[i] = 0x32 + } + if len(m.LawQuorum) > 0 { + i -= len(m.LawQuorum) + copy(dAtA[i:], m.LawQuorum) + i = encodeVarintGov(dAtA, i, uint64(len(m.LawQuorum))) + i-- + dAtA[i] = 0x2a + } + if len(m.ConstitutionAmendmentThreshold) > 0 { + i -= len(m.ConstitutionAmendmentThreshold) + copy(dAtA[i:], m.ConstitutionAmendmentThreshold) + i = encodeVarintGov(dAtA, i, uint64(len(m.ConstitutionAmendmentThreshold))) + i-- + dAtA[i] = 0x22 + } + if len(m.ConstitutionAmendmentQuorum) > 0 { + i -= len(m.ConstitutionAmendmentQuorum) + copy(dAtA[i:], m.ConstitutionAmendmentQuorum) + i = encodeVarintGov(dAtA, i, uint64(len(m.ConstitutionAmendmentQuorum))) + i-- + dAtA[i] = 0x1a + } if len(m.Threshold) > 0 { i -= len(m.Threshold) copy(dAtA[i:], m.Threshold) @@ -1393,24 +1489,48 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.MinDepositRatio) > 0 { - i -= len(m.MinDepositRatio) - copy(dAtA[i:], m.MinDepositRatio) - i = encodeVarintGov(dAtA, i, uint64(len(m.MinDepositRatio))) + if len(m.LawThreshold) > 0 { + i -= len(m.LawThreshold) + copy(dAtA[i:], m.LawThreshold) + i = encodeVarintGov(dAtA, i, uint64(len(m.LawThreshold))) i-- dAtA[i] = 0x1 i-- - dAtA[i] = 0x82 + dAtA[i] = 0x9a } - if m.BurnVoteVeto { + if len(m.LawQuorum) > 0 { + i -= len(m.LawQuorum) + copy(dAtA[i:], m.LawQuorum) + i = encodeVarintGov(dAtA, i, uint64(len(m.LawQuorum))) i-- - if m.BurnVoteVeto { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } + dAtA[i] = 0x1 i-- - dAtA[i] = 0x78 + dAtA[i] = 0x92 + } + if len(m.ConstitutionAmendmentThreshold) > 0 { + i -= len(m.ConstitutionAmendmentThreshold) + copy(dAtA[i:], m.ConstitutionAmendmentThreshold) + i = encodeVarintGov(dAtA, i, uint64(len(m.ConstitutionAmendmentThreshold))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if len(m.ConstitutionAmendmentQuorum) > 0 { + i -= len(m.ConstitutionAmendmentQuorum) + copy(dAtA[i:], m.ConstitutionAmendmentQuorum) + i = encodeVarintGov(dAtA, i, uint64(len(m.ConstitutionAmendmentQuorum))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if len(m.MinDepositRatio) > 0 { + i -= len(m.MinDepositRatio) + copy(dAtA[i:], m.MinDepositRatio) + i = encodeVarintGov(dAtA, i, uint64(len(m.MinDepositRatio))) + i-- + dAtA[i] = 0x7a } if m.BurnProposalDepositPrevote { i-- @@ -1695,6 +1815,22 @@ func (m *TallyParams) Size() (n int) { if l > 0 { n += 1 + l + sovGov(uint64(l)) } + l = len(m.ConstitutionAmendmentQuorum) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.ConstitutionAmendmentThreshold) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.LawQuorum) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.LawThreshold) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } return n } @@ -1736,10 +1872,23 @@ func (m *Params) Size() (n int) { if m.BurnProposalDepositPrevote { n += 2 } - if m.BurnVoteVeto { - n += 2 - } l = len(m.MinDepositRatio) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.ConstitutionAmendmentQuorum) + if l > 0 { + n += 2 + l + sovGov(uint64(l)) + } + l = len(m.ConstitutionAmendmentThreshold) + if l > 0 { + n += 2 + l + sovGov(uint64(l)) + } + l = len(m.LawQuorum) + if l > 0 { + n += 2 + l + sovGov(uint64(l)) + } + l = len(m.LawThreshold) if l > 0 { n += 2 + l + sovGov(uint64(l)) } @@ -3064,6 +3213,134 @@ func (m *TallyParams) Unmarshal(dAtA []byte) error { } m.Threshold = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConstitutionAmendmentQuorum", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConstitutionAmendmentQuorum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConstitutionAmendmentThreshold", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConstitutionAmendmentThreshold = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LawQuorum", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LawQuorum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LawThreshold", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LawThreshold = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) @@ -3357,10 +3634,10 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.BurnProposalDepositPrevote = bool(v != 0) case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BurnVoteVeto", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinDepositRatio", wireType) } - var v int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGov @@ -3370,15 +3647,27 @@ func (m *Params) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.BurnVoteVeto = bool(v != 0) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MinDepositRatio = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 16: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinDepositRatio", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConstitutionAmendmentQuorum", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3406,7 +3695,103 @@ func (m *Params) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MinDepositRatio = string(dAtA[iNdEx:postIndex]) + m.ConstitutionAmendmentQuorum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConstitutionAmendmentThreshold", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConstitutionAmendmentThreshold = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LawQuorum", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LawQuorum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LawThreshold", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LawThreshold = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index d1b7c9022..559c89367 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -18,14 +18,18 @@ const ( // Default governance params var ( - minVotingPeriod = MinVotingPeriod - DefaultMinDepositTokens = sdk.NewInt(10000000) - DefaultQuorum = sdk.NewDecWithPrec(25, 2) - DefaultThreshold = sdk.NewDecWithPrec(667, 3) - DefaultMinInitialDepositRatio = sdk.ZeroDec() - DefaultBurnProposalPrevote = false // set to false to replicate behavior of when this change was made (0.47) - DefaultBurnVoteQuorom = false // set to false to replicate behavior of when this change was made (0.47) - DefaultMinDepositRatio = sdk.MustNewDecFromStr("0.01") // NOTE: backport from v50 + minVotingPeriod = MinVotingPeriod + DefaultMinDepositTokens = sdk.NewInt(10000000) + DefaultQuorum = sdk.NewDecWithPrec(25, 2) + DefaultThreshold = sdk.NewDecWithPrec(667, 3) + DefaultConstitutionAmendmentQuorum = sdk.NewDecWithPrec(4, 1) + DefaultConstitutionAmendmentThreshold = sdk.NewDecWithPrec(9, 1) + DefaultLawQuorum = sdk.NewDecWithPrec(4, 1) + DefaultLawThreshold = sdk.NewDecWithPrec(9, 1) + DefaultMinInitialDepositRatio = sdk.ZeroDec() + DefaultBurnProposalPrevote = false // set to false to replicate behavior of when this change was made (0.47) + DefaultBurnVoteQuorom = false // set to false to replicate behavior of when this change was made (0.47) + DefaultMinDepositRatio = sdk.MustNewDecFromStr("0.01") // NOTE: backport from v50 ) // Deprecated: NewDepositParams creates a new DepositParams object @@ -54,18 +58,23 @@ func NewVotingParams(votingPeriod *time.Duration) VotingParams { // NewParams creates a new Params instance with given values. func NewParams( minDeposit sdk.Coins, maxDepositPeriod, votingPeriod time.Duration, - quorum, threshold, minInitialDepositRatio string, burnProposalDeposit, burnVoteQuorum bool, minDepositRatio string, + quorum, threshold, constitutionAmendmentQuorum, constitutionAmendmentThreshold, lawQuorum, lawThreshold, minInitialDepositRatio string, + burnProposalDeposit, burnVoteQuorum bool, minDepositRatio string, ) Params { return Params{ - MinDeposit: minDeposit, - MaxDepositPeriod: &maxDepositPeriod, - VotingPeriod: &votingPeriod, - Quorum: quorum, - Threshold: threshold, - MinInitialDepositRatio: minInitialDepositRatio, - BurnProposalDepositPrevote: burnProposalDeposit, - BurnVoteQuorum: burnVoteQuorum, - MinDepositRatio: minDepositRatio, + MinDeposit: minDeposit, + MaxDepositPeriod: &maxDepositPeriod, + VotingPeriod: &votingPeriod, + Quorum: quorum, + Threshold: threshold, + ConstitutionAmendmentQuorum: constitutionAmendmentQuorum, + ConstitutionAmendmentThreshold: constitutionAmendmentThreshold, + LawQuorum: lawQuorum, + LawThreshold: lawThreshold, + MinInitialDepositRatio: minInitialDepositRatio, + BurnProposalDepositPrevote: burnProposalDeposit, + BurnVoteQuorum: burnVoteQuorum, + MinDepositRatio: minDepositRatio, } } @@ -77,6 +86,10 @@ func DefaultParams() Params { DefaultVotingPeriod, DefaultQuorum.String(), DefaultThreshold.String(), + DefaultConstitutionAmendmentQuorum.String(), + DefaultConstitutionAmendmentThreshold.String(), + DefaultLawQuorum.String(), + DefaultLawThreshold.String(), DefaultMinInitialDepositRatio.String(), DefaultBurnProposalPrevote, DefaultBurnVoteQuorom, @@ -103,10 +116,10 @@ func (p Params) ValidateBasic() error { return fmt.Errorf("invalid quorum string: %w", err) } if quorum.IsNegative() { - return fmt.Errorf("quorom cannot be negative: %s", quorum) + return fmt.Errorf("quorum must be positive: %s", quorum) } if quorum.GT(math.LegacyOneDec()) { - return fmt.Errorf("quorom too large: %s", p.Quorum) + return fmt.Errorf("quorum too large: %s", quorum) } threshold, err := sdk.NewDecFromStr(p.Threshold) @@ -120,6 +133,68 @@ func (p Params) ValidateBasic() error { return fmt.Errorf("vote threshold too large: %s", threshold) } + amendmentQuorum, err := sdk.NewDecFromStr(p.ConstitutionAmendmentQuorum) + if err != nil { + return fmt.Errorf("invalid constitution amendment quorum string: %w", err) + } + if amendmentQuorum.IsNegative() { + return fmt.Errorf("constitution amendment quorum must be positive: %s", amendmentQuorum) + } + if amendmentQuorum.GT(math.LegacyOneDec()) { + return fmt.Errorf("constitution amendment quorum too large: %s", amendmentQuorum) + } + if amendmentQuorum.LT(quorum) { + return fmt.Errorf("constitution amendment quorum must be greater than or equal to governance quorum: %s", amendmentQuorum) + } + + amendmentThreshold, err := sdk.NewDecFromStr(p.ConstitutionAmendmentThreshold) + if err != nil { + return fmt.Errorf("invalid constitution amendment threshold string: %w", err) + } + if !amendmentThreshold.IsPositive() { + return fmt.Errorf("constitution amendment threshold must be positive: %s", amendmentThreshold) + } + if amendmentThreshold.GT(math.LegacyOneDec()) { + return fmt.Errorf("constitution amendment threshold too large: %s", amendmentThreshold) + } + if amendmentThreshold.LT(threshold) { + return fmt.Errorf("constitution amendment threshold must be greater than or equal to governance threshold: %s", amendmentThreshold) + } + + lawQuorum, err := sdk.NewDecFromStr(p.LawQuorum) + if err != nil { + return fmt.Errorf("invalid law quorum string: %w", err) + } + if lawQuorum.IsNegative() { + return fmt.Errorf("law quorum must be positive: %s", lawQuorum) + } + if lawQuorum.GT(math.LegacyOneDec()) { + return fmt.Errorf("law quorum too large: %s", lawQuorum) + } + if lawQuorum.LT(quorum) { + return fmt.Errorf("law quorum must be greater than or equal to governance quorum: %s", lawQuorum) + } + if lawQuorum.GT(amendmentQuorum) { + return fmt.Errorf("law quorum must be less than or equal to constitution amendment quorum: %s", lawQuorum) + } + + lawThreshold, err := sdk.NewDecFromStr(p.LawThreshold) + if err != nil { + return fmt.Errorf("invalid law threshold string: %w", err) + } + if !lawThreshold.IsPositive() { + return fmt.Errorf("law threshold must be positive: %s", lawThreshold) + } + if lawThreshold.GT(math.LegacyOneDec()) { + return fmt.Errorf("law threshold too large: %s", lawThreshold) + } + if lawThreshold.LT(threshold) { + return fmt.Errorf("law threshold must be greater than or equal to governance threshold: %s", lawThreshold) + } + if lawThreshold.GT(amendmentThreshold) { + return fmt.Errorf("law threshold must be less than or equal to constitution amendment threshold: %s", lawThreshold) + } + if p.VotingPeriod == nil { return fmt.Errorf("voting period must not be nil") } diff --git a/x/gov/types/v1beta1/codec.go b/x/gov/types/v1beta1/codec.go index 3bd86657d..b643f47f4 100644 --- a/x/gov/types/v1beta1/codec.go +++ b/x/gov/types/v1beta1/codec.go @@ -23,6 +23,8 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { legacy.RegisterAminoMsg(cdc, &MsgVote{}, "atomone/MsgVote") legacy.RegisterAminoMsg(cdc, &MsgVoteWeighted{}, "atomone/MsgVoteWeighted") cdc.RegisterConcrete(&TextProposal{}, "atomone/TextProposal", nil) + cdc.RegisterConcrete(&ConstitutionAmendmentProposal{}, "atomone/ConstitutionAmendmentProposal", nil) + cdc.RegisterConcrete(&LawProposal{}, "atomone/LawProposal", nil) } // RegisterInterfaces registers the interfaces types with the Interface Registry. @@ -37,6 +39,8 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { "atomone.gov.v1beta1.Content", (*Content)(nil), &TextProposal{}, + &ConstitutionAmendmentProposal{}, + &LawProposal{}, ) // Register proposal types (this is actually done in related modules, but diff --git a/x/gov/types/v1beta1/gov.pb.go b/x/gov/types/v1beta1/gov.pb.go index 074b74fa7..62e13a421 100644 --- a/x/gov/types/v1beta1/gov.pb.go +++ b/x/gov/types/v1beta1/gov.pb.go @@ -206,6 +206,84 @@ func (m *TextProposal) XXX_DiscardUnknown() { var xxx_messageInfo_TextProposal proto.InternalMessageInfo +type LawProposal struct { + // title of the proposal. + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // description associated with the proposal. + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` +} + +func (m *LawProposal) Reset() { *m = LawProposal{} } +func (*LawProposal) ProtoMessage() {} +func (*LawProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_a7f955cabd147a1f, []int{2} +} +func (m *LawProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LawProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LawProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LawProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_LawProposal.Merge(m, src) +} +func (m *LawProposal) XXX_Size() int { + return m.Size() +} +func (m *LawProposal) XXX_DiscardUnknown() { + xxx_messageInfo_LawProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_LawProposal proto.InternalMessageInfo + +type ConstitutionAmendmentProposal struct { + // title of the proposal. + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // description associated with the proposal. + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` +} + +func (m *ConstitutionAmendmentProposal) Reset() { *m = ConstitutionAmendmentProposal{} } +func (*ConstitutionAmendmentProposal) ProtoMessage() {} +func (*ConstitutionAmendmentProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_a7f955cabd147a1f, []int{3} +} +func (m *ConstitutionAmendmentProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConstitutionAmendmentProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConstitutionAmendmentProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ConstitutionAmendmentProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConstitutionAmendmentProposal.Merge(m, src) +} +func (m *ConstitutionAmendmentProposal) XXX_Size() int { + return m.Size() +} +func (m *ConstitutionAmendmentProposal) XXX_DiscardUnknown() { + xxx_messageInfo_ConstitutionAmendmentProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_ConstitutionAmendmentProposal proto.InternalMessageInfo + // Deposit defines an amount deposited by an account address to an active // proposal. type Deposit struct { @@ -220,7 +298,7 @@ type Deposit struct { func (m *Deposit) Reset() { *m = Deposit{} } func (*Deposit) ProtoMessage() {} func (*Deposit) Descriptor() ([]byte, []int) { - return fileDescriptor_a7f955cabd147a1f, []int{2} + return fileDescriptor_a7f955cabd147a1f, []int{4} } func (m *Deposit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -276,7 +354,7 @@ type Proposal struct { func (m *Proposal) Reset() { *m = Proposal{} } func (*Proposal) ProtoMessage() {} func (*Proposal) Descriptor() ([]byte, []int) { - return fileDescriptor_a7f955cabd147a1f, []int{3} + return fileDescriptor_a7f955cabd147a1f, []int{5} } func (m *Proposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -320,7 +398,7 @@ type TallyResult struct { func (m *TallyResult) Reset() { *m = TallyResult{} } func (*TallyResult) ProtoMessage() {} func (*TallyResult) Descriptor() ([]byte, []int) { - return fileDescriptor_a7f955cabd147a1f, []int{4} + return fileDescriptor_a7f955cabd147a1f, []int{6} } func (m *TallyResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -369,7 +447,7 @@ type Vote struct { func (m *Vote) Reset() { *m = Vote{} } func (*Vote) ProtoMessage() {} func (*Vote) Descriptor() ([]byte, []int) { - return fileDescriptor_a7f955cabd147a1f, []int{5} + return fileDescriptor_a7f955cabd147a1f, []int{7} } func (m *Vote) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -410,7 +488,7 @@ type DepositParams struct { func (m *DepositParams) Reset() { *m = DepositParams{} } func (*DepositParams) ProtoMessage() {} func (*DepositParams) Descriptor() ([]byte, []int) { - return fileDescriptor_a7f955cabd147a1f, []int{6} + return fileDescriptor_a7f955cabd147a1f, []int{8} } func (m *DepositParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -448,7 +526,7 @@ type VotingParams struct { func (m *VotingParams) Reset() { *m = VotingParams{} } func (*VotingParams) ProtoMessage() {} func (*VotingParams) Descriptor() ([]byte, []int) { - return fileDescriptor_a7f955cabd147a1f, []int{7} + return fileDescriptor_a7f955cabd147a1f, []int{9} } func (m *VotingParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -492,7 +570,7 @@ type TallyParams struct { func (m *TallyParams) Reset() { *m = TallyParams{} } func (*TallyParams) ProtoMessage() {} func (*TallyParams) Descriptor() ([]byte, []int) { - return fileDescriptor_a7f955cabd147a1f, []int{8} + return fileDescriptor_a7f955cabd147a1f, []int{10} } func (m *TallyParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -526,6 +604,8 @@ func init() { proto.RegisterEnum("atomone.gov.v1beta1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) proto.RegisterType((*WeightedVoteOption)(nil), "atomone.gov.v1beta1.WeightedVoteOption") proto.RegisterType((*TextProposal)(nil), "atomone.gov.v1beta1.TextProposal") + proto.RegisterType((*LawProposal)(nil), "atomone.gov.v1beta1.LawProposal") + proto.RegisterType((*ConstitutionAmendmentProposal)(nil), "atomone.gov.v1beta1.ConstitutionAmendmentProposal") proto.RegisterType((*Deposit)(nil), "atomone.gov.v1beta1.Deposit") proto.RegisterType((*Proposal)(nil), "atomone.gov.v1beta1.Proposal") proto.RegisterType((*TallyResult)(nil), "atomone.gov.v1beta1.TallyResult") @@ -538,96 +618,99 @@ func init() { func init() { proto.RegisterFile("atomone/gov/v1beta1/gov.proto", fileDescriptor_a7f955cabd147a1f) } var fileDescriptor_a7f955cabd147a1f = []byte{ - // 1414 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcf, 0x6f, 0x13, 0xc7, - 0x17, 0xf7, 0xda, 0xce, 0xaf, 0xb1, 0x13, 0x96, 0x49, 0xbe, 0xe0,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1e, 0x3a, 0x75, 0xff, 0x85, 0x24, 0xa8, 0xa2, - 0x6d, 0x6c, 0xfb, 0xa1, 0x53, 0x79, 0xda, 0x05, 0xf1, 0x1a, 0x6d, 0x49, 0x9e, 0x8a, 0x06, 0xe0, - 0x2d, 0xea, 0x5b, 0x17, 0x8e, 0xb2, 0x7e, 0x86, 0x5b, 0x3f, 0x79, 0x40, 0x6f, 0xc4, 0x70, 0x9c, - 0x09, 0xb9, 0xd1, 0x9f, 0xfd, 0x86, 0xe7, 0x46, 0x6f, 0x80, 0xe9, 0x5b, 0x3d, 0xdc, 0xed, 0xd9, - 0xd4, 0x5a, 0x3c, 0x9f, 0x9f, 0xec, 0x56, 0xf2, 0x76, 0x57, 0x12, 0x99, 0xfe, 0xd0, 0xaa, 0xca, - 0x19, 0x61, 0x03, 0xcc, 0x91, 0x56, 0x17, 0xb9, 0x2d, 0xdc, 0x66, 0xa9, 0x8c, 0xe7, 0x95, 0x89, - 0xe9, 0x17, 0xf7, 0x29, 0x02, 0x16, 0x86, 0xbc, 0xf0, 0x16, 0x58, 0xf0, 0x7a, 0x56, 0x1f, 0x5a, - 0x8a, 0x50, 0x4b, 0x57, 0x26, 0xb6, 0x94, 0x38, 0xc8, 0x13, 0x30, 0x37, 0xef, 0x49, 0x34, 0x5f, - 0xb0, 0xfa, 0x97, 0x00, 0x40, 0xe0, 0x46, 0x78, 0x16, 0x9c, 0xac, 0x95, 0x35, 0x45, 0x2f, 0x57, - 0xb4, 0x62, 0xb9, 0xa4, 0x5f, 0x2d, 0x55, 0x2b, 0xca, 0xa5, 0xe2, 0xe5, 0xa2, 0x52, 0x10, 0x43, - 0xc9, 0x63, 0xfd, 0x81, 0x1c, 0x63, 0x40, 0xc5, 0xe3, 0x82, 0x69, 0x70, 0x2c, 0x88, 0xbe, 0xae, - 0x54, 0x45, 0x21, 0x39, 0xdf, 0x1f, 0xc8, 0x73, 0x0c, 0x75, 0x1d, 0xb9, 0x70, 0x15, 0x2c, 0x06, - 0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 0x4d, 0x29, 0x88, 0xd1, 0x24, 0xec, 0x0f, 0xe4, 0x05, 0x7e, - 0xb7, 0x42, 0xdf, 0xa0, 0x06, 0x41, 0x63, 0xf9, 0x2f, 0xe7, 0x8a, 0x9b, 0x4a, 0x41, 0x9c, 0x0a, - 0xf2, 0x5f, 0x36, 0xac, 0x36, 0x32, 0x59, 0x3a, 0xf3, 0x5f, 0x3d, 0x79, 0x99, 0x0a, 0x3d, 0x7f, - 0x99, 0x0a, 0xdd, 0xd9, 0x4b, 0x85, 0x9e, 0xec, 0xa5, 0x84, 0xa7, 0x7b, 0x29, 0xe1, 0xcf, 0xbd, - 0x94, 0x70, 0xef, 0x55, 0x2a, 0xf4, 0xf4, 0x55, 0x2a, 0xf4, 0xfc, 0x55, 0x2a, 0x74, 0x63, 0x3d, - 0x50, 0xb0, 0x7c, 0xe8, 0xae, 0xb5, 0x7a, 0x75, 0x7f, 0x9d, 0xdd, 0xa6, 0x1f, 0x61, 0xb4, 0x70, - 0xfd, 0xcf, 0xaa, 0xfa, 0x34, 0x9d, 0x0d, 0xe7, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xa6, 0x4d, - 0xd5, 0x1f, 0xa8, 0x0d, 0x00, 0x00, + // 1470 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xdf, 0x6f, 0x13, 0xc7, + 0x16, 0xf6, 0xda, 0xce, 0xaf, 0xb1, 0x13, 0x96, 0x49, 0x2e, 0x38, 0xe6, 0xe2, 0x5d, 0x19, 0xdd, + 0x7b, 0xa3, 0x88, 0xd8, 0x97, 0xa0, 0x7b, 0xab, 0x06, 0x5e, 0xec, 0x78, 0x69, 0x8d, 0x52, 0xdb, + 0x5d, 0x2f, 0xa6, 0xf0, 0xd0, 0xd5, 0xda, 0x3b, 0xd8, 0xdb, 0x7a, 0x77, 0x8c, 0x77, 0x1c, 0x92, + 0x37, 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x71, 0xe6, 0x53, + 0x31, 0x5c, 0x17, 0x99, 0xf0, 0xbf, 0x20, 0x31, 0x8c, 0x56, 0x95, 0xab, 0xca, 0xaa, 0xa6, 0x14, + 0xc4, 0x68, 0x12, 0xf6, 0x07, 0xf2, 0x0c, 0x7f, 0x5b, 0xa1, 0xcf, 0x50, 0x83, 0xa0, 0x03, 0xf9, + 0xaf, 0xe4, 0x8a, 0x6b, 0x4a, 0x41, 0x1c, 0x0b, 0xf2, 0x5f, 0x31, 0xac, 0x36, 0x32, 0x59, 0x39, + 0xf3, 0x9f, 0x3c, 0x7d, 0x95, 0x0a, 0xbd, 0x78, 0x95, 0x0a, 0xdd, 0xdd, 0x4e, 0x85, 0x9e, 0x6e, + 0xa7, 0x84, 0x67, 0xdb, 0x29, 0xe1, 0xd7, 0xed, 0x94, 0x70, 0xff, 0x75, 0x2a, 0xf4, 0xec, 0x75, + 0x2a, 0xf4, 0xe2, 0x75, 0x2a, 0x74, 0x73, 0x39, 0xd0, 0xb0, 0x7c, 0xe8, 0x2e, 0xb5, 0x7a, 0x75, + 0x7f, 0x9d, 0xdd, 0xa0, 0x3f, 0x59, 0x69, 0xe3, 0xfa, 0x3f, 0x42, 0xeb, 0xe3, 0x74, 0x36, 0x5c, + 0xfc, 0x23, 0x00, 0x00, 0xff, 0xff, 0x11, 0x3b, 0xe2, 0x48, 0xd6, 0x0e, 0x00, 0x00, } func (this *TextProposal) Equal(that interface{}) bool { @@ -657,6 +740,60 @@ func (this *TextProposal) Equal(that interface{}) bool { } return true } +func (this *LawProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*LawProposal) + if !ok { + that2, ok := that.(LawProposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Title != that1.Title { + return false + } + if this.Description != that1.Description { + return false + } + return true +} +func (this *ConstitutionAmendmentProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ConstitutionAmendmentProposal) + if !ok { + that2, ok := that.(ConstitutionAmendmentProposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Title != that1.Title { + return false + } + if this.Description != that1.Description { + return false + } + return true +} func (this *Proposal) Equal(that interface{}) bool { if that == nil { return this == nil @@ -818,6 +955,80 @@ func (m *TextProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *LawProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LawProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LawProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ConstitutionAmendmentProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConstitutionAmendmentProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConstitutionAmendmentProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGov(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *Deposit) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1256,6 +1467,40 @@ func (m *TextProposal) Size() (n int) { return n } +func (m *LawProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + return n +} + +func (m *ConstitutionAmendmentProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + return n +} + func (m *Deposit) Size() (n int) { if m == nil { return 0 @@ -1621,6 +1866,234 @@ func (m *TextProposal) Unmarshal(dAtA []byte) error { } return nil } +func (m *LawProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LawProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LawProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConstitutionAmendmentProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConstitutionAmendmentProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConstitutionAmendmentProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Deposit) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/gov/types/v1beta1/proposal.go b/x/gov/types/v1beta1/proposal.go index 5814556b3..46def1b85 100644 --- a/x/gov/types/v1beta1/proposal.go +++ b/x/gov/types/v1beta1/proposal.go @@ -192,6 +192,72 @@ func (tp TextProposal) String() string { return string(out) } +// Law and Constitution Amendment Proposal types +const ( + ProposalTypeLaw string = "Law" + ProposalTypeConstitutionAmendment string = "ConstitutionAmendment" +) + +// Implements Content Interface +var ( + _ Content = &LawProposal{} + _ Content = &ConstitutionAmendmentProposal{} +) + +// NewLawProposal creates a law proposal Content +func NewLawProposal(title, description string) Content { + return &LawProposal{title, description} +} + +// NewConstitutionAmendmentProposal creates a constitution amendment proposal Content +func NewConstitutionAmendmentProposal(title, description string) Content { + return &ConstitutionAmendmentProposal{title, description} +} + +// GetTitle returns the proposal title +func (lp *LawProposal) GetTitle() string { return lp.Title } + +// GetDescription returns the proposal description +func (lp *LawProposal) GetDescription() string { return lp.Description } + +// ProposalRoute returns the proposal router key +func (lp *LawProposal) ProposalRoute() string { return types.RouterKey } + +// ProposalType is "Law" +func (lp *LawProposal) ProposalType() string { return ProposalTypeLaw } + +// ValidateBasic validates the content's title and description of the proposal +func (lp *LawProposal) ValidateBasic() error { return ValidateAbstract(lp) } + +// String implements Stringer interface +func (lp LawProposal) String() string { + out, _ := yaml.Marshal(lp) + return string(out) +} + +// GetTitle returns the proposal title +func (cap *ConstitutionAmendmentProposal) GetTitle() string { return cap.Title } + +// GetDescription returns the proposal description +func (cap *ConstitutionAmendmentProposal) GetDescription() string { return cap.Description } + +// ProposalRoute returns the proposal router key +func (cap *ConstitutionAmendmentProposal) ProposalRoute() string { return types.RouterKey } + +// ProposalType is "ConstitutionAmendment" +func (cap *ConstitutionAmendmentProposal) ProposalType() string { + return ProposalTypeConstitutionAmendment +} + +// ValidateBasic validates the content's title and description of the proposal +func (cap *ConstitutionAmendmentProposal) ValidateBasic() error { return ValidateAbstract(cap) } + +// String implements Stringer interface +func (cap ConstitutionAmendmentProposal) String() string { + out, _ := yaml.Marshal(cap) + return string(out) +} + // ValidProposalStatus checks if the proposal status is valid func ValidProposalStatus(status ProposalStatus) bool { if status == StatusDepositPeriod || @@ -227,7 +293,9 @@ func ValidateAbstract(c Content) error { } var validProposalTypes = map[string]struct{}{ - ProposalTypeText: {}, + ProposalTypeText: {}, + ProposalTypeLaw: {}, + ProposalTypeConstitutionAmendment: {}, } // RegisterProposalType registers a proposal type. It will panic if the type is @@ -246,6 +314,14 @@ func ContentFromProposalType(title, desc, ty string) (Content, bool) { return NewTextProposal(title, desc), true } + if strings.EqualFold(ty, ProposalTypeLaw) { + return NewLawProposal(title, desc), true + } + + if strings.EqualFold(ty, ProposalTypeConstitutionAmendment) { + return NewConstitutionAmendmentProposal(title, desc), true + } + return nil, false } @@ -267,6 +343,10 @@ func ProposalHandler(_ sdk.Context, c Content) error { case ProposalTypeText: // both proposal types do not change state so this performs a no-op return nil + case ProposalTypeConstitutionAmendment: + return nil + case ProposalTypeLaw: + return nil default: return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized gov proposal type: %s", c.ProposalType()) //nolint:staticcheck diff --git a/x/gov/types/v1beta1/proposals_test.go b/x/gov/types/v1beta1/proposals_test.go index e66fe0765..29bfb3735 100644 --- a/x/gov/types/v1beta1/proposals_test.go +++ b/x/gov/types/v1beta1/proposals_test.go @@ -42,6 +42,14 @@ func TestContentFromProposalType(t *testing.T) { proposalType: "Text", expectedType: v1beta1.ProposalTypeText, }, + { + proposalType: "ConstitutionAmendment", + expectedType: v1beta1.ProposalTypeConstitutionAmendment, + }, + { + proposalType: "Law", + expectedType: v1beta1.ProposalTypeLaw, + }, } for _, test := range tests {