From 50bdd189fd46536593516263c26c9271b0066b00 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Wed, 22 Dec 2021 16:09:00 +0100 Subject: [PATCH 01/39] checkpoint --- docs/core/proto-docs.md | 17 + orm/internal/testpb/testschema.proto | 106 +- proto/cosmos/gov/v1beta1/gov.proto | 30 +- proto/cosmos/gov/v1beta2/gov.proto | 6 + proto/cosmos/staking/v1beta1/staking.proto | 4 +- simapp/app.go | 2 +- x/gov/keeper/common_test.go | 3 +- x/gov/keeper/deposit.go | 45 +- x/gov/keeper/deposit_test.go | 2 +- x/gov/keeper/grpc_query.go | 77 +- x/gov/keeper/grpc_query_test.go | 250 ++-- x/gov/keeper/hooks_test.go | 7 +- x/gov/keeper/invariants.go | 3 +- x/gov/keeper/keeper.go | 36 +- x/gov/keeper/keeper_test.go | 11 +- x/gov/keeper/msg_server.go | 122 +- x/gov/keeper/params.go | 19 +- x/gov/keeper/proposal.go | 97 +- x/gov/keeper/proposal_test.go | 45 +- x/gov/keeper/querier.go | 23 +- x/gov/keeper/querier_test.go | 147 +-- x/gov/keeper/tally.go | 41 +- x/gov/keeper/tally_test.go | 136 +-- x/gov/keeper/vote.go | 43 +- x/gov/keeper/vote_test.go | 66 +- x/gov/simulation/operations.go | 82 +- x/gov/types/deposit.go | 2 +- x/gov/types/gov.pb.go | 364 ++++-- x/gov/types/msgs.go | 21 + x/gov/types/proposal.go | 4 +- x/gov/types/query.pb.gw.go | 28 +- x/gov/types/tally.go | 8 +- x/gov/types/v1beta1/gov.pb.go | 182 ++- x/gov/types/v1beta1/tx.pb.go | 89 +- x/gov/types/vote.go | 9 + x/staking/types/staking.pb.go | 1209 ++++++++++---------- 36 files changed, 1853 insertions(+), 1483 deletions(-) diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 20217b24628d..73f5a559ed8b 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -410,6 +410,7 @@ - [cosmos/gov/v1beta2/gov.proto](#cosmos/gov/v1beta2/gov.proto) - [Deposit](#cosmos.gov.v1beta2.Deposit) - [DepositParams](#cosmos.gov.v1beta2.DepositParams) + - [MsgContent](#cosmos.gov.v1beta2.MsgContent) - [Proposal](#cosmos.gov.v1beta2.Proposal) - [TallyParams](#cosmos.gov.v1beta2.TallyParams) - [TallyResult](#cosmos.gov.v1beta2.TallyResult) @@ -6134,6 +6135,22 @@ DepositParams defines the params for deposits on governance proposals. + + +### MsgContent +Content is used to wrap the legacy content field into a message. This ensures backwards compatibility + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `content` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `authority` | [string](#string) | | | + + + + + + ### Proposal diff --git a/orm/internal/testpb/testschema.proto b/orm/internal/testpb/testschema.proto index 565bc539e369..503f1389dffc 100644 --- a/orm/internal/testpb/testschema.proto +++ b/orm/internal/testpb/testschema.proto @@ -11,72 +11,78 @@ option go_package = "github.com/cosmos/cosmos-sdk/orm/internal/testpb"; message A { option (cosmos.orm.v1alpha1.table) = { id: 1; - primary_key: { - fields: "u32,u64,str" - } - index:{ - id: 1; - fields:"u64,str" - } - index:{ - id: 2; - fields:"str,u32" - } - index:{ - id: 3; - fields:"bz,str" - } - }; +primary_key: { +fields: + "u32,u64,str" +} +index: { +id: + 1; +fields: + "u64,str" +} +index: { +id: + 2; +fields: + "str,u32" +} +index: { +id: + 3; +fields: + "bz,str" +} +}; - // Valid key fields: - uint32 u32 = 1; - uint64 u64 = 2; - string str = 3; - bytes bz = 4; - google.protobuf.Timestamp ts = 5; - google.protobuf.Duration dur = 6; - int32 i32 = 7; - sint32 s32 = 8; - sfixed32 sf32 = 9; - int64 i64 = 10; - sint64 s64 = 11; - sfixed64 sf64 = 12; - fixed32 f32 = 13; - fixed64 f64 = 14; - bool b = 15; - Enum e = 16; +// Valid key fields: +uint32 u32 = 1; +uint64 u64 = 2; +string str = 3; +bytes bz = 4; +google.protobuf.Timestamp ts = 5; +google.protobuf.Duration dur = 6; +int32 i32 = 7; +sint32 s32 = 8; +sfixed32 sf32 = 9; +int64 i64 = 10; +sint64 s64 = 11; +sfixed64 sf64 = 12; +fixed32 f32 = 13; +fixed64 f64 = 14; +bool b = 15; +Enum e = 16; - // Invalid key fields: - repeated uint32 repeated = 17; - map map = 18; - B msg = 19; - oneof sum { - uint32 oneof = 20; - } +// Invalid key fields: +repeated uint32 repeated = 17; +map map = 18; +B msg = 19; +oneof sum { + uint32 oneof = 20; +} } enum Enum { ENUM_UNSPECIFIED = 0; - ENUM_ONE = 1; - ENUM_TWO = 2; - ENUM_FIVE = 5; - ENUM_NEG_THREE = -3; + ENUM_ONE = 1; + ENUM_TWO = 2; + ENUM_FIVE = 5; + ENUM_NEG_THREE = -3; } message B { - option (cosmos.orm.v1alpha1.singleton) = {id: 2}; + option (cosmos.orm.v1alpha1.singleton) = { + id: 2 + }; string x = 1; } message C { option (cosmos.orm.v1alpha1.table) = { id: 3 - primary_key:{ - fields:"id" - auto_increment: true - } + primary_key: {fields: "id" auto_increment: true} }; uint64 id = 1; - string x = 2; + string x = 2; } diff --git a/proto/cosmos/gov/v1beta1/gov.proto b/proto/cosmos/gov/v1beta1/gov.proto index 8cec3086020e..214a5bd0ce8d 100644 --- a/proto/cosmos/gov/v1beta1/gov.proto +++ b/proto/cosmos/gov/v1beta1/gov.proto @@ -149,45 +149,31 @@ message Vote { // DepositParams defines the params for deposits on governance proposals. message DepositParams { // Minimum deposit for a proposal to enter voting period. - repeated cosmos.base.v1beta1.Coin min_deposit = 1 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + repeated cosmos.base.v1beta1.Coin min_deposit = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 // months. - google.protobuf.Duration max_deposit_period = 2 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true - ]; + google.protobuf.Duration max_deposit_period = 2 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; } // VotingParams defines the params for voting on governance proposals. message VotingParams { // Length of the voting period. - google.protobuf.Duration voting_period = 1 - [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + google.protobuf.Duration voting_period = 1 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; } // TallyParams defines the params for tallying votes on governance proposals. message TallyParams { // Minimum percentage of total stake needed to vote for a result to be // considered valid. - bytes quorum = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; + bytes quorum = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - bytes threshold = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; + bytes threshold = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; // Minimum value of Veto votes to Total votes ratio for proposal to be // vetoed. Default value: 1/3. - bytes veto_threshold = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; + bytes veto_threshold = 3 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; } diff --git a/proto/cosmos/gov/v1beta2/gov.proto b/proto/cosmos/gov/v1beta2/gov.proto index 81fc4ebee083..e932a50b1115 100644 --- a/proto/cosmos/gov/v1beta2/gov.proto +++ b/proto/cosmos/gov/v1beta2/gov.proto @@ -121,3 +121,9 @@ message TallyParams { // vetoed. Default value: 1/3. string veto_threshold = 3 [(cosmos_proto.scalar) = "cosmos.Dec"]; } + +// Content is used to wrap the legacy content field into a message. This ensures backwards compatibility +message MsgContent { + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; + string authority = 2; +} diff --git a/proto/cosmos/staking/v1beta1/staking.proto b/proto/cosmos/staking/v1beta1/staking.proto index b41fb0fd27ef..5ce8ab13cf3b 100644 --- a/proto/cosmos/staking/v1beta1/staking.proto +++ b/proto/cosmos/staking/v1beta1/staking.proto @@ -214,7 +214,7 @@ message UnbondingDelegation { // validator_address is the bech32-encoded address of the validator. string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // entries are the unbonding delegation entries. - repeated UnbondingDelegationEntry entries = 3 [(gogoproto.nullable) = false]; // unbonding delegation entries + repeated UnbondingDelegationEntry entries = 3 [(gogoproto.nullable) = false]; // unbonding delegation entries } // UnbondingDelegationEntry defines an unbonding object with relevant metadata. @@ -277,7 +277,7 @@ message Redelegation { // validator_dst_address is the validator redelegation destination operator address. string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // entries are the redelegation entries. - repeated RedelegationEntry entries = 4 [(gogoproto.nullable) = false]; // redelegation entries + repeated RedelegationEntry entries = 4 [(gogoproto.nullable) = false]; // redelegation entries } // Params defines the parameters for the staking module. diff --git a/simapp/app.go b/simapp/app.go index 62bf27771c9a..bc726c5aed2c 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -303,7 +303,7 @@ func NewSimApp( AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)) govKeeper := govkeeper.NewKeeper( appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper, - &stakingKeeper, govRouter, + &stakingKeeper, govRouter, app.msgSvcRouter, ) app.GovKeeper = *govKeeper.SetHooks( diff --git a/x/gov/keeper/common_test.go b/x/gov/keeper/common_test.go index 195938860514..4531fe3e1e60 100644 --- a/x/gov/keeper/common_test.go +++ b/x/gov/keeper/common_test.go @@ -7,14 +7,13 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) var ( - TestProposal = v1beta1.NewTextProposal("Test", "description") + TestProposal = []sdk.Msg{} ) func createValidators(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers []int64) ([]sdk.AccAddress, []sdk.ValAddress) { diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index c484fcbdadb4..5d81e91bc098 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -6,11 +6,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // GetDeposit gets the deposit of a specific depositor on a specific proposal -func (keeper Keeper) GetDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress) (deposit v1beta1.Deposit, found bool) { +func (keeper Keeper) GetDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress) (deposit types.Deposit, found bool) { store := ctx.KVStore(keeper.storeKey) bz := store.Get(types.DepositKey(proposalID, depositorAddr)) if bz == nil { @@ -23,7 +22,7 @@ func (keeper Keeper) GetDeposit(ctx sdk.Context, proposalID uint64, depositorAdd } // SetDeposit sets a Deposit to the gov store -func (keeper Keeper) SetDeposit(ctx sdk.Context, deposit v1beta1.Deposit) { +func (keeper Keeper) SetDeposit(ctx sdk.Context, deposit types.Deposit) { store := ctx.KVStore(keeper.storeKey) bz := keeper.cdc.MustMarshal(&deposit) depositor, err := sdk.AccAddressFromBech32(deposit.Depositor) @@ -35,9 +34,9 @@ func (keeper Keeper) SetDeposit(ctx sdk.Context, deposit v1beta1.Deposit) { } // GetAllDeposits returns all the deposits from the store -func (keeper Keeper) GetAllDeposits(ctx sdk.Context) (deposits v1beta1.Deposits) { - keeper.IterateAllDeposits(ctx, func(deposit v1beta1.Deposit) bool { - deposits = append(deposits, deposit) +func (keeper Keeper) GetAllDeposits(ctx sdk.Context) (deposits types.Deposits) { + keeper.IterateAllDeposits(ctx, func(deposit types.Deposit) bool { + deposits = append(deposits, &deposit) return false }) @@ -45,9 +44,9 @@ func (keeper Keeper) GetAllDeposits(ctx sdk.Context) (deposits v1beta1.Deposits) } // GetDeposits returns all the deposits from a proposal -func (keeper Keeper) GetDeposits(ctx sdk.Context, proposalID uint64) (deposits v1beta1.Deposits) { - keeper.IterateDeposits(ctx, proposalID, func(deposit v1beta1.Deposit) bool { - deposits = append(deposits, deposit) +func (keeper Keeper) GetDeposits(ctx sdk.Context, proposalID uint64) (deposits types.Deposits) { + keeper.IterateDeposits(ctx, proposalID, func(deposit types.Deposit) bool { + deposits = append(deposits, &deposit) return false }) @@ -58,8 +57,8 @@ func (keeper Keeper) GetDeposits(ctx sdk.Context, proposalID uint64) (deposits v func (keeper Keeper) DeleteAndBurnDeposits(ctx sdk.Context, proposalID uint64) { store := ctx.KVStore(keeper.storeKey) - keeper.IterateDeposits(ctx, proposalID, func(deposit v1beta1.Deposit) bool { - err := keeper.bankKeeper.BurnCoins(ctx, v1beta1.ModuleName, deposit.Amount) + keeper.IterateDeposits(ctx, proposalID, func(deposit types.Deposit) bool { + err := keeper.bankKeeper.BurnCoins(ctx, types.ModuleName, deposit.Amount) if err != nil { panic(err) } @@ -74,14 +73,14 @@ func (keeper Keeper) DeleteAndBurnDeposits(ctx sdk.Context, proposalID uint64) { } // IterateAllDeposits iterates over the all the stored deposits and performs a callback function -func (keeper Keeper) IterateAllDeposits(ctx sdk.Context, cb func(deposit v1beta1.Deposit) (stop bool)) { +func (keeper Keeper) IterateAllDeposits(ctx sdk.Context, cb func(deposit types.Deposit) (stop bool)) { store := ctx.KVStore(keeper.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.DepositsKeyPrefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - var deposit v1beta1.Deposit + var deposit types.Deposit keeper.cdc.MustUnmarshal(iterator.Value(), &deposit) @@ -92,14 +91,14 @@ func (keeper Keeper) IterateAllDeposits(ctx sdk.Context, cb func(deposit v1beta1 } // IterateDeposits iterates over the all the proposals deposits and performs a callback function -func (keeper Keeper) IterateDeposits(ctx sdk.Context, proposalID uint64, cb func(deposit v1beta1.Deposit) (stop bool)) { +func (keeper Keeper) IterateDeposits(ctx sdk.Context, proposalID uint64, cb func(deposit types.Deposit) (stop bool)) { store := ctx.KVStore(keeper.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.DepositsKey(proposalID)) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - var deposit v1beta1.Deposit + var deposit types.Deposit keeper.cdc.MustUnmarshal(iterator.Value(), &deposit) @@ -119,24 +118,24 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd } // Check if proposal is still depositable - if (proposal.Status != v1beta1.StatusDepositPeriod) && (proposal.Status != v1beta1.StatusVotingPeriod) { + if (proposal.Status != types.StatusDepositPeriod) && (proposal.Status != types.StatusVotingPeriod) { return false, sdkerrors.Wrapf(types.ErrInactiveProposal, "%d", proposalID) } // update the governance module's account coins pool - err := keeper.bankKeeper.SendCoinsFromAccountToModule(ctx, depositorAddr, v1beta1.ModuleName, depositAmount) + err := keeper.bankKeeper.SendCoinsFromAccountToModule(ctx, depositorAddr, types.ModuleName, depositAmount) if err != nil { return false, err } // Update proposal - proposal.TotalDeposit = proposal.TotalDeposit.Add(depositAmount...) + proposal.TotalDeposit = sdk.NewCoins(proposal.TotalDeposit...).Add(depositAmount...) keeper.SetProposal(ctx, proposal) // Check if deposit has provided sufficient total funds to transition the proposal into the voting period activatedVotingPeriod := false - if proposal.Status == v1beta1.StatusDepositPeriod && proposal.TotalDeposit.IsAllGTE(keeper.GetDepositParams(ctx).MinDeposit) { + if proposal.Status == types.StatusDepositPeriod && sdk.NewCoins(proposal.TotalDeposit...).IsAllGTE(keeper.GetDepositParams(ctx).MinDeposit) { keeper.ActivateVotingPeriod(ctx, proposal) activatedVotingPeriod = true @@ -146,9 +145,9 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd deposit, found := keeper.GetDeposit(ctx, proposalID, depositorAddr) if found { - deposit.Amount = deposit.Amount.Add(depositAmount...) + deposit.Amount = sdk.NewCoins(deposit.Amount...).Add(depositAmount...) } else { - deposit = v1beta1.NewDeposit(proposalID, depositorAddr, depositAmount) + deposit = types.NewDeposit(proposalID, depositorAddr, depositAmount) } // called when deposit has been added to a proposal, however the proposal may not be active @@ -171,13 +170,13 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd func (keeper Keeper) RefundAndDeleteDeposits(ctx sdk.Context, proposalID uint64) { store := ctx.KVStore(keeper.storeKey) - keeper.IterateDeposits(ctx, proposalID, func(deposit v1beta1.Deposit) bool { + keeper.IterateDeposits(ctx, proposalID, func(deposit types.Deposit) bool { depositor, err := sdk.AccAddressFromBech32(deposit.Depositor) if err != nil { panic(err) } - err = keeper.bankKeeper.SendCoinsFromModuleToAccount(ctx, v1beta1.ModuleName, depositor, deposit.Amount) + err = keeper.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositor, deposit.Amount) if err != nil { panic(err) } diff --git a/x/gov/keeper/deposit_test.go b/x/gov/keeper/deposit_test.go index 218cbd85158f..4ce38dbc4a07 100644 --- a/x/gov/keeper/deposit_test.go +++ b/x/gov/keeper/deposit_test.go @@ -28,7 +28,7 @@ func TestDeposits(t *testing.T) { addr0Initial := app.BankKeeper.GetAllBalances(ctx, TestAddrs[0]) addr1Initial := app.BankKeeper.GetAllBalances(ctx, TestAddrs[1]) - require.True(t, proposal.TotalDeposit.IsEqual(sdk.NewCoins())) + require.True(t, sdk.NewCoins(proposal.TotalDeposit...).IsEqual(sdk.NewCoins())) // Check no deposits at beginning deposit, found := app.GovKeeper.GetDeposit(ctx, proposalID, TestAddrs[1]) diff --git a/x/gov/keeper/grpc_query.go b/x/gov/keeper/grpc_query.go index 2f1c90ca5bfd..719935017603 100644 --- a/x/gov/keeper/grpc_query.go +++ b/x/gov/keeper/grpc_query.go @@ -10,13 +10,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) -var _ v1beta1.QueryServer = Keeper{} +var _ types.QueryServer = Keeper{} // Proposal returns proposal details based on ProposalID -func (q Keeper) Proposal(c context.Context, req *v1beta1.QueryProposalRequest) (*v1beta1.QueryProposalResponse, error) { +func (q Keeper) Proposal(c context.Context, req *types.QueryProposalRequest) (*types.QueryProposalResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -32,19 +31,19 @@ func (q Keeper) Proposal(c context.Context, req *v1beta1.QueryProposalRequest) ( return nil, status.Errorf(codes.NotFound, "proposal %d doesn't exist", req.ProposalId) } - return &v1beta1.QueryProposalResponse{Proposal: proposal}, nil + return &types.QueryProposalResponse{Proposal: &proposal}, nil } // Proposals implements the Query/Proposals gRPC method -func (q Keeper) Proposals(c context.Context, req *v1beta1.QueryProposalsRequest) (*v1beta1.QueryProposalsResponse, error) { - var filteredProposals v1beta1.Proposals +func (q Keeper) Proposals(c context.Context, req *types.QueryProposalsRequest) (*types.QueryProposalsResponse, error) { + var filteredProposals []*types.Proposal ctx := sdk.UnwrapSDKContext(c) store := ctx.KVStore(q.storeKey) proposalStore := prefix.NewStore(store, types.ProposalsKeyPrefix) pageRes, err := query.FilteredPaginate(proposalStore, req.Pagination, func(key []byte, value []byte, accumulate bool) (bool, error) { - var p v1beta1.Proposal + var p types.Proposal if err := q.cdc.Unmarshal(value, &p); err != nil { return false, status.Error(codes.Internal, err.Error()) } @@ -52,7 +51,7 @@ func (q Keeper) Proposals(c context.Context, req *v1beta1.QueryProposalsRequest) matchVoter, matchDepositor, matchStatus := true, true, true // match status (if supplied/valid) - if v1beta1.ValidProposalStatus(req.ProposalStatus) { + if types.ValidProposalStatus(req.ProposalStatus) { matchStatus = p.Status == req.ProposalStatus } @@ -77,7 +76,7 @@ func (q Keeper) Proposals(c context.Context, req *v1beta1.QueryProposalsRequest) if matchVoter && matchDepositor && matchStatus { if accumulate { - filteredProposals = append(filteredProposals, p) + filteredProposals = append(filteredProposals, &p) } return true, nil @@ -90,11 +89,11 @@ func (q Keeper) Proposals(c context.Context, req *v1beta1.QueryProposalsRequest) return nil, status.Error(codes.Internal, err.Error()) } - return &v1beta1.QueryProposalsResponse{Proposals: filteredProposals, Pagination: pageRes}, nil + return &types.QueryProposalsResponse{Proposals: filteredProposals, Pagination: pageRes}, nil } // Vote returns Voted information based on proposalID, voterAddr -func (q Keeper) Vote(c context.Context, req *v1beta1.QueryVoteRequest) (*v1beta1.QueryVoteResponse, error) { +func (q Keeper) Vote(c context.Context, req *types.QueryVoteRequest) (*types.QueryVoteResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -119,11 +118,11 @@ func (q Keeper) Vote(c context.Context, req *v1beta1.QueryVoteRequest) (*v1beta1 "voter: %v not found for proposal: %v", req.Voter, req.ProposalId) } - return &v1beta1.QueryVoteResponse{Vote: vote}, nil + return &types.QueryVoteResponse{Vote: &vote}, nil } // Votes returns single proposal's votes -func (q Keeper) Votes(c context.Context, req *v1beta1.QueryVotesRequest) (*v1beta1.QueryVotesResponse, error) { +func (q Keeper) Votes(c context.Context, req *types.QueryVotesRequest) (*types.QueryVotesResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -132,18 +131,18 @@ func (q Keeper) Votes(c context.Context, req *v1beta1.QueryVotesRequest) (*v1bet return nil, status.Error(codes.InvalidArgument, "proposal id can not be 0") } - var votes v1beta1.Votes + var votes types.Votes ctx := sdk.UnwrapSDKContext(c) store := ctx.KVStore(q.storeKey) votesStore := prefix.NewStore(store, types.VotesKey(req.ProposalId)) pageRes, err := query.Paginate(votesStore, req.Pagination, func(key []byte, value []byte) error { - var vote v1beta1.Vote - if err := q.cdc.Unmarshal(value, &vote); err != nil { + var vote *types.Vote + if err := q.cdc.Unmarshal(value, vote); err != nil { return err } - populateLegacyOption(&vote) + populateLegacyOption(vote) votes = append(votes, vote) return nil @@ -153,11 +152,11 @@ func (q Keeper) Votes(c context.Context, req *v1beta1.QueryVotesRequest) (*v1bet return nil, status.Error(codes.Internal, err.Error()) } - return &v1beta1.QueryVotesResponse{Votes: votes, Pagination: pageRes}, nil + return &types.QueryVotesResponse{Votes: votes, Pagination: pageRes}, nil } // Params queries all params -func (q Keeper) Params(c context.Context, req *v1beta1.QueryParamsRequest) (*v1beta1.QueryParamsResponse, error) { +func (q Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -165,17 +164,17 @@ func (q Keeper) Params(c context.Context, req *v1beta1.QueryParamsRequest) (*v1b ctx := sdk.UnwrapSDKContext(c) switch req.ParamsType { - case v1beta1.ParamDeposit: + case types.ParamDeposit: depositParmas := q.GetDepositParams(ctx) - return &v1beta1.QueryParamsResponse{DepositParams: depositParmas}, nil + return &types.QueryParamsResponse{DepositParams: &depositParmas}, nil - case v1beta1.ParamVoting: + case types.ParamVoting: votingParmas := q.GetVotingParams(ctx) - return &v1beta1.QueryParamsResponse{VotingParams: votingParmas}, nil + return &types.QueryParamsResponse{VotingParams: &votingParmas}, nil - case v1beta1.ParamTallying: + case types.ParamTallying: tallyParams := q.GetTallyParams(ctx) - return &v1beta1.QueryParamsResponse{TallyParams: tallyParams}, nil + return &types.QueryParamsResponse{TallyParams: &tallyParams}, nil default: return nil, status.Errorf(codes.InvalidArgument, @@ -184,7 +183,7 @@ func (q Keeper) Params(c context.Context, req *v1beta1.QueryParamsRequest) (*v1b } // Deposit queries single deposit information based proposalID, depositAddr -func (q Keeper) Deposit(c context.Context, req *v1beta1.QueryDepositRequest) (*v1beta1.QueryDepositResponse, error) { +func (q Keeper) Deposit(c context.Context, req *types.QueryDepositRequest) (*types.QueryDepositResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -209,11 +208,11 @@ func (q Keeper) Deposit(c context.Context, req *v1beta1.QueryDepositRequest) (*v "depositer: %v not found for proposal: %v", req.Depositor, req.ProposalId) } - return &v1beta1.QueryDepositResponse{Deposit: deposit}, nil + return &types.QueryDepositResponse{Deposit: &deposit}, nil } // Deposits returns single proposal's all deposits -func (q Keeper) Deposits(c context.Context, req *v1beta1.QueryDepositsRequest) (*v1beta1.QueryDepositsResponse, error) { +func (q Keeper) Deposits(c context.Context, req *types.QueryDepositsRequest) (*types.QueryDepositsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -222,15 +221,15 @@ func (q Keeper) Deposits(c context.Context, req *v1beta1.QueryDepositsRequest) ( return nil, status.Error(codes.InvalidArgument, "proposal id can not be 0") } - var deposits v1beta1.Deposits + var deposits []*types.Deposit ctx := sdk.UnwrapSDKContext(c) store := ctx.KVStore(q.storeKey) depositStore := prefix.NewStore(store, types.DepositsKey(req.ProposalId)) pageRes, err := query.Paginate(depositStore, req.Pagination, func(key []byte, value []byte) error { - var deposit v1beta1.Deposit - if err := q.cdc.Unmarshal(value, &deposit); err != nil { + var deposit *types.Deposit + if err := q.cdc.Unmarshal(value, deposit); err != nil { return err } @@ -242,11 +241,11 @@ func (q Keeper) Deposits(c context.Context, req *v1beta1.QueryDepositsRequest) ( return nil, status.Error(codes.Internal, err.Error()) } - return &v1beta1.QueryDepositsResponse{Deposits: deposits, Pagination: pageRes}, nil + return &types.QueryDepositsResponse{Deposits: deposits, Pagination: pageRes}, nil } // TallyResult queries the tally of a proposal vote -func (q Keeper) TallyResult(c context.Context, req *v1beta1.QueryTallyResultRequest) (*v1beta1.QueryTallyResultResponse, error) { +func (q Keeper) TallyResult(c context.Context, req *types.QueryTallyResultRequest) (*types.QueryTallyResultResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -262,19 +261,19 @@ func (q Keeper) TallyResult(c context.Context, req *v1beta1.QueryTallyResultRequ return nil, status.Errorf(codes.NotFound, "proposal %d doesn't exist", req.ProposalId) } - var tallyResult v1beta1.TallyResult + var tallyResult types.TallyResult switch { - case proposal.Status == v1beta1.StatusDepositPeriod: - tallyResult = v1beta1.EmptyTallyResult() + case proposal.Status == types.StatusDepositPeriod: + tallyResult = types.EmptyTallyResult() - case proposal.Status == v1beta1.StatusPassed || proposal.Status == v1beta1.StatusRejected: - tallyResult = proposal.FinalTallyResult + case proposal.Status == types.StatusPassed || proposal.Status == types.StatusRejected: + tallyResult = *proposal.FinalTallyResult default: // proposal is in voting period _, _, tallyResult = q.Tally(ctx, proposal) } - return &v1beta1.QueryTallyResultResponse{Tally: tallyResult}, nil + return &types.QueryTallyResultResponse{Tally: &tallyResult}, nil } diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 5fc4c968bd2e..9312622e84e0 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -3,20 +3,19 @@ package keeper_test import ( gocontext "context" "fmt" - "strconv" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types" ) func (suite *KeeperTestSuite) TestGRPCQueryProposal() { app, ctx, queryClient := suite.app, suite.ctx, suite.queryClient var ( - req *v1beta1.QueryProposalRequest - expProposal v1beta1.Proposal + req *types.QueryProposalRequest + expProposal types.Proposal ) testCases := []struct { @@ -27,30 +26,29 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposal() { { "empty request", func() { - req = &v1beta1.QueryProposalRequest{} + req = &types.QueryProposalRequest{} }, false, }, { "non existing proposal request", func() { - req = &v1beta1.QueryProposalRequest{ProposalId: 3} + req = &types.QueryProposalRequest{ProposalId: 3} }, false, }, { "zero proposal id request", func() { - req = &v1beta1.QueryProposalRequest{ProposalId: 0} + req = &types.QueryProposalRequest{ProposalId: 0} }, false, }, { "valid request", func() { - req = &v1beta1.QueryProposalRequest{ProposalId: 1} - testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") - submittedProposal, err := app.GovKeeper.SubmitProposal(ctx, testProposal) + req = &types.QueryProposalRequest{ProposalId: 1} + submittedProposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{}) suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) @@ -80,11 +78,11 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposal() { func (suite *KeeperTestSuite) TestGRPCQueryProposals() { app, ctx, queryClient, addrs := suite.app, suite.ctx, suite.queryClient, suite.addrs - testProposals := []v1beta1.Proposal{} + testProposals := []*types.Proposal{} var ( - req *v1beta1.QueryProposalsRequest - expRes *v1beta1.QueryProposalsResponse + req *types.QueryProposalsRequest + expRes *types.QueryProposalsResponse ) testCases := []struct { @@ -95,7 +93,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { { "empty state request", func() { - req = &v1beta1.QueryProposalsRequest{} + req = &types.QueryProposalsRequest{} }, true, }, @@ -104,19 +102,21 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { func() { // create 5 test proposals for i := 0; i < 5; i++ { - num := strconv.Itoa(i + 1) - testProposal := v1beta1.NewTextProposal("Proposal"+num, "testing proposal "+num) + govAddress := app.GovKeeper.GetGovernanceAccount(suite.ctx).GetAddress() + testProposal := []sdk.Msg{ + types.NewMsgVote(govAddress, uint64(i), types.OptionYes), + } proposal, err := app.GovKeeper.SubmitProposal(ctx, testProposal) suite.Require().NotEmpty(proposal) suite.Require().NoError(err) - testProposals = append(testProposals, proposal) + testProposals = append(testProposals, &proposal) } - req = &v1beta1.QueryProposalsRequest{ + req = &types.QueryProposalsRequest{ Pagination: &query.PageRequest{Limit: 3}, } - expRes = &v1beta1.QueryProposalsResponse{ + expRes = &types.QueryProposalsResponse{ Proposals: testProposals[:3], } }, @@ -125,11 +125,11 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { { "request 2nd page with limit 4", func() { - req = &v1beta1.QueryProposalsRequest{ + req = &types.QueryProposalsRequest{ Pagination: &query.PageRequest{Offset: 3, Limit: 3}, } - expRes = &v1beta1.QueryProposalsResponse{ + expRes = &types.QueryProposalsResponse{ Proposals: testProposals[3:], } }, @@ -138,11 +138,11 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { { "request with limit 2 and count true", func() { - req = &v1beta1.QueryProposalsRequest{ + req = &types.QueryProposalsRequest{ Pagination: &query.PageRequest{Limit: 2, CountTotal: true}, } - expRes = &v1beta1.QueryProposalsResponse{ + expRes = &types.QueryProposalsResponse{ Proposals: testProposals[:2], } }, @@ -151,11 +151,11 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { { "request with filter of status deposit period", func() { - req = &v1beta1.QueryProposalsRequest{ - ProposalStatus: v1beta1.StatusDepositPeriod, + req = &types.QueryProposalsRequest{ + ProposalStatus: types.StatusDepositPeriod, } - expRes = &v1beta1.QueryProposalsResponse{ + expRes = &types.QueryProposalsResponse{ Proposals: testProposals, } }, @@ -165,14 +165,14 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { "request with filter of deposit address", func() { depositCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 20))) - deposit := v1beta1.NewDeposit(testProposals[0].ProposalId, addrs[0], depositCoins) + deposit := types.NewDeposit(testProposals[0].ProposalId, addrs[0], depositCoins) app.GovKeeper.SetDeposit(ctx, deposit) - req = &v1beta1.QueryProposalsRequest{ + req = &types.QueryProposalsRequest{ Depositor: addrs[0].String(), } - expRes = &v1beta1.QueryProposalsResponse{ + expRes = &types.QueryProposalsResponse{ Proposals: testProposals[:1], } }, @@ -181,15 +181,15 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { { "request with filter of deposit address", func() { - testProposals[1].Status = v1beta1.StatusVotingPeriod - app.GovKeeper.SetProposal(ctx, testProposals[1]) - suite.Require().NoError(app.GovKeeper.AddVote(ctx, testProposals[1].ProposalId, addrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionAbstain))) + testProposals[1].Status = types.StatusVotingPeriod + app.GovKeeper.SetProposal(ctx, *testProposals[1]) + suite.Require().NoError(app.GovKeeper.AddVote(ctx, testProposals[1].ProposalId, addrs[0], types.NewNonSplitVoteOption(types.OptionAbstain))) - req = &v1beta1.QueryProposalsRequest{ + req = &types.QueryProposalsRequest{ Voter: addrs[0].String(), } - expRes = &v1beta1.QueryProposalsResponse{ + expRes = &types.QueryProposalsResponse{ Proposals: testProposals[1:2], } }, @@ -223,9 +223,9 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { app, ctx, queryClient, addrs := suite.app, suite.ctx, suite.queryClient, suite.addrs var ( - req *v1beta1.QueryVoteRequest - expRes *v1beta1.QueryVoteResponse - proposal v1beta1.Proposal + req *types.QueryVoteRequest + expRes *types.QueryVoteResponse + proposal types.Proposal ) testCases := []struct { @@ -236,14 +236,14 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { { "empty request", func() { - req = &v1beta1.QueryVoteRequest{} + req = &types.QueryVoteRequest{} }, false, }, { "zero proposal id request", func() { - req = &v1beta1.QueryVoteRequest{ + req = &types.QueryVoteRequest{ ProposalId: 0, Voter: addrs[0].String(), } @@ -253,7 +253,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { { "empty voter request", func() { - req = &v1beta1.QueryVoteRequest{ + req = &types.QueryVoteRequest{ ProposalId: 1, Voter: "", } @@ -263,7 +263,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { { "non existed proposal", func() { - req = &v1beta1.QueryVoteRequest{ + req = &types.QueryVoteRequest{ ProposalId: 3, Voter: addrs[0].String(), } @@ -277,40 +277,40 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) suite.Require().NoError(err) - req = &v1beta1.QueryVoteRequest{ + req = &types.QueryVoteRequest{ ProposalId: proposal.ProposalId, Voter: addrs[0].String(), } - expRes = &v1beta1.QueryVoteResponse{} + expRes = &types.QueryVoteResponse{} }, false, }, { "valid request", func() { - proposal.Status = v1beta1.StatusVotingPeriod + proposal.Status = types.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionAbstain))) + suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], types.NewNonSplitVoteOption(types.OptionAbstain))) - req = &v1beta1.QueryVoteRequest{ + req = &types.QueryVoteRequest{ ProposalId: proposal.ProposalId, Voter: addrs[0].String(), } - expRes = &v1beta1.QueryVoteResponse{Vote: v1beta1.Vote{ProposalId: proposal.ProposalId, Voter: addrs[0].String(), Option: v1beta1.OptionAbstain, Options: []v1beta1.WeightedVoteOption{{Option: v1beta1.OptionAbstain, Weight: sdk.MustNewDecFromStr("1.0")}}}} + expRes = &types.QueryVoteResponse{Vote: &types.Vote{ProposalId: proposal.ProposalId, Voter: addrs[0].String(), Option: types.OptionAbstain, Options: []*types.WeightedVoteOption{{Option: types.OptionAbstain, Weight: sdk.MustNewDecFromStr("1.0").String()}}}} }, true, }, { "wrong voter id request", func() { - req = &v1beta1.QueryVoteRequest{ + req = &types.QueryVoteRequest{ ProposalId: proposal.ProposalId, Voter: addrs[1].String(), } - expRes = &v1beta1.QueryVoteResponse{} + expRes = &types.QueryVoteResponse{} }, false, }, @@ -339,10 +339,10 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { addrs := simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.NewInt(30000000)) var ( - req *v1beta1.QueryVotesRequest - expRes *v1beta1.QueryVotesResponse - proposal v1beta1.Proposal - votes v1beta1.Votes + req *types.QueryVotesRequest + expRes *types.QueryVotesResponse + proposal types.Proposal + votes types.Votes ) testCases := []struct { @@ -353,14 +353,14 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { { "empty request", func() { - req = &v1beta1.QueryVotesRequest{} + req = &types.QueryVotesRequest{} }, false, }, { "zero proposal id request", func() { - req = &v1beta1.QueryVotesRequest{ + req = &types.QueryVotesRequest{ ProposalId: 0, } }, @@ -369,7 +369,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { { "non existed proposals", func() { - req = &v1beta1.QueryVotesRequest{ + req = &types.QueryVotesRequest{ ProposalId: 2, } }, @@ -382,7 +382,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) suite.Require().NoError(err) - req = &v1beta1.QueryVotesRequest{ + req = &types.QueryVotesRequest{ ProposalId: proposal.ProposalId, } }, @@ -391,12 +391,12 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { { "request after adding 2 votes", func() { - proposal.Status = v1beta1.StatusVotingPeriod + proposal.Status = types.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - votes = []v1beta1.Vote{ - {ProposalId: proposal.ProposalId, Voter: addrs[0].String(), Option: v1beta1.OptionAbstain, Options: v1beta1.NewNonSplitVoteOption(v1beta1.OptionAbstain)}, - {ProposalId: proposal.ProposalId, Voter: addrs[1].String(), Option: v1beta1.OptionYes, Options: v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)}, + votes = []*types.Vote{ + {ProposalId: proposal.ProposalId, Voter: addrs[0].String(), Option: types.OptionAbstain, Options: types.NewNonSplitVoteOption(types.OptionAbstain)}, + {ProposalId: proposal.ProposalId, Voter: addrs[1].String(), Option: types.OptionYes, Options: types.NewNonSplitVoteOption(types.OptionYes)}, } accAddr1, err1 := sdk.AccAddressFromBech32(votes[0].Voter) accAddr2, err2 := sdk.AccAddressFromBech32(votes[1].Voter) @@ -405,11 +405,11 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, accAddr1, votes[0].Options)) suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, accAddr2, votes[1].Options)) - req = &v1beta1.QueryVotesRequest{ + req = &types.QueryVotesRequest{ ProposalId: proposal.ProposalId, } - expRes = &v1beta1.QueryVotesResponse{ + expRes = &types.QueryVotesResponse{ Votes: votes, } }, @@ -438,8 +438,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { queryClient := suite.queryClient var ( - req *v1beta1.QueryParamsRequest - expRes *v1beta1.QueryParamsResponse + req *types.QueryParamsRequest + expRes *types.QueryParamsResponse ) testCases := []struct { @@ -450,17 +450,19 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { { "empty request", func() { - req = &v1beta1.QueryParamsRequest{} + req = &types.QueryParamsRequest{} }, false, }, { "deposit params request", func() { - req = &v1beta1.QueryParamsRequest{ParamsType: v1beta1.ParamDeposit} - expRes = &v1beta1.QueryParamsResponse{ - DepositParams: v1beta1.DefaultDepositParams(), - TallyParams: v1beta1.NewTallyParams(sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0)), + req = &types.QueryParamsRequest{ParamsType: types.ParamDeposit} + depositParams := types.DefaultDepositParams() + tallyParams := types.NewTallyParams(sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0)) + expRes = &types.QueryParamsResponse{ + DepositParams: &depositParams, + TallyParams: &tallyParams, } }, true, @@ -468,10 +470,12 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { { "voting params request", func() { - req = &v1beta1.QueryParamsRequest{ParamsType: v1beta1.ParamVoting} - expRes = &v1beta1.QueryParamsResponse{ - VotingParams: v1beta1.DefaultVotingParams(), - TallyParams: v1beta1.NewTallyParams(sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0)), + req = &types.QueryParamsRequest{ParamsType: types.ParamVoting} + votingParams := types.DefaultVotingParams() + tallyParams := types.NewTallyParams(sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0)) + expRes = &types.QueryParamsResponse{ + VotingParams: &votingParams, + TallyParams: &tallyParams, } }, true, @@ -479,9 +483,10 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { { "tally params request", func() { - req = &v1beta1.QueryParamsRequest{ParamsType: v1beta1.ParamTallying} - expRes = &v1beta1.QueryParamsResponse{ - TallyParams: v1beta1.DefaultTallyParams(), + req = &types.QueryParamsRequest{ParamsType: types.ParamTallying} + tallyParams := types.DefaultTallyParams() + expRes = &types.QueryParamsResponse{ + TallyParams: &tallyParams, } }, true, @@ -489,8 +494,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { { "invalid request", func() { - req = &v1beta1.QueryParamsRequest{ParamsType: "wrongPath"} - expRes = &v1beta1.QueryParamsResponse{} + req = &types.QueryParamsRequest{ParamsType: "wrongPath"} + expRes = &types.QueryParamsResponse{} }, false, }, @@ -519,9 +524,9 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { app, ctx, queryClient, addrs := suite.app, suite.ctx, suite.queryClient, suite.addrs var ( - req *v1beta1.QueryDepositRequest - expRes *v1beta1.QueryDepositResponse - proposal v1beta1.Proposal + req *types.QueryDepositRequest + expRes *types.QueryDepositResponse + proposal types.Proposal ) testCases := []struct { @@ -532,14 +537,14 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { { "empty request", func() { - req = &v1beta1.QueryDepositRequest{} + req = &types.QueryDepositRequest{} }, false, }, { "zero proposal id request", func() { - req = &v1beta1.QueryDepositRequest{ + req = &types.QueryDepositRequest{ ProposalId: 0, Depositor: addrs[0].String(), } @@ -549,7 +554,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { { "empty deposit address request", func() { - req = &v1beta1.QueryDepositRequest{ + req = &types.QueryDepositRequest{ ProposalId: 1, Depositor: "", } @@ -559,7 +564,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { { "non existed proposal", func() { - req = &v1beta1.QueryDepositRequest{ + req = &types.QueryDepositRequest{ ProposalId: 2, Depositor: addrs[0].String(), } @@ -574,7 +579,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { suite.Require().NoError(err) suite.Require().NotNil(proposal) - req = &v1beta1.QueryDepositRequest{ + req = &types.QueryDepositRequest{ ProposalId: proposal.ProposalId, Depositor: addrs[0].String(), } @@ -585,15 +590,15 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { "valid request", func() { depositCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 20))) - deposit := v1beta1.NewDeposit(proposal.ProposalId, addrs[0], depositCoins) + deposit := types.NewDeposit(proposal.ProposalId, addrs[0], depositCoins) app.GovKeeper.SetDeposit(ctx, deposit) - req = &v1beta1.QueryDepositRequest{ + req = &types.QueryDepositRequest{ ProposalId: proposal.ProposalId, Depositor: addrs[0].String(), } - expRes = &v1beta1.QueryDepositResponse{Deposit: deposit} + expRes = &types.QueryDepositResponse{Deposit: &deposit} }, true, }, @@ -620,9 +625,9 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { app, ctx, queryClient, addrs := suite.app, suite.ctx, suite.queryClient, suite.addrs var ( - req *v1beta1.QueryDepositsRequest - expRes *v1beta1.QueryDepositsResponse - proposal v1beta1.Proposal + req *types.QueryDepositsRequest + expRes *types.QueryDepositsResponse + proposal types.Proposal ) testCases := []struct { @@ -633,14 +638,14 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { { "empty request", func() { - req = &v1beta1.QueryDepositsRequest{} + req = &types.QueryDepositsRequest{} }, false, }, { "zero proposal id request", func() { - req = &v1beta1.QueryDepositsRequest{ + req = &types.QueryDepositsRequest{ ProposalId: 0, } }, @@ -649,7 +654,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { { "non existed proposal", func() { - req = &v1beta1.QueryDepositsRequest{ + req = &types.QueryDepositsRequest{ ProposalId: 2, } }, @@ -662,7 +667,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) suite.Require().NoError(err) - req = &v1beta1.QueryDepositsRequest{ + req = &types.QueryDepositsRequest{ ProposalId: proposal.ProposalId, } }, @@ -672,20 +677,20 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { "get deposits with default limit", func() { depositAmount1 := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 20))) - deposit1 := v1beta1.NewDeposit(proposal.ProposalId, addrs[0], depositAmount1) + deposit1 := types.NewDeposit(proposal.ProposalId, addrs[0], depositAmount1) app.GovKeeper.SetDeposit(ctx, deposit1) depositAmount2 := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 30))) - deposit2 := v1beta1.NewDeposit(proposal.ProposalId, addrs[1], depositAmount2) + deposit2 := types.NewDeposit(proposal.ProposalId, addrs[1], depositAmount2) app.GovKeeper.SetDeposit(ctx, deposit2) - deposits := v1beta1.Deposits{deposit1, deposit2} + deposits := types.Deposits{&deposit1, &deposit2} - req = &v1beta1.QueryDepositsRequest{ + req = &types.QueryDepositsRequest{ ProposalId: proposal.ProposalId, } - expRes = &v1beta1.QueryDepositsResponse{ + expRes = &types.QueryDepositsResponse{ Deposits: deposits, } }, @@ -716,9 +721,9 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() { addrs, _ := createValidators(suite.T(), ctx, app, []int64{5, 5, 5}) var ( - req *v1beta1.QueryTallyResultRequest - expRes *v1beta1.QueryTallyResultResponse - proposal v1beta1.Proposal + req *types.QueryTallyResultRequest + expRes *types.QueryTallyResultResponse + proposal types.Proposal ) testCases := []struct { @@ -729,21 +734,21 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() { { "empty request", func() { - req = &v1beta1.QueryTallyResultRequest{} + req = &types.QueryTallyResultRequest{} }, false, }, { "zero proposal id request", func() { - req = &v1beta1.QueryTallyResultRequest{ProposalId: 0} + req = &types.QueryTallyResultRequest{ProposalId: 0} }, false, }, { "query non existed proposal", func() { - req = &v1beta1.QueryTallyResultRequest{ProposalId: 1} + req = &types.QueryTallyResultRequest{ProposalId: 1} }, false, }, @@ -755,10 +760,11 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() { suite.Require().NoError(err) suite.Require().NotNil(proposal) - req = &v1beta1.QueryTallyResultRequest{ProposalId: proposal.ProposalId} + req = &types.QueryTallyResultRequest{ProposalId: proposal.ProposalId} - expRes = &v1beta1.QueryTallyResultResponse{ - Tally: v1beta1.EmptyTallyResult(), + tallyResult := types.EmptyTallyResult() + expRes = &types.QueryTallyResultResponse{ + Tally: &tallyResult, } }, true, @@ -766,18 +772,18 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() { { "request tally after few votes", func() { - proposal.Status = v1beta1.StatusVotingPeriod + proposal.Status = types.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) - suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[1], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) - suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[2], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) + suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], types.NewNonSplitVoteOption(types.OptionYes))) + suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[1], types.NewNonSplitVoteOption(types.OptionYes))) + suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[2], types.NewNonSplitVoteOption(types.OptionYes))) - req = &v1beta1.QueryTallyResultRequest{ProposalId: proposal.ProposalId} + req = &types.QueryTallyResultRequest{ProposalId: proposal.ProposalId} - expRes = &v1beta1.QueryTallyResultResponse{ - Tally: v1beta1.TallyResult{ - Yes: sdk.NewInt(3 * 5 * 1000000), + expRes = &types.QueryTallyResultResponse{ + Tally: &types.TallyResult{ + Yes: sdk.NewInt(3 * 5 * 1000000).String(), }, } }, @@ -786,13 +792,13 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() { { "request final tally after status changed", func() { - proposal.Status = v1beta1.StatusPassed + proposal.Status = types.StatusPassed app.GovKeeper.SetProposal(ctx, proposal) proposal, _ = app.GovKeeper.GetProposal(ctx, proposal.ProposalId) - req = &v1beta1.QueryTallyResultRequest{ProposalId: proposal.ProposalId} + req = &types.QueryTallyResultRequest{ProposalId: proposal.ProposalId} - expRes = &v1beta1.QueryTallyResultResponse{ + expRes = &types.QueryTallyResultResponse{ Tally: proposal.FinalTallyResult, } }, diff --git a/x/gov/keeper/hooks_test.go b/x/gov/keeper/hooks_test.go index 6edb6733e16e..81550bcb056c 100644 --- a/x/gov/keeper/hooks_test.go +++ b/x/gov/keeper/hooks_test.go @@ -12,7 +12,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) var _ types.GovHooks = &MockGovHooksReceiver{} @@ -69,7 +68,7 @@ func TestHooks(t *testing.T) { require.True(t, govHooksReceiver.AfterProposalSubmissionValid) newHeader := ctx.BlockHeader() - newHeader.Time = ctx.BlockHeader().Time.Add(app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod).Add(time.Duration(1) * time.Second) + newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod).Add(time.Duration(1) * time.Second) ctx = ctx.WithBlockHeader(newHeader) gov.EndBlocker(ctx, app.GovKeeper) @@ -83,12 +82,12 @@ func TestHooks(t *testing.T) { require.NoError(t, err) require.True(t, govHooksReceiver.AfterProposalDepositValid) - err = app.GovKeeper.AddVote(ctx, p2.ProposalId, addrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)) + err = app.GovKeeper.AddVote(ctx, p2.ProposalId, addrs[0], types.NewNonSplitVoteOption(types.OptionYes)) require.NoError(t, err) require.True(t, govHooksReceiver.AfterProposalVoteValid) newHeader = ctx.BlockHeader() - newHeader.Time = ctx.BlockHeader().Time.Add(app.GovKeeper.GetVotingParams(ctx).VotingPeriod).Add(time.Duration(1) * time.Second) + newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetVotingParams(ctx).VotingPeriod).Add(time.Duration(1) * time.Second) ctx = ctx.WithBlockHeader(newHeader) gov.EndBlocker(ctx, app.GovKeeper) require.True(t, govHooksReceiver.AfterProposalVotingPeriodEndedValid) diff --git a/x/gov/keeper/invariants.go b/x/gov/keeper/invariants.go index e30d2f1e64a1..d0ec4dbfacc8 100644 --- a/x/gov/keeper/invariants.go +++ b/x/gov/keeper/invariants.go @@ -7,7 +7,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // RegisterInvariants registers all governance invariants @@ -28,7 +27,7 @@ func ModuleAccountInvariant(keeper Keeper, bk types.BankKeeper) sdk.Invariant { return func(ctx sdk.Context) (string, bool) { var expectedDeposits sdk.Coins - keeper.IterateAllDeposits(ctx, func(deposit v1beta1.Deposit) bool { + keeper.IterateAllDeposits(ctx, func(deposit types.Deposit) bool { expectedDeposits = expectedDeposits.Add(deposit.Amount...) return false }) diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 646493b12530..3c93ed3332c3 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/middleware" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" @@ -34,8 +35,11 @@ type Keeper struct { // The codec codec for binary encoding/decoding. cdc codec.BinaryCodec - // Proposal router - router v1beta1.Router + // Legacy Proposal router + legacyRouter v1beta1.Router + + // Msg server router + router *middleware.MsgServiceRouter } // NewKeeper returns a governance keeper. It handles: @@ -47,7 +51,8 @@ type Keeper struct { // CONTRACT: the parameter Subspace must have the param key table already initialized func NewKeeper( cdc codec.BinaryCodec, key storetypes.StoreKey, paramSpace types.ParamSubspace, - authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, sk types.StakingKeeper, rtr v1beta1.Router, + authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, sk types.StakingKeeper, + legacyRouter v1beta1.Router, router *middleware.MsgServiceRouter, ) Keeper { // ensure governance module account is set @@ -58,16 +63,17 @@ func NewKeeper( // It is vital to seal the governance proposal router here as to not allow // further handlers to be registered after the keeper is created since this // could create invalid or non-deterministic behavior. - rtr.Seal() + legacyRouter.Seal() return Keeper{ - storeKey: key, - paramSpace: paramSpace, - authKeeper: authKeeper, - bankKeeper: bankKeeper, - sk: sk, - cdc: cdc, - router: rtr, + storeKey: key, + paramSpace: paramSpace, + authKeeper: authKeeper, + bankKeeper: bankKeeper, + sk: sk, + cdc: cdc, + legacyRouter: legacyRouter, + router: router, } } @@ -88,8 +94,8 @@ func (keeper Keeper) Logger(ctx sdk.Context) log.Logger { } // Router returns the gov Keeper's Router -func (keeper Keeper) Router() v1beta1.Router { - return keeper.router +func (keeper Keeper) LegacyRouter() v1beta1.Router { + return keeper.legacyRouter } // GetGovernanceAccount returns the governance ModuleAccount @@ -129,7 +135,7 @@ func (keeper Keeper) RemoveFromInactiveProposalQueue(ctx sdk.Context, proposalID // IterateActiveProposalsQueue iterates over the proposals in the active proposal queue // and performs a callback function -func (keeper Keeper) IterateActiveProposalsQueue(ctx sdk.Context, endTime time.Time, cb func(proposal v1beta1.Proposal) (stop bool)) { +func (keeper Keeper) IterateActiveProposalsQueue(ctx sdk.Context, endTime time.Time, cb func(proposal types.Proposal) (stop bool)) { iterator := keeper.ActiveProposalQueueIterator(ctx, endTime) defer iterator.Close() @@ -148,7 +154,7 @@ func (keeper Keeper) IterateActiveProposalsQueue(ctx sdk.Context, endTime time.T // IterateInactiveProposalsQueue iterates over the proposals in the inactive proposal queue // and performs a callback function -func (keeper Keeper) IterateInactiveProposalsQueue(ctx sdk.Context, endTime time.Time, cb func(proposal v1beta1.Proposal) (stop bool)) { +func (keeper Keeper) IterateInactiveProposalsQueue(ctx sdk.Context, endTime time.Time, cb func(proposal types.Proposal) (stop bool)) { iterator := keeper.InactiveProposalQueueIterator(ctx, endTime) defer iterator.Close() diff --git a/x/gov/keeper/keeper_test.go b/x/gov/keeper/keeper_test.go index db1791953853..ed38f05ca551 100644 --- a/x/gov/keeper/keeper_test.go +++ b/x/gov/keeper/keeper_test.go @@ -11,7 +11,6 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) type KeeperTestSuite struct { @@ -19,7 +18,7 @@ type KeeperTestSuite struct { app *simapp.SimApp ctx sdk.Context - queryClient v1beta1.QueryClient + queryClient types.QueryClient addrs []sdk.AccAddress } @@ -28,8 +27,8 @@ func (suite *KeeperTestSuite) SetupTest() { ctx := app.BaseApp.NewContext(false, tmproto.Header{}) queryHelper := baseapp.NewQueryServerTestHelper(ctx, app.InterfaceRegistry()) - v1beta1.RegisterQueryServer(queryHelper, app.GovKeeper) - queryClient := v1beta1.NewQueryClient(queryHelper) + types.RegisterQueryServer(queryHelper, app.GovKeeper) + queryClient := types.NewQueryClient(queryHelper) suite.app = app suite.ctx = ctx @@ -67,7 +66,7 @@ func TestProposalQueues(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) - inactiveIterator := app.GovKeeper.InactiveProposalQueueIterator(ctx, proposal.DepositEndTime) + inactiveIterator := app.GovKeeper.InactiveProposalQueueIterator(ctx, *proposal.DepositEndTime) require.True(t, inactiveIterator.Valid()) proposalID := types.GetProposalIDFromBytes(inactiveIterator.Value()) @@ -79,7 +78,7 @@ func TestProposalQueues(t *testing.T) { proposal, ok := app.GovKeeper.GetProposal(ctx, proposal.ProposalId) require.True(t, ok) - activeIterator := app.GovKeeper.ActiveProposalQueueIterator(ctx, proposal.VotingEndTime) + activeIterator := app.GovKeeper.ActiveProposalQueueIterator(ctx, *proposal.VotingEndTime) require.True(t, activeIterator.Valid()) proposalID, _ = types.SplitActiveProposalQueueKey(activeIterator.Key()) diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 30826d554a5b..fbde19b287ad 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -20,15 +20,21 @@ type msgServer struct { // NewMsgServerImpl returns an implementation of the gov MsgServer interface // for the provided Keeper. -func NewMsgServerImpl(keeper Keeper) v1beta1.MsgServer { +func NewMsgServerImpl(keeper Keeper) types.MsgServer { return &msgServer{Keeper: keeper} } -var _ v1beta1.MsgServer = msgServer{} +var _ types.MsgServer = msgServer{} -func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1beta1.MsgSubmitProposal) (*v1beta1.MsgSubmitProposalResponse, error) { +func (k msgServer) SubmitProposal(goCtx context.Context, msg *types.MsgSubmitProposal) (*types.MsgSubmitProposalResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - proposal, err := k.Keeper.SubmitProposal(ctx, msg.GetContent()) + + proposalMsgs, err := msg.GetMsgs() + if err != nil { + return nil, err + } + + proposal, err := k.Keeper.SubmitProposal(ctx, proposalMsgs) if err != nil { return nil, err } @@ -44,9 +50,10 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1beta1.MsgSubmitP "submit proposal", ) - defer telemetry.IncrCounter(1, v1beta1.ModuleName, "proposal") + defer telemetry.IncrCounter(1, types.ModuleName, "proposal") - votingStarted, err := k.Keeper.AddDeposit(ctx, proposal.ProposalId, msg.GetProposer(), msg.GetInitialDeposit()) + proposer, _ := sdk.AccAddressFromBech32(msg.GetProposer()) + votingStarted, err := k.Keeper.AddDeposit(ctx, proposal.ProposalId, proposer, msg.GetInitialDeposit()) if err != nil { return nil, err } @@ -55,11 +62,11 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1beta1.MsgSubmitP sdk.NewEvent( sdk.EventTypeMessage, sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.GetProposer().String()), + sdk.NewAttribute(sdk.AttributeKeySender, msg.GetProposer()), ), ) - submitEvent := sdk.NewEvent(types.EventTypeSubmitProposal, sdk.NewAttribute(types.AttributeKeyProposalType, msg.GetContent().ProposalType())) + submitEvent := sdk.NewEvent(types.EventTypeSubmitProposal) if votingStarted { submitEvent = submitEvent.AppendAttributes( sdk.NewAttribute(types.AttributeKeyVotingPeriodStart, fmt.Sprintf("%d", proposal.ProposalId)), @@ -67,24 +74,24 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1beta1.MsgSubmitP } ctx.EventManager().EmitEvent(submitEvent) - return &v1beta1.MsgSubmitProposalResponse{ + return &types.MsgSubmitProposalResponse{ ProposalId: proposal.ProposalId, }, nil } -func (k msgServer) Vote(goCtx context.Context, msg *v1beta1.MsgVote) (*v1beta1.MsgVoteResponse, error) { +func (k msgServer) Vote(goCtx context.Context, msg *types.MsgVote) (*types.MsgVoteResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) accAddr, accErr := sdk.AccAddressFromBech32(msg.Voter) if accErr != nil { return nil, accErr } - err := k.Keeper.AddVote(ctx, msg.ProposalId, accAddr, v1beta1.NewNonSplitVoteOption(msg.Option)) + err := k.Keeper.AddVote(ctx, msg.ProposalId, accAddr, types.NewNonSplitVoteOption(msg.Option)) if err != nil { return nil, err } defer telemetry.IncrCounterWithLabels( - []string{v1beta1.ModuleName, "vote"}, + []string{types.ModuleName, "vote"}, 1, []metrics.Label{ telemetry.NewLabel("proposal_id", strconv.Itoa(int(msg.ProposalId))), @@ -99,10 +106,10 @@ func (k msgServer) Vote(goCtx context.Context, msg *v1beta1.MsgVote) (*v1beta1.M ), ) - return &v1beta1.MsgVoteResponse{}, nil + return &types.MsgVoteResponse{}, nil } -func (k msgServer) VoteWeighted(goCtx context.Context, msg *v1beta1.MsgVoteWeighted) (*v1beta1.MsgVoteWeightedResponse, error) { +func (k msgServer) VoteWeighted(goCtx context.Context, msg *types.MsgVoteWeighted) (*types.MsgVoteWeightedResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) accAddr, accErr := sdk.AccAddressFromBech32(msg.Voter) if accErr != nil { @@ -114,7 +121,7 @@ func (k msgServer) VoteWeighted(goCtx context.Context, msg *v1beta1.MsgVoteWeigh } defer telemetry.IncrCounterWithLabels( - []string{v1beta1.ModuleName, "vote"}, + []string{types.ModuleName, "vote"}, 1, []metrics.Label{ telemetry.NewLabel("proposal_id", strconv.Itoa(int(msg.ProposalId))), @@ -129,10 +136,10 @@ func (k msgServer) VoteWeighted(goCtx context.Context, msg *v1beta1.MsgVoteWeigh ), ) - return &v1beta1.MsgVoteWeightedResponse{}, nil + return &types.MsgVoteWeightedResponse{}, nil } -func (k msgServer) Deposit(goCtx context.Context, msg *v1beta1.MsgDeposit) (*v1beta1.MsgDepositResponse, error) { +func (k msgServer) Deposit(goCtx context.Context, msg *types.MsgDeposit) (*types.MsgDepositResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) accAddr, err := sdk.AccAddressFromBech32(msg.Depositor) if err != nil { @@ -144,7 +151,7 @@ func (k msgServer) Deposit(goCtx context.Context, msg *v1beta1.MsgDeposit) (*v1b } defer telemetry.IncrCounterWithLabels( - []string{v1beta1.ModuleName, "deposit"}, + []string{types.ModuleName, "deposit"}, 1, []metrics.Label{ telemetry.NewLabel("proposal_id", strconv.Itoa(int(msg.ProposalId))), @@ -168,5 +175,84 @@ func (k msgServer) Deposit(goCtx context.Context, msg *v1beta1.MsgDeposit) (*v1b ) } + return &types.MsgDepositResponse{}, nil +} + +type legacyMsgServer struct { + Server types.MsgServer +} + +// NewLegacyMsgServerImpl returns an implementation of the v1beta1 legacy MsgServer interface. It wraps around +// the current MsgServer +func NewLegacyMsgServerImpl(keeper Keeper) v1beta1.MsgServer { + return &legacyMsgServer{Server: NewMsgServerImpl(keeper)} +} + +var _ v1beta1.MsgServer = legacyMsgServer{} + +func (k legacyMsgServer) SubmitProposal(goCtx context.Context, msg *v1beta1.MsgSubmitProposal) (*v1beta1.MsgSubmitProposalResponse, error) { + contentMsg, err := NewContentProposal(msg.GetContent(), msg.Proposer) + if err != nil { + return nil, fmt.Errorf("error converting legacy content into proposal message: %w", err) + } + + proposal, err := types.NewMsgSubmitProposal( + []sdk.Msg{contentMsg}, + msg.InitialDeposit, + sdk.AccAddress(msg.Proposer), + ) + if err != nil { + return nil, err + } + + resp, err := k.Server.SubmitProposal(goCtx, proposal) + if err != nil { + return nil, err + } + + return &v1beta1.MsgSubmitProposalResponse{ProposalId: resp.ProposalId}, nil +} + +func (k legacyMsgServer) Vote(goCtx context.Context, msg *v1beta1.MsgVote) (*v1beta1.MsgVoteResponse, error) { + _, err := k.Server.Vote(goCtx, &types.MsgVote{ + ProposalId: msg.ProposalId, + Voter: msg.Voter, + Option: types.VoteOption(msg.Option), + }) + if err != nil { + return nil, err + } + return &v1beta1.MsgVoteResponse{}, nil +} + +func (k legacyMsgServer) VoteWeighted(goCtx context.Context, msg *v1beta1.MsgVoteWeighted) (*v1beta1.MsgVoteWeightedResponse, error) { + opts := make([]*types.WeightedVoteOption, len(msg.Options)) + for idx, opt := range msg.Options { + opts[idx] = &types.WeightedVoteOption{ + Option: types.VoteOption(opt.Option), + Weight: opt.Weight.String(), + } + } + + _, err := k.Server.VoteWeighted(goCtx, &types.MsgVoteWeighted{ + ProposalId: msg.ProposalId, + Voter: msg.Voter, + Options: opts, + }) + if err != nil { + return nil, err + } + return &v1beta1.MsgVoteWeightedResponse{}, nil +} + +func (k legacyMsgServer) Deposit(goCtx context.Context, msg *v1beta1.MsgDeposit) (*v1beta1.MsgDepositResponse, error) { + _, err := k.Server.Deposit(goCtx, &types.MsgDeposit{ + ProposalId: msg.ProposalId, + Depositor: msg.Depositor, + Amount: msg.Amount, + }) + if err != nil { + return nil, err + } return &v1beta1.MsgDepositResponse{}, nil } diff --git a/x/gov/keeper/params.go b/x/gov/keeper/params.go index 4ff77cf39216..0c6fc4338b9f 100644 --- a/x/gov/keeper/params.go +++ b/x/gov/keeper/params.go @@ -3,41 +3,40 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // GetDepositParams returns the current DepositParams from the global param store -func (keeper Keeper) GetDepositParams(ctx sdk.Context) v1beta1.DepositParams { - var depositParams v1beta1.DepositParams +func (keeper Keeper) GetDepositParams(ctx sdk.Context) types.DepositParams { + var depositParams types.DepositParams keeper.paramSpace.Get(ctx, types.ParamStoreKeyDepositParams, &depositParams) return depositParams } // GetVotingParams returns the current VotingParams from the global param store -func (keeper Keeper) GetVotingParams(ctx sdk.Context) v1beta1.VotingParams { - var votingParams v1beta1.VotingParams +func (keeper Keeper) GetVotingParams(ctx sdk.Context) types.VotingParams { + var votingParams types.VotingParams keeper.paramSpace.Get(ctx, types.ParamStoreKeyVotingParams, &votingParams) return votingParams } // GetTallyParams returns the current TallyParam from the global param store -func (keeper Keeper) GetTallyParams(ctx sdk.Context) v1beta1.TallyParams { - var tallyParams v1beta1.TallyParams +func (keeper Keeper) GetTallyParams(ctx sdk.Context) types.TallyParams { + var tallyParams types.TallyParams keeper.paramSpace.Get(ctx, types.ParamStoreKeyTallyParams, &tallyParams) return tallyParams } // SetDepositParams sets DepositParams to the global param store -func (keeper Keeper) SetDepositParams(ctx sdk.Context, depositParams v1beta1.DepositParams) { +func (keeper Keeper) SetDepositParams(ctx sdk.Context, depositParams types.DepositParams) { keeper.paramSpace.Set(ctx, types.ParamStoreKeyDepositParams, &depositParams) } // SetVotingParams sets VotingParams to the global param store -func (keeper Keeper) SetVotingParams(ctx sdk.Context, votingParams v1beta1.VotingParams) { +func (keeper Keeper) SetVotingParams(ctx sdk.Context, votingParams types.VotingParams) { keeper.paramSpace.Set(ctx, types.ParamStoreKeyVotingParams, &votingParams) } // SetTallyParams sets TallyParams to the global param store -func (keeper Keeper) SetTallyParams(ctx sdk.Context, tallyParams v1beta1.TallyParams) { +func (keeper Keeper) SetTallyParams(ctx sdk.Context, tallyParams types.TallyParams) { keeper.paramSpace.Set(ctx, types.ParamStoreKeyTallyParams, &tallyParams) } diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index a3cbb2a4d7b5..9d89dc03ce93 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -3,7 +3,10 @@ package keeper import ( "fmt" + "github.com/gogo/protobuf/proto" + "github.com/cosmos/cosmos-sdk/client" + codec "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -11,35 +14,40 @@ import ( ) // SubmitProposal create new proposal given a content -func (keeper Keeper) SubmitProposal(ctx sdk.Context, content v1beta1.Content) (v1beta1.Proposal, error) { - if !keeper.router.HasRoute(content.ProposalRoute()) { - return v1beta1.Proposal{}, sdkerrors.Wrap(types.ErrNoProposalHandlerExists, content.ProposalRoute()) - } +// SubmitProposal create new proposal given a content +func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg) (types.Proposal, error) { + // Loop through all messages and confirm that each has a handler and the gov module account + // as the only signer + for _, msg := range messages { + signers := msg.GetSigners() + if len(signers) != 1 { + return types.Proposal{}, types.ErrInvalidSigner + } - // Execute the proposal content in a new context branch (with branched store) - // to validate the actual parameter changes before the proposal proceeds - // through the governance process. State is not persisted. - cacheCtx, _ := ctx.CacheContext() - handler := keeper.router.GetRoute(content.ProposalRoute()) - if err := handler(cacheCtx, content); err != nil { - return v1beta1.Proposal{}, sdkerrors.Wrap(v1beta1.ErrInvalidProposalContent, err.Error()) + if !signers[0].Equals(keeper.GetGovernanceAccount(ctx).GetAddress()) { + return types.Proposal{}, sdkerrors.Wrap(types.ErrInvalidSigner, signers[0].String()) + } + + if keeper.router.Handler(msg) == nil { + return types.Proposal{}, sdkerrors.Wrap(types.ErrUnroutableProposalMsg, sdk.MsgTypeURL(msg)) + } } proposalID, err := keeper.GetProposalID(ctx) if err != nil { - return v1beta1.Proposal{}, err + return types.Proposal{}, err } submitTime := ctx.BlockHeader().Time depositPeriod := keeper.GetDepositParams(ctx).MaxDepositPeriod - proposal, err := v1beta1.NewProposal(content, proposalID, submitTime, submitTime.Add(depositPeriod)) + proposal, err := types.NewProposal(messages, proposalID, submitTime, submitTime.Add(*depositPeriod)) if err != nil { - return v1beta1.Proposal{}, err + return types.Proposal{}, err } keeper.SetProposal(ctx, proposal) - keeper.InsertInactiveProposalQueue(ctx, proposalID, proposal.DepositEndTime) + keeper.InsertInactiveProposalQueue(ctx, proposalID, *proposal.DepositEndTime) keeper.SetProposalID(ctx, proposalID+1) // called right after a proposal is submitted @@ -57,15 +65,15 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, content v1beta1.Content) (v // GetProposal get proposal from store by ProposalID. // Panics if can't unmarshal the proposal. -func (keeper Keeper) GetProposal(ctx sdk.Context, proposalID uint64) (v1beta1.Proposal, bool) { +func (keeper Keeper) GetProposal(ctx sdk.Context, proposalID uint64) (types.Proposal, bool) { store := ctx.KVStore(keeper.storeKey) bz := store.Get(types.ProposalKey(proposalID)) if bz == nil { - return v1beta1.Proposal{}, false + return types.Proposal{}, false } - var proposal v1beta1.Proposal + var proposal types.Proposal if err := keeper.UnmarshalProposal(bz, &proposal); err != nil { panic(err) } @@ -75,7 +83,7 @@ func (keeper Keeper) GetProposal(ctx sdk.Context, proposalID uint64) (v1beta1.Pr // SetProposal set a proposal to store. // Panics if can't marshal the proposal. -func (keeper Keeper) SetProposal(ctx sdk.Context, proposal v1beta1.Proposal) { +func (keeper Keeper) SetProposal(ctx sdk.Context, proposal types.Proposal) { bz, err := keeper.MarshalProposal(proposal) if err != nil { panic(err) @@ -93,21 +101,21 @@ func (keeper Keeper) DeleteProposal(ctx sdk.Context, proposalID uint64) { if !ok { panic(fmt.Sprintf("couldn't find proposal with id#%d", proposalID)) } - keeper.RemoveFromInactiveProposalQueue(ctx, proposalID, proposal.DepositEndTime) - keeper.RemoveFromActiveProposalQueue(ctx, proposalID, proposal.VotingEndTime) + keeper.RemoveFromInactiveProposalQueue(ctx, proposalID, *proposal.DepositEndTime) + keeper.RemoveFromActiveProposalQueue(ctx, proposalID, *proposal.VotingEndTime) store.Delete(types.ProposalKey(proposalID)) } // IterateProposals iterates over the all the proposals and performs a callback function. // Panics when the iterator encounters a proposal which can't be unmarshaled. -func (keeper Keeper) IterateProposals(ctx sdk.Context, cb func(proposal v1beta1.Proposal) (stop bool)) { +func (keeper Keeper) IterateProposals(ctx sdk.Context, cb func(proposal types.Proposal) (stop bool)) { store := ctx.KVStore(keeper.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.ProposalsKeyPrefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - var proposal v1beta1.Proposal + var proposal types.Proposal err := keeper.UnmarshalProposal(iterator.Value(), &proposal) if err != nil { panic(err) @@ -120,8 +128,8 @@ func (keeper Keeper) IterateProposals(ctx sdk.Context, cb func(proposal v1beta1. } // GetProposals returns all the proposals from store -func (keeper Keeper) GetProposals(ctx sdk.Context) (proposals v1beta1.Proposals) { - keeper.IterateProposals(ctx, func(proposal v1beta1.Proposal) bool { +func (keeper Keeper) GetProposals(ctx sdk.Context) (proposals types.Proposals) { + keeper.IterateProposals(ctx, func(proposal types.Proposal) bool { proposals = append(proposals, proposal) return false }) @@ -137,15 +145,15 @@ func (keeper Keeper) GetProposals(ctx sdk.Context) (proposals v1beta1.Proposals) // // NOTE: If no filters are provided, all proposals will be returned in paginated // form. -func (keeper Keeper) GetProposalsFiltered(ctx sdk.Context, params v1beta1.QueryProposalsParams) v1beta1.Proposals { +func (keeper Keeper) GetProposalsFiltered(ctx sdk.Context, params types.QueryProposalsParams) types.Proposals { proposals := keeper.GetProposals(ctx) - filteredProposals := make([]v1beta1.Proposal, 0, len(proposals)) + filteredProposals := make([]types.Proposal, 0, len(proposals)) for _, p := range proposals { matchVoter, matchDepositor, matchStatus := true, true, true // match status (if supplied/valid) - if v1beta1.ValidProposalStatus(params.ProposalStatus) { + if types.ValidProposalStatus(params.ProposalStatus) { matchStatus = p.Status == params.ProposalStatus } @@ -166,7 +174,7 @@ func (keeper Keeper) GetProposalsFiltered(ctx sdk.Context, params v1beta1.QueryP start, end := client.Paginate(len(filteredProposals), params.Page, params.Limit, 100) if start < 0 || end < 0 { - filteredProposals = []v1beta1.Proposal{} + filteredProposals = []types.Proposal{} } else { filteredProposals = filteredProposals[start:end] } @@ -192,18 +200,20 @@ func (keeper Keeper) SetProposalID(ctx sdk.Context, proposalID uint64) { store.Set(types.ProposalIDKey, types.GetProposalIDBytes(proposalID)) } -func (keeper Keeper) ActivateVotingPeriod(ctx sdk.Context, proposal v1beta1.Proposal) { - proposal.VotingStartTime = ctx.BlockHeader().Time +func (keeper Keeper) ActivateVotingPeriod(ctx sdk.Context, proposal types.Proposal) { + startTime := ctx.BlockHeader().Time + proposal.VotingStartTime = &startTime votingPeriod := keeper.GetVotingParams(ctx).VotingPeriod - proposal.VotingEndTime = proposal.VotingStartTime.Add(votingPeriod) - proposal.Status = v1beta1.StatusVotingPeriod + endTime := proposal.VotingStartTime.Add(*votingPeriod) + proposal.VotingEndTime = &endTime + proposal.Status = types.StatusVotingPeriod keeper.SetProposal(ctx, proposal) - keeper.RemoveFromInactiveProposalQueue(ctx, proposal.ProposalId, proposal.DepositEndTime) - keeper.InsertActiveProposalQueue(ctx, proposal.ProposalId, proposal.VotingEndTime) + keeper.RemoveFromInactiveProposalQueue(ctx, proposal.ProposalId, *proposal.DepositEndTime) + keeper.InsertActiveProposalQueue(ctx, proposal.ProposalId, *proposal.VotingEndTime) } -func (keeper Keeper) MarshalProposal(proposal v1beta1.Proposal) ([]byte, error) { +func (keeper Keeper) MarshalProposal(proposal types.Proposal) ([]byte, error) { bz, err := keeper.cdc.Marshal(&proposal) if err != nil { return nil, err @@ -211,10 +221,23 @@ func (keeper Keeper) MarshalProposal(proposal v1beta1.Proposal) ([]byte, error) return bz, nil } -func (keeper Keeper) UnmarshalProposal(bz []byte, proposal *v1beta1.Proposal) error { +func (keeper Keeper) UnmarshalProposal(bz []byte, proposal *types.Proposal) error { err := keeper.cdc.Unmarshal(bz, proposal) if err != nil { return err } return nil } + +func NewContentProposal(content v1beta1.Content, authority string) (*types.MsgContent, error) { + msg, ok := content.(proto.Message) + if !ok { + return nil, fmt.Errorf("%T does not implement proto.Message", content) + } + + any, err := codec.NewAnyWithValue(msg) + if err != nil { + return nil, err + } + return types.NewMsgContent(any, authority), nil +} diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index 9e22a42f541f..ac635b993c18 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -7,6 +7,7 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -20,7 +21,7 @@ func (suite *KeeperTestSuite) TestGetSetProposal() { gotProposal, ok := suite.app.GovKeeper.GetProposal(suite.ctx, proposalID) suite.Require().True(ok) - suite.Require().True(proposal.Equal(gotProposal)) + suite.Require().Equal(proposal, gotProposal) } func (suite *KeeperTestSuite) TestActivateVotingPeriod() { @@ -37,7 +38,7 @@ func (suite *KeeperTestSuite) TestActivateVotingPeriod() { proposal, ok := suite.app.GovKeeper.GetProposal(suite.ctx, proposal.ProposalId) suite.Require().True(ok) - activeIterator := suite.app.GovKeeper.ActiveProposalQueueIterator(suite.ctx, proposal.VotingEndTime) + activeIterator := suite.app.GovKeeper.ActiveProposalQueueIterator(suite.ctx, *proposal.VotingEndTime) suite.Require().True(activeIterator.Valid()) proposalID := types.GetProposalIDFromBytes(activeIterator.Value()) @@ -65,27 +66,29 @@ func (suite *KeeperTestSuite) TestSubmitProposal() { } for i, tc := range testCases { - _, err := suite.app.GovKeeper.SubmitProposal(suite.ctx, tc.content) + prop, err := keeper.NewContentProposal(tc.content, suite.app.GovKeeper.GetGovernanceAccount(suite.ctx).GetAddress().String()) + suite.Require().NoError(err) + _, err = suite.app.GovKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}) suite.Require().True(errors.Is(tc.expectedErr, err), "tc #%d; got: %v, expected: %v", i, err, tc.expectedErr) } } func (suite *KeeperTestSuite) TestGetProposalsFiltered() { proposalID := uint64(1) - status := []v1beta1.ProposalStatus{v1beta1.StatusDepositPeriod, v1beta1.StatusVotingPeriod} + status := []types.ProposalStatus{types.StatusDepositPeriod, types.StatusVotingPeriod} addr1 := sdk.AccAddress("foo_________________") for _, s := range status { for i := 0; i < 50; i++ { - p, err := v1beta1.NewProposal(TestProposal, proposalID, time.Now(), time.Now()) + p, err := types.NewProposal(TestProposal, proposalID, time.Now(), time.Now()) suite.Require().NoError(err) p.Status = s if i%2 == 0 { - d := v1beta1.NewDeposit(proposalID, addr1, nil) - v := v1beta1.NewVote(proposalID, addr1, v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)) + d := types.NewDeposit(proposalID, addr1, nil) + v := types.NewVote(proposalID, addr1, types.NewNonSplitVoteOption(types.OptionYes)) suite.app.GovKeeper.SetDeposit(suite.ctx, d) suite.app.GovKeeper.SetVote(suite.ctx, v) } @@ -96,21 +99,21 @@ func (suite *KeeperTestSuite) TestGetProposalsFiltered() { } testCases := []struct { - params v1beta1.QueryProposalsParams + params types.QueryProposalsParams expectedNumResults int }{ - {v1beta1.NewQueryProposalsParams(1, 50, v1beta1.StatusNil, nil, nil), 50}, - {v1beta1.NewQueryProposalsParams(1, 50, v1beta1.StatusDepositPeriod, nil, nil), 50}, - {v1beta1.NewQueryProposalsParams(1, 50, v1beta1.StatusVotingPeriod, nil, nil), 50}, - {v1beta1.NewQueryProposalsParams(1, 25, v1beta1.StatusNil, nil, nil), 25}, - {v1beta1.NewQueryProposalsParams(2, 25, v1beta1.StatusNil, nil, nil), 25}, - {v1beta1.NewQueryProposalsParams(1, 50, v1beta1.StatusRejected, nil, nil), 0}, - {v1beta1.NewQueryProposalsParams(1, 50, v1beta1.StatusNil, addr1, nil), 50}, - {v1beta1.NewQueryProposalsParams(1, 50, v1beta1.StatusNil, nil, addr1), 50}, - {v1beta1.NewQueryProposalsParams(1, 50, v1beta1.StatusNil, addr1, addr1), 50}, - {v1beta1.NewQueryProposalsParams(1, 50, v1beta1.StatusDepositPeriod, addr1, addr1), 25}, - {v1beta1.NewQueryProposalsParams(1, 50, v1beta1.StatusDepositPeriod, nil, nil), 50}, - {v1beta1.NewQueryProposalsParams(1, 50, v1beta1.StatusVotingPeriod, nil, nil), 50}, + {types.NewQueryProposalsParams(1, 50, types.StatusNil, nil, nil), 50}, + {types.NewQueryProposalsParams(1, 50, types.StatusDepositPeriod, nil, nil), 50}, + {types.NewQueryProposalsParams(1, 50, types.StatusVotingPeriod, nil, nil), 50}, + {types.NewQueryProposalsParams(1, 25, types.StatusNil, nil, nil), 25}, + {types.NewQueryProposalsParams(2, 25, types.StatusNil, nil, nil), 25}, + {types.NewQueryProposalsParams(1, 50, types.StatusRejected, nil, nil), 0}, + {types.NewQueryProposalsParams(1, 50, types.StatusNil, addr1, nil), 50}, + {types.NewQueryProposalsParams(1, 50, types.StatusNil, nil, addr1), 50}, + {types.NewQueryProposalsParams(1, 50, types.StatusNil, addr1, addr1), 50}, + {types.NewQueryProposalsParams(1, 50, types.StatusDepositPeriod, addr1, addr1), 25}, + {types.NewQueryProposalsParams(1, 50, types.StatusDepositPeriod, nil, nil), 50}, + {types.NewQueryProposalsParams(1, 50, types.StatusVotingPeriod, nil, nil), 50}, } for i, tc := range testCases { @@ -119,7 +122,7 @@ func (suite *KeeperTestSuite) TestGetProposalsFiltered() { suite.Require().Len(proposals, tc.expectedNumResults) for _, p := range proposals { - if v1beta1.ValidProposalStatus(tc.params.ProposalStatus) { + if types.ValidProposalStatus(tc.params.ProposalStatus) { suite.Require().Equal(tc.params.ProposalStatus, p.Status) } } diff --git a/x/gov/keeper/querier.go b/x/gov/keeper/querier.go index ff37b1184240..d0bcae574b98 100644 --- a/x/gov/keeper/querier.go +++ b/x/gov/keeper/querier.go @@ -8,7 +8,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // NewQuerier creates a new gov Querier instance @@ -138,7 +137,7 @@ func queryDeposits(ctx sdk.Context, path []string, req abci.RequestQuery, keeper deposits := keeper.GetDeposits(ctx, params.ProposalID) if deposits == nil { - deposits = v1beta1.Deposits{} + deposits = types.Deposits{} } bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, deposits) @@ -164,14 +163,14 @@ func queryTally(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Ke return nil, sdkerrors.Wrapf(types.ErrUnknownProposal, "%d", proposalID) } - var tallyResult v1beta1.TallyResult + var tallyResult types.TallyResult switch { - case proposal.Status == v1beta1.StatusDepositPeriod: - tallyResult = v1beta1.EmptyTallyResult() + case proposal.Status == types.StatusDepositPeriod: + tallyResult = types.EmptyTallyResult() - case proposal.Status == v1beta1.StatusPassed || proposal.Status == v1beta1.StatusRejected: - tallyResult = proposal.FinalTallyResult + case proposal.Status == types.StatusPassed || proposal.Status == types.StatusRejected: + tallyResult = *proposal.FinalTallyResult default: // proposal is in voting period @@ -188,7 +187,7 @@ func queryTally(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Ke // nolint: unparam func queryVotes(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params v1beta1.QueryProposalVotesParams + var params types.QueryProposalVotesParams err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) if err != nil { return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) @@ -196,11 +195,11 @@ func queryVotes(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Ke votes := keeper.GetVotes(ctx, params.ProposalID) if votes == nil { - votes = v1beta1.Votes{} + votes = types.Votes{} } else { start, end := client.Paginate(len(votes), params.Page, params.Limit, 100) if start < 0 || end < 0 { - votes = v1beta1.Votes{} + votes = types.Votes{} } else { votes = votes[start:end] } @@ -215,7 +214,7 @@ func queryVotes(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Ke } func queryProposals(ctx sdk.Context, _ []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { - var params v1beta1.QueryProposalsParams + var params types.QueryProposalsParams err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms) if err != nil { return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) @@ -223,7 +222,7 @@ func queryProposals(ctx sdk.Context, _ []string, req abci.RequestQuery, keeper K proposals := keeper.GetProposalsFiltered(ctx, params) if proposals == nil { - proposals = v1beta1.Proposals{} + proposals = types.Proposals{} } bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, proposals) diff --git a/x/gov/keeper/querier_test.go b/x/gov/keeper/querier_test.go index 6b8cab612df2..1df0f0556f8c 100644 --- a/x/gov/keeper/querier_test.go +++ b/x/gov/keeper/querier_test.go @@ -15,46 +15,45 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) const custom = "custom" -func getQueriedParams(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier) (v1beta1.DepositParams, v1beta1.VotingParams, v1beta1.TallyParams) { +func getQueriedParams(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier) (types.DepositParams, types.VotingParams, types.TallyParams) { query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, v1beta1.QueryParams, v1beta1.ParamDeposit}, "/"), + Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryParams, types.ParamDeposit}, "/"), Data: []byte{}, } - bz, err := querier(ctx, []string{v1beta1.QueryParams, v1beta1.ParamDeposit}, query) + bz, err := querier(ctx, []string{types.QueryParams, types.ParamDeposit}, query) require.NoError(t, err) require.NotNil(t, bz) - var depositParams v1beta1.DepositParams + var depositParams types.DepositParams require.NoError(t, cdc.UnmarshalJSON(bz, &depositParams)) query = abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, v1beta1.QueryParams, v1beta1.ParamVoting}, "/"), + Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryParams, types.ParamVoting}, "/"), Data: []byte{}, } - bz, err = querier(ctx, []string{v1beta1.QueryParams, v1beta1.ParamVoting}, query) + bz, err = querier(ctx, []string{types.QueryParams, types.ParamVoting}, query) require.NoError(t, err) require.NotNil(t, bz) - var votingParams v1beta1.VotingParams + var votingParams types.VotingParams require.NoError(t, cdc.UnmarshalJSON(bz, &votingParams)) query = abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, v1beta1.QueryParams, v1beta1.ParamTallying}, "/"), + Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryParams, types.ParamTallying}, "/"), Data: []byte{}, } - bz, err = querier(ctx, []string{v1beta1.QueryParams, v1beta1.ParamTallying}, query) + bz, err = querier(ctx, []string{types.QueryParams, types.ParamTallying}, query) require.NoError(t, err) require.NotNil(t, bz) - var tallyParams v1beta1.TallyParams + var tallyParams types.TallyParams require.NoError(t, cdc.UnmarshalJSON(bz, &tallyParams)) return depositParams, votingParams, tallyParams @@ -62,84 +61,84 @@ func getQueriedParams(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, que func getQueriedProposals( t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier, - depositor, voter sdk.AccAddress, status v1beta1.ProposalStatus, page, limit int, -) []v1beta1.Proposal { + depositor, voter sdk.AccAddress, status types.ProposalStatus, page, limit int, +) []types.Proposal { query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, v1beta1.QueryProposals}, "/"), - Data: cdc.MustMarshalJSON(v1beta1.NewQueryProposalsParams(page, limit, status, voter, depositor)), + Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryProposals}, "/"), + Data: cdc.MustMarshalJSON(types.NewQueryProposalsParams(page, limit, status, voter, depositor)), } - bz, err := querier(ctx, []string{v1beta1.QueryProposals}, query) + bz, err := querier(ctx, []string{types.QueryProposals}, query) require.NoError(t, err) require.NotNil(t, bz) - var proposals v1beta1.Proposals + var proposals types.Proposals require.NoError(t, cdc.UnmarshalJSON(bz, &proposals)) return proposals } -func getQueriedDeposit(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier, proposalID uint64, depositor sdk.AccAddress) v1beta1.Deposit { +func getQueriedDeposit(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier, proposalID uint64, depositor sdk.AccAddress) types.Deposit { query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, v1beta1.QueryDeposit}, "/"), - Data: cdc.MustMarshalJSON(v1beta1.NewQueryDepositParams(proposalID, depositor)), + Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryDeposit}, "/"), + Data: cdc.MustMarshalJSON(types.NewQueryDepositParams(proposalID, depositor)), } - bz, err := querier(ctx, []string{v1beta1.QueryDeposit}, query) + bz, err := querier(ctx, []string{types.QueryDeposit}, query) require.NoError(t, err) require.NotNil(t, bz) - var deposit v1beta1.Deposit + var deposit types.Deposit require.NoError(t, cdc.UnmarshalJSON(bz, &deposit)) return deposit } -func getQueriedDeposits(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier, proposalID uint64) []v1beta1.Deposit { +func getQueriedDeposits(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier, proposalID uint64) []types.Deposit { query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, v1beta1.QueryDeposits}, "/"), - Data: cdc.MustMarshalJSON(v1beta1.NewQueryProposalParams(proposalID)), + Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryDeposits}, "/"), + Data: cdc.MustMarshalJSON(types.NewQueryProposalParams(proposalID)), } - bz, err := querier(ctx, []string{v1beta1.QueryDeposits}, query) + bz, err := querier(ctx, []string{types.QueryDeposits}, query) require.NoError(t, err) require.NotNil(t, bz) - var deposits []v1beta1.Deposit + var deposits []types.Deposit require.NoError(t, cdc.UnmarshalJSON(bz, &deposits)) return deposits } -func getQueriedVote(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier, proposalID uint64, voter sdk.AccAddress) v1beta1.Vote { +func getQueriedVote(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier, proposalID uint64, voter sdk.AccAddress) types.Vote { query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, v1beta1.QueryVote}, "/"), - Data: cdc.MustMarshalJSON(v1beta1.NewQueryVoteParams(proposalID, voter)), + Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryVote}, "/"), + Data: cdc.MustMarshalJSON(types.NewQueryVoteParams(proposalID, voter)), } - bz, err := querier(ctx, []string{v1beta1.QueryVote}, query) + bz, err := querier(ctx, []string{types.QueryVote}, query) require.NoError(t, err) require.NotNil(t, bz) - var vote v1beta1.Vote + var vote types.Vote require.NoError(t, cdc.UnmarshalJSON(bz, &vote)) return vote } func getQueriedVotes(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier, - proposalID uint64, page, limit int) []v1beta1.Vote { + proposalID uint64, page, limit int) []types.Vote { query := abci.RequestQuery{ - Path: strings.Join([]string{custom, types.QuerierRoute, v1beta1.QueryVote}, "/"), - Data: cdc.MustMarshalJSON(v1beta1.NewQueryProposalVotesParams(proposalID, page, limit)), + Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryVote}, "/"), + Data: cdc.MustMarshalJSON(types.NewQueryProposalVotesParams(proposalID, page, limit)), } - bz, err := querier(ctx, []string{v1beta1.QueryVotes}, query) + bz, err := querier(ctx, []string{types.QueryVotes}, query) require.NoError(t, err) require.NotNil(t, bz) - var votes []v1beta1.Vote + var votes []types.Vote require.NoError(t, cdc.UnmarshalJSON(bz, &votes)) return votes @@ -163,58 +162,60 @@ func TestQueries(t *testing.T) { // TestAddrs[0] proposes (and deposits) proposals #1 and #2 proposal1, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) - deposit1 := v1beta1.NewDeposit(proposal1.ProposalId, TestAddrs[0], oneCoins) + deposit1 := types.NewDeposit(proposal1.ProposalId, TestAddrs[0], oneCoins) depositer1, err := sdk.AccAddressFromBech32(deposit1.Depositor) require.NoError(t, err) _, err = app.GovKeeper.AddDeposit(ctx, deposit1.ProposalId, depositer1, deposit1.Amount) require.NoError(t, err) - proposal1.TotalDeposit = proposal1.TotalDeposit.Add(deposit1.Amount...) + proposal1.TotalDeposit = sdk.NewCoins(proposal1.TotalDeposit...).Add(deposit1.Amount...) proposal2, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) - deposit2 := v1beta1.NewDeposit(proposal2.ProposalId, TestAddrs[0], consCoins) + deposit2 := types.NewDeposit(proposal2.ProposalId, TestAddrs[0], consCoins) depositer2, err := sdk.AccAddressFromBech32(deposit2.Depositor) require.NoError(t, err) _, err = app.GovKeeper.AddDeposit(ctx, deposit2.ProposalId, depositer2, deposit2.Amount) require.NoError(t, err) - proposal2.TotalDeposit = proposal2.TotalDeposit.Add(deposit2.Amount...) + proposal2.TotalDeposit = sdk.NewCoins(proposal2.TotalDeposit...).Add(deposit2.Amount...) // TestAddrs[1] proposes (and deposits) on proposal #3 proposal3, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) - deposit3 := v1beta1.NewDeposit(proposal3.ProposalId, TestAddrs[1], oneCoins) + deposit3 := types.NewDeposit(proposal3.ProposalId, TestAddrs[1], oneCoins) depositer3, err := sdk.AccAddressFromBech32(deposit3.Depositor) require.NoError(t, err) _, err = app.GovKeeper.AddDeposit(ctx, deposit3.ProposalId, depositer3, deposit3.Amount) require.NoError(t, err) - proposal3.TotalDeposit = proposal3.TotalDeposit.Add(deposit3.Amount...) + proposal3.TotalDeposit = sdk.NewCoins(proposal3.TotalDeposit...).Add(deposit3.Amount...) // TestAddrs[1] deposits on proposals #2 & #3 - deposit4 := v1beta1.NewDeposit(proposal2.ProposalId, TestAddrs[1], depositParams.MinDeposit) + deposit4 := types.NewDeposit(proposal2.ProposalId, TestAddrs[1], depositParams.MinDeposit) depositer4, err := sdk.AccAddressFromBech32(deposit4.Depositor) require.NoError(t, err) _, err = app.GovKeeper.AddDeposit(ctx, deposit4.ProposalId, depositer4, deposit4.Amount) require.NoError(t, err) - proposal2.TotalDeposit = proposal2.TotalDeposit.Add(deposit4.Amount...) - proposal2.Status = v1beta1.StatusVotingPeriod - proposal2.VotingEndTime = proposal2.VotingEndTime.Add(types.DefaultPeriod) + proposal2.TotalDeposit = sdk.NewCoins(proposal2.TotalDeposit...).Add(deposit4.Amount...) + proposal2.Status = types.StatusVotingPeriod + endTime := proposal2.VotingEndTime.Add(types.DefaultPeriod) + proposal2.VotingEndTime = &endTime - deposit5 := v1beta1.NewDeposit(proposal3.ProposalId, TestAddrs[1], depositParams.MinDeposit) + deposit5 := types.NewDeposit(proposal3.ProposalId, TestAddrs[1], depositParams.MinDeposit) depositer5, err := sdk.AccAddressFromBech32(deposit5.Depositor) require.NoError(t, err) _, err = app.GovKeeper.AddDeposit(ctx, deposit5.ProposalId, depositer5, deposit5.Amount) require.NoError(t, err) - proposal3.TotalDeposit = proposal3.TotalDeposit.Add(deposit5.Amount...) - proposal3.Status = v1beta1.StatusVotingPeriod - proposal3.VotingEndTime = proposal3.VotingEndTime.Add(types.DefaultPeriod) + proposal3.TotalDeposit = sdk.NewCoins(proposal3.TotalDeposit...).Add(deposit5.Amount...) + proposal3.Status = types.StatusVotingPeriod + proposal3EndTime := proposal3.VotingEndTime.Add(types.DefaultPeriod) + proposal3.VotingEndTime = &proposal3EndTime // total deposit of TestAddrs[1] on proposal #3 is worth the proposal deposit + individual deposit - deposit5.Amount = deposit5.Amount.Add(deposit3.Amount...) + deposit5.Amount = sdk.NewCoins(deposit5.Amount...).Add(deposit3.Amount...) // check deposits on proposal1 match individual deposits @@ -240,33 +241,33 @@ func TestQueries(t *testing.T) { deposit = getQueriedDeposit(t, ctx, legacyQuerierCdc, querier, proposal3.ProposalId, TestAddrs[1]) require.Equal(t, deposit5, deposit) - // Only proposal #1 should be in v1beta1.Deposit Period - proposals := getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, nil, v1beta1.StatusDepositPeriod, 1, 0) + // Only proposal #1 should be in types.Deposit Period + proposals := getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, nil, types.StatusDepositPeriod, 1, 0) require.Len(t, proposals, 1) require.Equal(t, proposal1, proposals[0]) // Only proposals #2 and #3 should be in Voting Period - proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, nil, v1beta1.StatusVotingPeriod, 1, 0) + proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, nil, types.StatusVotingPeriod, 1, 0) require.Len(t, proposals, 2) require.Equal(t, proposal2, proposals[0]) require.Equal(t, proposal3, proposals[1]) // Addrs[0] votes on proposals #2 & #3 - vote1 := v1beta1.NewVote(proposal2.ProposalId, TestAddrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)) - vote2 := v1beta1.NewVote(proposal3.ProposalId, TestAddrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)) + vote1 := types.NewVote(proposal2.ProposalId, TestAddrs[0], types.NewNonSplitVoteOption(types.OptionYes)) + vote2 := types.NewVote(proposal3.ProposalId, TestAddrs[0], types.NewNonSplitVoteOption(types.OptionYes)) app.GovKeeper.SetVote(ctx, vote1) app.GovKeeper.SetVote(ctx, vote2) // Addrs[1] votes on proposal #3 - vote3 := v1beta1.NewVote(proposal3.ProposalId, TestAddrs[1], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)) + vote3 := types.NewVote(proposal3.ProposalId, TestAddrs[1], types.NewNonSplitVoteOption(types.OptionYes)) app.GovKeeper.SetVote(ctx, vote3) // Test query voted by TestAddrs[0] - proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, TestAddrs[0], v1beta1.StatusNil, 1, 0) + proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, TestAddrs[0], types.StatusNil, 1, 0) require.Equal(t, proposal2, proposals[0]) require.Equal(t, proposal3, proposals[1]) - // Test query votes on v1beta1.Proposal 2 + // Test query votes on types.Proposal 2 votes := getQueriedVotes(t, ctx, legacyQuerierCdc, querier, proposal2.ProposalId, 1, 0) require.Len(t, votes, 1) checkEqualVotes(t, vote1, votes[0]) @@ -274,33 +275,33 @@ func TestQueries(t *testing.T) { vote := getQueriedVote(t, ctx, legacyQuerierCdc, querier, proposal2.ProposalId, TestAddrs[0]) checkEqualVotes(t, vote1, vote) - // Test query votes on v1beta1.Proposal 3 + // Test query votes on types.Proposal 3 votes = getQueriedVotes(t, ctx, legacyQuerierCdc, querier, proposal3.ProposalId, 1, 0) require.Len(t, votes, 2) checkEqualVotes(t, vote2, votes[0]) checkEqualVotes(t, vote3, votes[1]) // Test query all proposals - proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, nil, v1beta1.StatusNil, 1, 0) + proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, nil, types.StatusNil, 1, 0) require.Equal(t, proposal1, proposals[0]) require.Equal(t, proposal2, proposals[1]) require.Equal(t, proposal3, proposals[2]) // Test query voted by TestAddrs[1] - proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, TestAddrs[1], v1beta1.StatusNil, 1, 0) + proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, TestAddrs[1], types.StatusNil, 1, 0) require.Equal(t, proposal3.ProposalId, proposals[0].ProposalId) // Test query deposited by TestAddrs[0] - proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, TestAddrs[0], nil, v1beta1.StatusNil, 1, 0) + proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, TestAddrs[0], nil, types.StatusNil, 1, 0) require.Equal(t, proposal1.ProposalId, proposals[0].ProposalId) // Test query deposited by addr2 - proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, TestAddrs[1], nil, v1beta1.StatusNil, 1, 0) + proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, TestAddrs[1], nil, types.StatusNil, 1, 0) require.Equal(t, proposal2.ProposalId, proposals[0].ProposalId) require.Equal(t, proposal3.ProposalId, proposals[1].ProposalId) // Test query voted AND deposited by addr1 - proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, TestAddrs[0], TestAddrs[0], v1beta1.StatusNil, 1, 0) + proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, TestAddrs[0], TestAddrs[0], types.StatusNil, 1, 0) require.Equal(t, proposal2.ProposalId, proposals[0].ProposalId) } @@ -309,14 +310,14 @@ func TestPaginatedVotesQuery(t *testing.T) { ctx := app.BaseApp.NewContext(false, tmproto.Header{}) legacyQuerierCdc := app.LegacyAmino() - proposal := v1beta1.Proposal{ + proposal := types.Proposal{ ProposalId: 100, - Status: v1beta1.StatusVotingPeriod, + Status: types.StatusVotingPeriod, } app.GovKeeper.SetProposal(ctx, proposal) - votes := make([]v1beta1.Vote, 20) + votes := make([]types.Vote, 20) random := rand.New(rand.NewSource(time.Now().UnixNano())) addrMap := make(map[string]struct{}) genAddr := func() string { @@ -331,10 +332,10 @@ func TestPaginatedVotesQuery(t *testing.T) { } } for i := range votes { - vote := v1beta1.Vote{ + vote := types.Vote{ ProposalId: proposal.ProposalId, Voter: genAddr(), - Options: v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes), + Options: types.NewNonSplitVoteOption(types.OptionYes), } votes[i] = vote app.GovKeeper.SetVote(ctx, vote) @@ -350,7 +351,7 @@ func TestPaginatedVotesQuery(t *testing.T) { description string page int limit int - votes []v1beta1.Vote + votes []types.Vote } for _, tc := range []testCase{ { @@ -391,7 +392,7 @@ func TestPaginatedVotesQuery(t *testing.T) { // When querying, the keeper populates the `vote.Option` field when there's // only 1 vote, this function checks equality of structs while skipping that // field. -func checkEqualVotes(t *testing.T, vote1, vote2 v1beta1.Vote) { +func checkEqualVotes(t *testing.T, vote1, vote2 types.Vote) { require.Equal(t, vote1.Options, vote2.Options) require.Equal(t, vote1.Voter, vote2.Voter) require.Equal(t, vote1.ProposalId, vote2.ProposalId) diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index cea608d5200c..d3b5dd70300d 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -10,30 +10,30 @@ import ( // Tally iterates over the votes and updates the tally of a proposal based on the voting power of the // voters -func (keeper Keeper) Tally(ctx sdk.Context, proposal v1beta1.Proposal) (passes bool, burnDeposits bool, tallyResults v1beta1.TallyResult) { - results := make(map[v1beta1.VoteOption]sdk.Dec) - results[v1beta1.OptionYes] = sdk.ZeroDec() - results[v1beta1.OptionAbstain] = sdk.ZeroDec() - results[v1beta1.OptionNo] = sdk.ZeroDec() - results[v1beta1.OptionNoWithVeto] = sdk.ZeroDec() +func (keeper Keeper) Tally(ctx sdk.Context, proposal types.Proposal) (passes bool, burnDeposits bool, tallyResults types.TallyResult) { + results := make(map[types.VoteOption]sdk.Dec) + results[types.OptionYes] = sdk.ZeroDec() + results[types.OptionAbstain] = sdk.ZeroDec() + results[types.OptionNo] = sdk.ZeroDec() + results[types.OptionNoWithVeto] = sdk.ZeroDec() totalVotingPower := sdk.ZeroDec() - currValidators := make(map[string]v1beta1.ValidatorGovInfo) + currValidators := make(map[string]types.ValidatorGovInfo) // fetch all the bonded validators, insert them into currValidators keeper.sk.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingtypes.ValidatorI) (stop bool) { - currValidators[validator.GetOperator().String()] = v1beta1.NewValidatorGovInfo( + currValidators[validator.GetOperator().String()] = types.NewValidatorGovInfo( validator.GetOperator(), validator.GetBondedTokens(), validator.GetDelegatorShares(), sdk.ZeroDec(), - v1beta1.WeightedVoteOptions{}, + types.WeightedVoteOptions{}, ) return false }) - keeper.IterateVotes(ctx, proposal.ProposalId, func(vote v1beta1.Vote) bool { + keeper.IterateVotes(ctx, proposal.ProposalId, func(vote types.Vote) bool { // if validator, just record it in the map voter, err := sdk.AccAddressFromBech32(vote.Voter) @@ -61,7 +61,8 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1beta1.Proposal) (passes b votingPower := delegation.GetShares().MulInt(val.BondedTokens).Quo(val.DelegatorShares) for _, option := range vote.Options { - subPower := votingPower.Mul(option.Weight) + weight, _ := sdk.NewDecFromStr(option.Weight) + subPower := votingPower.Mul(weight) results[option.Option] = results[option.Option].Add(subPower) } totalVotingPower = totalVotingPower.Add(votingPower) @@ -84,14 +85,15 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1beta1.Proposal) (passes b votingPower := sharesAfterDeductions.MulInt(val.BondedTokens).Quo(val.DelegatorShares) for _, option := range val.Vote { - subPower := votingPower.Mul(option.Weight) + weight, _ := sdk.NewDecFromStr(option.Weight) + subPower := votingPower.Mul(weight) results[option.Option] = results[option.Option].Add(subPower) } totalVotingPower = totalVotingPower.Add(votingPower) } tallyParams := keeper.GetTallyParams(ctx) - tallyResults = v1beta1.NewTallyResultFromMap(results) + tallyResults = types.NewTallyResultFromMap(results) // TODO: Upgrade the spec to cover all of these cases & remove pseudocode. // If there is no staked coins, the proposal fails @@ -101,22 +103,25 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1beta1.Proposal) (passes b // If there is not enough quorum of votes, the proposal fails percentVoting := totalVotingPower.Quo(keeper.sk.TotalBondedTokens(ctx).ToDec()) - if percentVoting.LT(tallyParams.Quorum) { + quorum, _ := sdk.NewDecFromStr(tallyParams.Quorum) + if percentVoting.LT(quorum) { return false, true, tallyResults } // If no one votes (everyone abstains), proposal fails - if totalVotingPower.Sub(results[v1beta1.OptionAbstain]).Equal(sdk.ZeroDec()) { + if totalVotingPower.Sub(results[types.OptionAbstain]).Equal(sdk.ZeroDec()) { return false, false, tallyResults } // If more than 1/3 of voters veto, proposal fails - if results[v1beta1.OptionNoWithVeto].Quo(totalVotingPower).GT(tallyParams.VetoThreshold) { + vetoThreshold, _ := sdk.NewDecFromStr(tallyParams.VetoThreshold) + if results[types.OptionNoWithVeto].Quo(totalVotingPower).GT(vetoThreshold) { return false, true, tallyResults } // If more than 1/2 of non-abstaining voters vote Yes, proposal passes - if results[v1beta1.OptionYes].Quo(totalVotingPower.Sub(results[v1beta1.OptionAbstain])).GT(tallyParams.Threshold) { + threshold, _ := sdk.NewDecFromStr(tallyParams.Threshold) + if results[types.OptionYes].Quo(totalVotingPower.Sub(results[types.OptionAbstain])).GT(threshold) { return true, false, tallyResults } diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index 0aef68fc0b00..3ddec4613d37 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/staking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -23,7 +23,7 @@ func TestTallyNoOneVotes(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = v1beta1.StatusVotingPeriod + proposal.Status = types.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) @@ -32,7 +32,7 @@ func TestTallyNoOneVotes(t *testing.T) { require.False(t, passes) require.True(t, burnDeposits) - require.True(t, tallyResults.Equals(v1beta1.EmptyTallyResult())) + require.True(t, tallyResults.Equals(types.EmptyTallyResult())) } func TestTallyNoQuorum(t *testing.T) { @@ -47,10 +47,10 @@ func TestTallyNoQuorum(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = v1beta1.StatusVotingPeriod + proposal.Status = types.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - err = app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)) + err = app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionYes)) require.Nil(t, err) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) @@ -70,12 +70,12 @@ func TestTallyOnlyValidatorsAllYes(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = v1beta1.StatusVotingPeriod + proposal.Status = types.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], types.NewNonSplitVoteOption(types.OptionYes))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -83,7 +83,7 @@ func TestTallyOnlyValidatorsAllYes(t *testing.T) { require.True(t, passes) require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(v1beta1.EmptyTallyResult())) + require.False(t, tallyResults.Equals(types.EmptyTallyResult())) } func TestTallyOnlyValidators51No(t *testing.T) { @@ -96,11 +96,11 @@ func TestTallyOnlyValidators51No(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = v1beta1.StatusVotingPeriod + proposal.Status = types.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[1], v1beta1.NewNonSplitVoteOption(v1beta1.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[0], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[1], types.NewNonSplitVoteOption(types.OptionNo))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -120,11 +120,11 @@ func TestTallyOnlyValidators51Yes(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = v1beta1.StatusVotingPeriod + proposal.Status = types.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionNo))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[1], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[0], types.NewNonSplitVoteOption(types.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[1], types.NewNonSplitVoteOption(types.OptionYes))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -132,7 +132,7 @@ func TestTallyOnlyValidators51Yes(t *testing.T) { require.True(t, passes) require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(v1beta1.EmptyTallyResult())) + require.False(t, tallyResults.Equals(types.EmptyTallyResult())) } func TestTallyOnlyValidatorsVetoed(t *testing.T) { @@ -145,12 +145,12 @@ func TestTallyOnlyValidatorsVetoed(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = v1beta1.StatusVotingPeriod + proposal.Status = types.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[1], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[2], v1beta1.NewNonSplitVoteOption(v1beta1.OptionNoWithVeto))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[0], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[1], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[2], types.NewNonSplitVoteOption(types.OptionNoWithVeto))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -158,7 +158,7 @@ func TestTallyOnlyValidatorsVetoed(t *testing.T) { require.False(t, passes) require.True(t, burnDeposits) - require.False(t, tallyResults.Equals(v1beta1.EmptyTallyResult())) + require.False(t, tallyResults.Equals(types.EmptyTallyResult())) } func TestTallyOnlyValidatorsAbstainPasses(t *testing.T) { @@ -171,12 +171,12 @@ func TestTallyOnlyValidatorsAbstainPasses(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = v1beta1.StatusVotingPeriod + proposal.Status = types.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionAbstain))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[1], v1beta1.NewNonSplitVoteOption(v1beta1.OptionNo))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[2], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[0], types.NewNonSplitVoteOption(types.OptionAbstain))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[1], types.NewNonSplitVoteOption(types.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[2], types.NewNonSplitVoteOption(types.OptionYes))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -184,7 +184,7 @@ func TestTallyOnlyValidatorsAbstainPasses(t *testing.T) { require.True(t, passes) require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(v1beta1.EmptyTallyResult())) + require.False(t, tallyResults.Equals(types.EmptyTallyResult())) } func TestTallyOnlyValidatorsAbstainFails(t *testing.T) { @@ -197,12 +197,12 @@ func TestTallyOnlyValidatorsAbstainFails(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = v1beta1.StatusVotingPeriod + proposal.Status = types.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionAbstain))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[1], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[2], v1beta1.NewNonSplitVoteOption(v1beta1.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[0], types.NewNonSplitVoteOption(types.OptionAbstain))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[1], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[2], types.NewNonSplitVoteOption(types.OptionNo))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -210,7 +210,7 @@ func TestTallyOnlyValidatorsAbstainFails(t *testing.T) { require.False(t, passes) require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(v1beta1.EmptyTallyResult())) + require.False(t, tallyResults.Equals(types.EmptyTallyResult())) } func TestTallyOnlyValidatorsNonVoter(t *testing.T) { @@ -224,11 +224,11 @@ func TestTallyOnlyValidatorsNonVoter(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = v1beta1.StatusVotingPeriod + proposal.Status = types.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddr1, v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddr2, v1beta1.NewNonSplitVoteOption(v1beta1.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddr1, types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddr2, types.NewNonSplitVoteOption(types.OptionNo))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -236,7 +236,7 @@ func TestTallyOnlyValidatorsNonVoter(t *testing.T) { require.False(t, passes) require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(v1beta1.EmptyTallyResult())) + require.False(t, tallyResults.Equals(types.EmptyTallyResult())) } func TestTallyDelgatorOverride(t *testing.T) { @@ -258,13 +258,13 @@ func TestTallyDelgatorOverride(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = v1beta1.StatusVotingPeriod + proposal.Status = types.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[3], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[4], v1beta1.NewNonSplitVoteOption(v1beta1.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[3], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[4], types.NewNonSplitVoteOption(types.OptionNo))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -272,7 +272,7 @@ func TestTallyDelgatorOverride(t *testing.T) { require.False(t, passes) require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(v1beta1.EmptyTallyResult())) + require.False(t, tallyResults.Equals(types.EmptyTallyResult())) } func TestTallyDelgatorInherit(t *testing.T) { @@ -294,12 +294,12 @@ func TestTallyDelgatorInherit(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = v1beta1.StatusVotingPeriod + proposal.Status = types.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionNo))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], v1beta1.NewNonSplitVoteOption(v1beta1.OptionNo))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], types.NewNonSplitVoteOption(types.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], types.NewNonSplitVoteOption(types.OptionYes))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -307,7 +307,7 @@ func TestTallyDelgatorInherit(t *testing.T) { require.True(t, passes) require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(v1beta1.EmptyTallyResult())) + require.False(t, tallyResults.Equals(types.EmptyTallyResult())) } func TestTallyDelgatorMultipleOverride(t *testing.T) { @@ -333,13 +333,13 @@ func TestTallyDelgatorMultipleOverride(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = v1beta1.StatusVotingPeriod + proposal.Status = types.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[3], v1beta1.NewNonSplitVoteOption(v1beta1.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[3], types.NewNonSplitVoteOption(types.OptionNo))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -347,7 +347,7 @@ func TestTallyDelgatorMultipleOverride(t *testing.T) { require.False(t, passes) require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(v1beta1.EmptyTallyResult())) + require.False(t, tallyResults.Equals(types.EmptyTallyResult())) } func TestTallyDelgatorMultipleInherit(t *testing.T) { @@ -375,12 +375,12 @@ func TestTallyDelgatorMultipleInherit(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = v1beta1.StatusVotingPeriod + proposal.Status = types.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], v1beta1.NewNonSplitVoteOption(v1beta1.OptionNo))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], v1beta1.NewNonSplitVoteOption(v1beta1.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], types.NewNonSplitVoteOption(types.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], types.NewNonSplitVoteOption(types.OptionNo))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -388,7 +388,7 @@ func TestTallyDelgatorMultipleInherit(t *testing.T) { require.False(t, passes) require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(v1beta1.EmptyTallyResult())) + require.False(t, tallyResults.Equals(types.EmptyTallyResult())) } func TestTallyJailedValidator(t *testing.T) { @@ -418,12 +418,12 @@ func TestTallyJailedValidator(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = v1beta1.StatusVotingPeriod + proposal.Status = types.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], v1beta1.NewNonSplitVoteOption(v1beta1.OptionNo))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], v1beta1.NewNonSplitVoteOption(v1beta1.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], types.NewNonSplitVoteOption(types.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], types.NewNonSplitVoteOption(types.OptionNo))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -431,7 +431,7 @@ func TestTallyJailedValidator(t *testing.T) { require.True(t, passes) require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(v1beta1.EmptyTallyResult())) + require.False(t, tallyResults.Equals(types.EmptyTallyResult())) } func TestTallyValidatorMultipleDelegations(t *testing.T) { @@ -451,12 +451,12 @@ func TestTallyValidatorMultipleDelegations(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = v1beta1.StatusVotingPeriod + proposal.Status = types.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], v1beta1.NewNonSplitVoteOption(v1beta1.OptionNo))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], types.NewNonSplitVoteOption(types.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], types.NewNonSplitVoteOption(types.OptionYes))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -469,7 +469,7 @@ func TestTallyValidatorMultipleDelegations(t *testing.T) { expectedAbstain := app.StakingKeeper.TokensFromConsensusPower(ctx, 0) expectedNo := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) expectedNoWithVeto := app.StakingKeeper.TokensFromConsensusPower(ctx, 0) - expectedTallyResult := v1beta1.NewTallyResult(expectedYes, expectedAbstain, expectedNo, expectedNoWithVeto) + expectedTallyResult := types.NewTallyResult(expectedYes, expectedAbstain, expectedNo, expectedNoWithVeto) require.True(t, tallyResults.Equals(expectedTallyResult)) } diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index 92ff4a489474..5af762e72b72 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -6,26 +6,25 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // AddVote adds a vote on a specific proposal -func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress, options v1beta1.WeightedVoteOptions) error { +func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress, options types.WeightedVoteOptions) error { proposal, ok := keeper.GetProposal(ctx, proposalID) if !ok { return sdkerrors.Wrapf(types.ErrUnknownProposal, "%d", proposalID) } - if proposal.Status != v1beta1.StatusVotingPeriod { + if proposal.Status != types.StatusVotingPeriod { return sdkerrors.Wrapf(types.ErrInactiveProposal, "%d", proposalID) } for _, option := range options { - if !v1beta1.ValidWeightedVoteOption(option) { - return sdkerrors.Wrap(v1beta1.ErrInvalidVote, option.String()) + if !types.ValidWeightedVoteOption(*option) { + return sdkerrors.Wrap(types.ErrInvalidVote, option.String()) } } - vote := v1beta1.NewVote(proposalID, voterAddr, options) + vote := types.NewVote(proposalID, voterAddr, options) keeper.SetVote(ctx, vote) // called after a vote on a proposal is cast @@ -43,27 +42,27 @@ func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A } // GetAllVotes returns all the votes from the store -func (keeper Keeper) GetAllVotes(ctx sdk.Context) (votes v1beta1.Votes) { - keeper.IterateAllVotes(ctx, func(vote v1beta1.Vote) bool { +func (keeper Keeper) GetAllVotes(ctx sdk.Context) (votes types.Votes) { + keeper.IterateAllVotes(ctx, func(vote types.Vote) bool { populateLegacyOption(&vote) - votes = append(votes, vote) + votes = append(votes, &vote) return false }) return } // GetVotes returns all the votes from a proposal -func (keeper Keeper) GetVotes(ctx sdk.Context, proposalID uint64) (votes v1beta1.Votes) { - keeper.IterateVotes(ctx, proposalID, func(vote v1beta1.Vote) bool { +func (keeper Keeper) GetVotes(ctx sdk.Context, proposalID uint64) (votes types.Votes) { + keeper.IterateVotes(ctx, proposalID, func(vote types.Vote) bool { populateLegacyOption(&vote) - votes = append(votes, vote) + votes = append(votes, &vote) return false }) return } // GetVote gets the vote from an address on a specific proposal -func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress) (vote v1beta1.Vote, found bool) { +func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress) (vote types.Vote, found bool) { store := ctx.KVStore(keeper.storeKey) bz := store.Get(types.VoteKey(proposalID, voterAddr)) if bz == nil { @@ -77,10 +76,10 @@ func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A } // SetVote sets a Vote to the gov store -func (keeper Keeper) SetVote(ctx sdk.Context, vote v1beta1.Vote) { +func (keeper Keeper) SetVote(ctx sdk.Context, vote types.Vote) { // vote.Option is a deprecated field, we don't set it in state - if vote.Option != v1beta1.OptionEmpty { // nolint - vote.Option = v1beta1.OptionEmpty // nolint + if vote.Option != types.OptionEmpty { // nolint + vote.Option = types.OptionEmpty // nolint } store := ctx.KVStore(keeper.storeKey) @@ -93,13 +92,13 @@ func (keeper Keeper) SetVote(ctx sdk.Context, vote v1beta1.Vote) { } // IterateAllVotes iterates over the all the stored votes and performs a callback function -func (keeper Keeper) IterateAllVotes(ctx sdk.Context, cb func(vote v1beta1.Vote) (stop bool)) { +func (keeper Keeper) IterateAllVotes(ctx sdk.Context, cb func(vote types.Vote) (stop bool)) { store := ctx.KVStore(keeper.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.VotesKeyPrefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - var vote v1beta1.Vote + var vote types.Vote keeper.cdc.MustUnmarshal(iterator.Value(), &vote) populateLegacyOption(&vote) @@ -110,13 +109,13 @@ func (keeper Keeper) IterateAllVotes(ctx sdk.Context, cb func(vote v1beta1.Vote) } // IterateVotes iterates over the all the proposals votes and performs a callback function -func (keeper Keeper) IterateVotes(ctx sdk.Context, proposalID uint64, cb func(vote v1beta1.Vote) (stop bool)) { +func (keeper Keeper) IterateVotes(ctx sdk.Context, proposalID uint64, cb func(vote types.Vote) (stop bool)) { store := ctx.KVStore(keeper.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.VotesKey(proposalID)) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - var vote v1beta1.Vote + var vote types.Vote keeper.cdc.MustUnmarshal(iterator.Value(), &vote) populateLegacyOption(&vote) @@ -134,8 +133,8 @@ func (keeper Keeper) deleteVote(ctx sdk.Context, proposalID uint64, voterAddr sd // populateLegacyOption adds graceful fallback of deprecated `Option` field, in case // there's only 1 VoteOption. -func populateLegacyOption(vote *v1beta1.Vote) { - if len(vote.Options) == 1 && vote.Options[0].Weight.Equal(sdk.MustNewDecFromStr("1.0")) { +func populateLegacyOption(vote *types.Vote) { + if len(vote.Options) == 1 && vote.Options[0].Weight == "1.0" { vote.Option = vote.Options[0].Option // nolint } } diff --git a/x/gov/keeper/vote_test.go b/x/gov/keeper/vote_test.go index 61e18ae457ce..1e9c5a851674 100644 --- a/x/gov/keeper/vote_test.go +++ b/x/gov/keeper/vote_test.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types" ) func TestVotes(t *testing.T) { @@ -17,62 +17,62 @@ func TestVotes(t *testing.T) { addrs := simapp.AddTestAddrsIncremental(app, ctx, 5, sdk.NewInt(30000000)) - tp := TestProposal + tp := []sdk.Msg{} proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - var invalidOption v1beta1.VoteOption = 0x10 + var invalidOption types.VoteOption = 0x10 - require.Error(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)), "proposal not on voting period") - require.Error(t, app.GovKeeper.AddVote(ctx, 10, addrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)), "invalid proposal ID") + require.Error(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionYes)), "proposal not on voting period") + require.Error(t, app.GovKeeper.AddVote(ctx, 10, addrs[0], types.NewNonSplitVoteOption(types.OptionYes)), "invalid proposal ID") - proposal.Status = v1beta1.StatusVotingPeriod + proposal.Status = types.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.Error(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta1.NewNonSplitVoteOption(invalidOption)), "invalid option") + require.Error(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(invalidOption)), "invalid option") // Test first vote - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionAbstain))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionAbstain))) vote, found := app.GovKeeper.GetVote(ctx, proposalID, addrs[0]) require.True(t, found) require.Equal(t, addrs[0].String(), vote.Voter) require.Equal(t, proposalID, vote.ProposalId) require.True(t, len(vote.Options) == 1) - require.Equal(t, v1beta1.OptionAbstain, vote.Options[0].Option) - require.Equal(t, v1beta1.OptionAbstain, vote.Option) + require.Equal(t, types.OptionAbstain, vote.Options[0].Option) + require.Equal(t, types.OptionAbstain, vote.Option) // Test change of vote - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionYes))) vote, found = app.GovKeeper.GetVote(ctx, proposalID, addrs[0]) require.True(t, found) require.Equal(t, addrs[0].String(), vote.Voter) require.Equal(t, proposalID, vote.ProposalId) require.True(t, len(vote.Options) == 1) - require.Equal(t, v1beta1.OptionYes, vote.Options[0].Option) - require.Equal(t, v1beta1.OptionYes, vote.Option) + require.Equal(t, types.OptionYes, vote.Options[0].Option) + require.Equal(t, types.OptionYes, vote.Option) // Test second vote - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], v1beta1.WeightedVoteOptions{ - v1beta1.WeightedVoteOption{Option: v1beta1.OptionYes, Weight: sdk.NewDecWithPrec(60, 2)}, - v1beta1.WeightedVoteOption{Option: v1beta1.OptionNo, Weight: sdk.NewDecWithPrec(30, 2)}, - v1beta1.WeightedVoteOption{Option: v1beta1.OptionAbstain, Weight: sdk.NewDecWithPrec(5, 2)}, - v1beta1.WeightedVoteOption{Option: v1beta1.OptionNoWithVeto, Weight: sdk.NewDecWithPrec(5, 2)}, + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], types.WeightedVoteOptions{ + types.NewWeightedVoteOption(types.OptionYes, sdk.NewDecWithPrec(60, 2)), + types.NewWeightedVoteOption(types.OptionNo, sdk.NewDecWithPrec(30, 2)), + types.NewWeightedVoteOption(types.OptionAbstain, sdk.NewDecWithPrec(5, 2)), + types.NewWeightedVoteOption(types.OptionNoWithVeto, sdk.NewDecWithPrec(5, 2)), })) vote, found = app.GovKeeper.GetVote(ctx, proposalID, addrs[1]) require.True(t, found) require.Equal(t, addrs[1].String(), vote.Voter) require.Equal(t, proposalID, vote.ProposalId) require.True(t, len(vote.Options) == 4) - require.Equal(t, v1beta1.OptionYes, vote.Options[0].Option) - require.Equal(t, v1beta1.OptionNo, vote.Options[1].Option) - require.Equal(t, v1beta1.OptionAbstain, vote.Options[2].Option) - require.Equal(t, v1beta1.OptionNoWithVeto, vote.Options[3].Option) - require.True(t, vote.Options[0].Weight.Equal(sdk.NewDecWithPrec(60, 2))) - require.True(t, vote.Options[1].Weight.Equal(sdk.NewDecWithPrec(30, 2))) - require.True(t, vote.Options[2].Weight.Equal(sdk.NewDecWithPrec(5, 2))) - require.True(t, vote.Options[3].Weight.Equal(sdk.NewDecWithPrec(5, 2))) - require.Equal(t, v1beta1.OptionEmpty, vote.Option) + require.Equal(t, types.OptionYes, vote.Options[0].Option) + require.Equal(t, types.OptionNo, vote.Options[1].Option) + require.Equal(t, types.OptionAbstain, vote.Options[2].Option) + require.Equal(t, types.OptionNoWithVeto, vote.Options[3].Option) + require.Equal(t, vote.Options[0].Weight, sdk.NewDecWithPrec(60, 2).String()) + require.Equal(t, vote.Options[1].Weight, sdk.NewDecWithPrec(30, 2).String()) + require.Equal(t, vote.Options[2].Weight, sdk.NewDecWithPrec(5, 2).String()) + require.Equal(t, vote.Options[3].Weight, sdk.NewDecWithPrec(5, 2).String()) + require.Equal(t, types.OptionEmpty, vote.Option) // Test vote iterator // NOTE order of deposits is determined by the addresses @@ -82,13 +82,13 @@ func TestVotes(t *testing.T) { require.Equal(t, addrs[0].String(), votes[0].Voter) require.Equal(t, proposalID, votes[0].ProposalId) require.True(t, len(votes[0].Options) == 1) - require.Equal(t, v1beta1.OptionYes, votes[0].Options[0].Option) + require.Equal(t, types.OptionYes, votes[0].Options[0].Option) require.Equal(t, addrs[1].String(), votes[1].Voter) require.Equal(t, proposalID, votes[1].ProposalId) require.True(t, len(votes[1].Options) == 4) - require.True(t, votes[1].Options[0].Weight.Equal(sdk.NewDecWithPrec(60, 2))) - require.True(t, votes[1].Options[1].Weight.Equal(sdk.NewDecWithPrec(30, 2))) - require.True(t, votes[1].Options[2].Weight.Equal(sdk.NewDecWithPrec(5, 2))) - require.True(t, votes[1].Options[3].Weight.Equal(sdk.NewDecWithPrec(5, 2))) - require.Equal(t, v1beta1.OptionEmpty, vote.Option) + require.Equal(t, votes[1].Options[0].Weight, sdk.NewDecWithPrec(60, 2).String()) + require.Equal(t, votes[1].Options[1].Weight, sdk.NewDecWithPrec(30, 2).String()) + require.Equal(t, votes[1].Options[2].Weight, sdk.NewDecWithPrec(5, 2).String()) + require.Equal(t, votes[1].Options[3].Weight, sdk.NewDecWithPrec(5, 2).String()) + require.Equal(t, types.OptionEmpty, vote.Option) } diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index 7e1752b6c075..8a8772538af7 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -13,7 +13,6 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/simulation" ) @@ -126,21 +125,22 @@ func SimulateMsgSubmitProposal( // 1) submit proposal now content := contentSim(r, ctx, accs) if content == nil { - return simtypes.NoOpMsg(v1beta1.ModuleName, v1beta1.TypeMsgSubmitProposal, "content is nil"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSubmitProposal, "content is nil"), nil, nil } simAccount, _ := simtypes.RandomAcc(r, accs) deposit, skip, err := randomDeposit(r, ctx, ak, bk, k, simAccount.Address) switch { case skip: - return simtypes.NoOpMsg(v1beta1.ModuleName, v1beta1.TypeMsgSubmitProposal, "skip deposit"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSubmitProposal, "skip deposit"), nil, nil case err != nil: - return simtypes.NoOpMsg(v1beta1.ModuleName, v1beta1.TypeMsgSubmitProposal, "unable to generate deposit"), nil, err + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSubmitProposal, "unable to generate deposit"), nil, err } - msg, err := v1beta1.NewMsgSubmitProposal(content, deposit, simAccount.Address) + NewContentProposal(content, app.GovKeeper.GetGovernanceAccount().GetAddress().String()) + msg, err := types.NewMsgSubmitProposal(content, deposit, simAccount.Address) if err != nil { - return simtypes.NoOpMsg(v1beta1.ModuleName, msg.Type(), "unable to generate a submit proposal msg"), nil, err + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate a submit proposal msg"), nil, err } account := ak.GetAccount(ctx, simAccount.Address) @@ -151,7 +151,7 @@ func SimulateMsgSubmitProposal( if !hasNeg { fees, err = simtypes.RandomFees(r, ctx, coins) if err != nil { - return simtypes.NoOpMsg(v1beta1.ModuleName, msg.Type(), "unable to generate fees"), nil, err + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate fees"), nil, err } } @@ -167,12 +167,12 @@ func SimulateMsgSubmitProposal( simAccount.PrivKey, ) if err != nil { - return simtypes.NoOpMsg(v1beta1.ModuleName, msg.Type(), "unable to generate mock tx"), nil, err + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate mock tx"), nil, err } _, _, err = app.SimDeliver(txGen.TxEncoder(), tx) if err != nil { - return simtypes.NoOpMsg(v1beta1.ModuleName, msg.Type(), "unable to deliver tx"), nil, err + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to deliver tx"), nil, err } opMsg := simtypes.NewOperationMsg(msg, true, "", nil) @@ -180,7 +180,7 @@ func SimulateMsgSubmitProposal( // get the submitted proposal ID proposalID, err := k.GetProposalID(ctx) if err != nil { - return simtypes.NoOpMsg(v1beta1.ModuleName, msg.Type(), "unable to generate proposalID"), nil, err + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate proposalID"), nil, err } // 2) Schedule operations for votes @@ -215,20 +215,20 @@ func SimulateMsgDeposit(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Ke accs []simtypes.Account, chainID string, ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { simAccount, _ := simtypes.RandomAcc(r, accs) - proposalID, ok := randomProposalID(r, k, ctx, v1beta1.StatusDepositPeriod) + proposalID, ok := randomProposalID(r, k, ctx, types.StatusDepositPeriod) if !ok { - return simtypes.NoOpMsg(v1beta1.ModuleName, v1beta1.TypeMsgDeposit, "unable to generate proposalID"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgDeposit, "unable to generate proposalID"), nil, nil } deposit, skip, err := randomDeposit(r, ctx, ak, bk, k, simAccount.Address) switch { case skip: - return simtypes.NoOpMsg(v1beta1.ModuleName, v1beta1.TypeMsgDeposit, "skip deposit"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgDeposit, "skip deposit"), nil, nil case err != nil: - return simtypes.NoOpMsg(v1beta1.ModuleName, v1beta1.TypeMsgDeposit, "unable to generate deposit"), nil, err + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgDeposit, "unable to generate deposit"), nil, err } - msg := v1beta1.NewMsgDeposit(simAccount.Address, proposalID, deposit) + msg := types.NewMsgDeposit(simAccount.Address, proposalID, deposit) account := ak.GetAccount(ctx, simAccount.Address) spendable := bk.SpendableCoins(ctx, account.GetAddress()) @@ -238,7 +238,7 @@ func SimulateMsgDeposit(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Ke if !hasNeg { fees, err = simtypes.RandomFees(r, ctx, coins) if err != nil { - return simtypes.NoOpMsg(v1beta1.ModuleName, msg.Type(), "unable to generate fees"), nil, err + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate fees"), nil, err } } @@ -251,7 +251,7 @@ func SimulateMsgDeposit(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Ke Context: ctx, SimAccount: simAccount, AccountKeeper: ak, - ModuleName: v1beta1.ModuleName, + ModuleName: types.ModuleName, } return simulation.GenAndDeliverTx(txCtx, fees) @@ -278,16 +278,16 @@ func operationSimulateMsgVote(ak types.AccountKeeper, bk types.BankKeeper, k kee switch { case proposalIDInt < 0: var ok bool - proposalID, ok = randomProposalID(r, k, ctx, v1beta1.StatusVotingPeriod) + proposalID, ok = randomProposalID(r, k, ctx, types.StatusVotingPeriod) if !ok { - return simtypes.NoOpMsg(v1beta1.ModuleName, v1beta1.TypeMsgVote, "unable to generate proposalID"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgVote, "unable to generate proposalID"), nil, nil } default: proposalID = uint64(proposalIDInt) } option := randomVotingOption(r) - msg := v1beta1.NewMsgVote(simAccount.Address, proposalID, option) + msg := types.NewMsgVote(simAccount.Address, proposalID, option) account := ak.GetAccount(ctx, simAccount.Address) spendable := bk.SpendableCoins(ctx, account.GetAddress()) @@ -303,7 +303,7 @@ func operationSimulateMsgVote(ak types.AccountKeeper, bk types.BankKeeper, k kee SimAccount: simAccount, AccountKeeper: ak, Bankkeeper: bk, - ModuleName: v1beta1.ModuleName, + ModuleName: types.ModuleName, CoinsSpentInMsg: spendable, } @@ -331,16 +331,16 @@ func operationSimulateMsgVoteWeighted(ak types.AccountKeeper, bk types.BankKeepe switch { case proposalIDInt < 0: var ok bool - proposalID, ok = randomProposalID(r, k, ctx, v1beta1.StatusVotingPeriod) + proposalID, ok = randomProposalID(r, k, ctx, types.StatusVotingPeriod) if !ok { - return simtypes.NoOpMsg(v1beta1.ModuleName, v1beta1.TypeMsgVoteWeighted, "unable to generate proposalID"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgVoteWeighted, "unable to generate proposalID"), nil, nil } default: proposalID = uint64(proposalIDInt) } options := randomWeightedVotingOptions(r) - msg := v1beta1.NewMsgVoteWeighted(simAccount.Address, proposalID, options) + msg := types.NewMsgVoteWeighted(simAccount.Address, proposalID, options) account := ak.GetAccount(ctx, simAccount.Address) spendable := bk.SpendableCoins(ctx, account.GetAddress()) @@ -356,7 +356,7 @@ func operationSimulateMsgVoteWeighted(ak types.AccountKeeper, bk types.BankKeepe SimAccount: simAccount, AccountKeeper: ak, Bankkeeper: bk, - ModuleName: v1beta1.ModuleName, + ModuleName: types.ModuleName, CoinsSpentInMsg: spendable, } @@ -405,7 +405,7 @@ func randomDeposit(r *rand.Rand, ctx sdk.Context, // that matches a given Status. // It does not provide a default ID. func randomProposalID(r *rand.Rand, k keeper.Keeper, - ctx sdk.Context, status v1beta1.ProposalStatus) (proposalID uint64, found bool) { + ctx sdk.Context, status types.ProposalStatus) (proposalID uint64, found bool) { proposalID, _ = k.GetProposalID(ctx) switch { @@ -428,49 +428,49 @@ func randomProposalID(r *rand.Rand, k keeper.Keeper, } // Pick a random voting option -func randomVotingOption(r *rand.Rand) v1beta1.VoteOption { +func randomVotingOption(r *rand.Rand) types.VoteOption { switch r.Intn(4) { case 0: - return v1beta1.OptionYes + return types.OptionYes case 1: - return v1beta1.OptionAbstain + return types.OptionAbstain case 2: - return v1beta1.OptionNo + return types.OptionNo case 3: - return v1beta1.OptionNoWithVeto + return types.OptionNoWithVeto default: panic("invalid vote option") } } // Pick a random weighted voting options -func randomWeightedVotingOptions(r *rand.Rand) v1beta1.WeightedVoteOptions { +func randomWeightedVotingOptions(r *rand.Rand) types.WeightedVoteOptions { w1 := r.Intn(100 + 1) w2 := r.Intn(100 - w1 + 1) w3 := r.Intn(100 - w1 - w2 + 1) w4 := 100 - w1 - w2 - w3 - weightedVoteOptions := v1beta1.WeightedVoteOptions{} + weightedVoteOptions := types.WeightedVoteOptions{} if w1 > 0 { - weightedVoteOptions = append(weightedVoteOptions, v1beta1.WeightedVoteOption{ - Option: v1beta1.OptionYes, + weightedVoteOptions = append(weightedVoteOptions, types.WeightedVoteOption{ + Option: types.OptionYes, Weight: sdk.NewDecWithPrec(int64(w1), 2), }) } if w2 > 0 { - weightedVoteOptions = append(weightedVoteOptions, v1beta1.WeightedVoteOption{ - Option: v1beta1.OptionAbstain, + weightedVoteOptions = append(weightedVoteOptions, types.WeightedVoteOption{ + Option: types.OptionAbstain, Weight: sdk.NewDecWithPrec(int64(w2), 2), }) } if w3 > 0 { - weightedVoteOptions = append(weightedVoteOptions, v1beta1.WeightedVoteOption{ - Option: v1beta1.OptionNo, + weightedVoteOptions = append(weightedVoteOptions, types.WeightedVoteOption{ + Option: types.OptionNo, Weight: sdk.NewDecWithPrec(int64(w3), 2), }) } if w4 > 0 { - weightedVoteOptions = append(weightedVoteOptions, v1beta1.WeightedVoteOption{ - Option: v1beta1.OptionNoWithVeto, + weightedVoteOptions = append(weightedVoteOptions, types.WeightedVoteOption{ + Option: types.OptionNoWithVeto, Weight: sdk.NewDecWithPrec(int64(w4), 2), }) } diff --git a/x/gov/types/deposit.go b/x/gov/types/deposit.go index 5f106859f1d3..03fe63f801f8 100644 --- a/x/gov/types/deposit.go +++ b/x/gov/types/deposit.go @@ -13,7 +13,7 @@ func NewDeposit(proposalID uint64, depositor sdk.AccAddress, amount sdk.Coins) D } // Deposits is a collection of Deposit objects -type Deposits []Deposit +type Deposits []*Deposit // Equal returns true if two slices (order-dependant) of deposits are equal. func (d Deposits) Equal(other Deposits) bool { diff --git a/x/gov/types/gov.pb.go b/x/gov/types/gov.pb.go index 0a9ad1dac4c4..46e6696c812e 100644 --- a/x/gov/types/gov.pb.go +++ b/x/gov/types/gov.pb.go @@ -655,6 +655,59 @@ func (m *TallyParams) GetVetoThreshold() string { return "" } +// Content is used to wrap the legacy content field into a message. This ensures backwards compatibility +type MsgContent struct { + Content *types1.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` + Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (m *MsgContent) Reset() { *m = MsgContent{} } +func (m *MsgContent) String() string { return proto.CompactTextString(m) } +func (*MsgContent) ProtoMessage() {} +func (*MsgContent) Descriptor() ([]byte, []int) { + return fileDescriptor_5abf7b8852811c49, []int{8} +} +func (m *MsgContent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgContent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgContent.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 *MsgContent) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgContent.Merge(m, src) +} +func (m *MsgContent) XXX_Size() int { + return m.Size() +} +func (m *MsgContent) XXX_DiscardUnknown() { + xxx_messageInfo_MsgContent.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgContent proto.InternalMessageInfo + +func (m *MsgContent) GetContent() *types1.Any { + if m != nil { + return m.Content + } + return nil +} + +func (m *MsgContent) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + func init() { proto.RegisterEnum("cosmos.gov.v1beta2.VoteOption", VoteOption_name, VoteOption_value) proto.RegisterEnum("cosmos.gov.v1beta2.ProposalStatus", ProposalStatus_name, ProposalStatus_value) @@ -666,76 +719,80 @@ func init() { proto.RegisterType((*DepositParams)(nil), "cosmos.gov.v1beta2.DepositParams") proto.RegisterType((*VotingParams)(nil), "cosmos.gov.v1beta2.VotingParams") proto.RegisterType((*TallyParams)(nil), "cosmos.gov.v1beta2.TallyParams") + proto.RegisterType((*MsgContent)(nil), "cosmos.gov.v1beta2.MsgContent") } func init() { proto.RegisterFile("cosmos/gov/v1beta2/gov.proto", fileDescriptor_5abf7b8852811c49) } var fileDescriptor_5abf7b8852811c49 = []byte{ - // 1019 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0xc1, 0x6e, 0xdb, 0x46, - 0x10, 0x35, 0x25, 0x59, 0xb6, 0x47, 0xb6, 0xc2, 0x6e, 0x8c, 0x86, 0x76, 0x52, 0xca, 0xd5, 0xc1, - 0x10, 0x82, 0x5a, 0x8a, 0x5d, 0x34, 0x05, 0x7a, 0x8a, 0x64, 0x32, 0x0d, 0x03, 0xc7, 0x14, 0x48, - 0x46, 0x46, 0x7b, 0x21, 0x28, 0x73, 0x43, 0x11, 0x15, 0xb9, 0x2a, 0x77, 0xe5, 0xd8, 0x9f, 0xd0, - 0x5b, 0x8e, 0x45, 0x7b, 0xe9, 0xbd, 0xd7, 0x7c, 0x44, 0x4e, 0x45, 0x10, 0x20, 0x40, 0x4f, 0x6d, - 0x61, 0xff, 0x48, 0xc1, 0xe5, 0xd2, 0x96, 0x65, 0x05, 0xd6, 0xc9, 0xab, 0x99, 0xf7, 0xde, 0xce, - 0xec, 0xbe, 0x1d, 0x13, 0x1e, 0x1c, 0x13, 0x1a, 0x11, 0xda, 0x0a, 0xc8, 0x49, 0xeb, 0x64, 0xb7, - 0x8f, 0x99, 0xb7, 0x97, 0xae, 0x9b, 0xa3, 0x84, 0x30, 0x82, 0x50, 0x96, 0x6d, 0xa6, 0x11, 0x91, - 0xdd, 0x54, 0x05, 0xa3, 0xef, 0x51, 0x2c, 0x28, 0xbb, 0xad, 0x63, 0x12, 0xc6, 0x19, 0x67, 0x73, - 0x3d, 0x20, 0x01, 0xe1, 0xcb, 0x56, 0xba, 0x12, 0xd1, 0x5a, 0x40, 0x48, 0x30, 0xc4, 0x2d, 0xfe, - 0xab, 0x3f, 0x7e, 0xd5, 0x62, 0x61, 0x84, 0x29, 0xf3, 0xa2, 0x91, 0x00, 0x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xb5, 0xc7, 0x9d, 0x23, 0x0a, 0xd4, 0x40, 0x38, 0x29, 0x57, 0x96, 0xe6, 0x53, 0x5e, 0xcd, 0x58, - 0x42, 0xf5, 0xb7, 0xdc, 0x7e, 0x42, 0x75, 0x1b, 0xca, 0x3f, 0x8f, 0x49, 0x32, 0x8e, 0x66, 0x38, - 0x90, 0x0f, 0xeb, 0x2c, 0x8b, 0xbe, 0x82, 0x15, 0x36, 0x48, 0x30, 0x1d, 0x90, 0xa1, 0xff, 0x89, - 0xb9, 0x7e, 0x05, 0x40, 0xdf, 0x40, 0x35, 0x35, 0x98, 0x7b, 0x45, 0x29, 0xce, 0xa4, 0xac, 0xa5, - 0x28, 0x27, 0x07, 0x3d, 0xfc, 0x45, 0x02, 0x98, 0xf8, 0x07, 0x74, 0x1f, 0xee, 0xf5, 0x4c, 0x47, - 0x77, 0xcd, 0xae, 0x63, 0x98, 0x87, 0xee, 0xcb, 0x43, 0xbb, 0xab, 0xef, 0x1b, 0x4f, 0x0d, 0x5d, - 0x93, 0x17, 0xd0, 0x5d, 0xb8, 0x33, 0x99, 0xfc, 0x41, 0xb7, 0x65, 0x09, 0xdd, 0x83, 0xbb, 0x93, - 0xc1, 0x76, 0xc7, 0x76, 0xda, 0xc6, 0xa1, 0x5c, 0x40, 0x08, 0xaa, 0x93, 0x89, 0x43, 0x53, 0x2e, - 0xa2, 0x07, 0xa0, 0x5c, 0x8f, 0xb9, 0x47, 0x86, 0xf3, 0xcc, 0xed, 0xe9, 0x8e, 0x29, 0x97, 0x1e, - 0xfe, 0x25, 0x41, 0xf5, 0xfa, 0xf8, 0x45, 0x35, 0xb8, 0xdf, 0xb5, 0xcc, 0xae, 0x69, 0xb7, 0x0f, - 0x5c, 0xdb, 0x69, 0x3b, 0x2f, 0xed, 0xa9, 0x9a, 0xea, 0xa0, 0x4e, 0x03, 0x34, 0xbd, 0x6b, 0xda, - 0x86, 0xe3, 0x76, 0x75, 0xcb, 0x30, 0x35, 0x59, 0x42, 0x5f, 0xc2, 0x17, 0xd3, 0x98, 0x9e, 0xe9, - 0x18, 0x87, 0xdf, 0xe7, 0x90, 0x02, 0xda, 0x84, 0xcf, 0xa7, 0x21, 0xdd, 0xb6, 0x6d, 0xeb, 0x5a, - 0x56, 0xf4, 0x74, 0xce, 0xd2, 0x9f, 0xeb, 0xfb, 0x8e, 0xae, 0xc9, 0xa5, 0x59, 0xcc, 0xa7, 0x6d, - 0xe3, 0x40, 0xd7, 0xe4, 0xc5, 0x4e, 0xe7, 0xdd, 0xb9, 0x2a, 0xbd, 0x3f, 0x57, 0xa5, 0xff, 0xce, - 0x55, 0xe9, 0xcd, 0x85, 0xba, 0xf0, 0xfe, 0x42, 0x5d, 0xf8, 0xfb, 0x42, 0x5d, 0xf8, 0xb1, 0x11, - 0x84, 0x6c, 0x30, 0xee, 0x37, 0x8f, 0x49, 0x24, 0xbe, 0x0b, 0xc4, 0x9f, 0x1d, 0xea, 0xff, 0xd4, - 0x3a, 0xe5, 0x5f, 0x3d, 0xec, 0x6c, 0x84, 0x69, 0xbf, 0xcc, 0x4d, 0xf6, 0xf5, 0xff, 0x01, 0x00, - 0x00, 0xff, 0xff, 0xa4, 0x3d, 0x7c, 0xd7, 0x10, 0x09, 0x00, 0x00, + // 1067 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0x41, 0x6f, 0xdb, 0x46, + 0x13, 0x35, 0x25, 0x45, 0xb2, 0x47, 0xb6, 0xa2, 0x6f, 0x63, 0x7c, 0xa1, 0x1d, 0x57, 0x72, 0x75, + 0x30, 0x84, 0xa0, 0x96, 0x62, 0x17, 0x4d, 0x81, 0xf6, 0x12, 0xc9, 0x64, 0x1a, 0x06, 0xb6, 0x29, + 0x90, 0x8c, 0x8c, 0xf6, 0x42, 0x50, 0xe6, 0x86, 0x22, 0x2a, 0x72, 0x55, 0xee, 0xca, 0xb1, 0x7e, + 0x42, 0x6f, 0x39, 0x16, 0xed, 0xa5, 0xf7, 0x5e, 0xfd, 0x23, 0x82, 0x1e, 0x8a, 0x20, 0x40, 0x80, + 0x9e, 0xda, 0xc2, 0xfe, 0x23, 0x05, 0x97, 0x4b, 0x4b, 0x96, 0x55, 0x58, 0x27, 0xaf, 0x66, 0xde, + 0x7b, 0x3b, 0xb3, 0xfb, 0x76, 0x4c, 0xd8, 0x3a, 0x25, 0x34, 0x20, 0xb4, 0xe9, 0x91, 0xb3, 0xe6, + 0xd9, 0x5e, 0x0f, 0x33, 0x67, 0x3f, 0x5e, 0x37, 0x86, 0x11, 0x61, 0x04, 0xa1, 0x24, 0xdb, 0x88, + 0x23, 0x22, 0xbb, 0x59, 0x11, 0x8c, 0x9e, 0x43, 0xb1, 0xa0, 0xec, 0x35, 0x4f, 0x89, 0x1f, 0x26, + 0x9c, 0xcd, 0x75, 0x8f, 0x78, 0x84, 0x2f, 0x9b, 0xf1, 0x4a, 0x44, 0xab, 0x1e, 0x21, 0xde, 0x00, + 0x37, 0xf9, 0xaf, 0xde, 0xe8, 0x75, 0x93, 0xf9, 0x01, 0xa6, 0xcc, 0x09, 0x86, 0x02, 0xb0, 0x31, + 0x0b, 0x70, 0xc2, 0xb1, 0x48, 0x55, 0x66, 0x53, 0xee, 0x28, 0x72, 0x98, 0x4f, 0xd2, 0x1d, 0x37, + 0x92, 0x8a, 0xec, 0x64, 0x53, 0x51, 0x32, 0xff, 0x51, 0x63, 0x80, 0x4e, 0xb0, 0xef, 0xf5, 0x19, + 0x76, 0xbb, 0x84, 0x61, 0x7d, 0x18, 0xd3, 0xd0, 0x53, 0xc8, 0x13, 0xbe, 0x92, 0xa5, 0x6d, 0xa9, + 0x5e, 0xda, 0xaf, 0x34, 0x6e, 0xf7, 0xd9, 0x98, 0xe0, 0x0d, 0x81, 0x46, 0x3b, 0x90, 0x7f, 0xc3, + 0xd5, 0xe4, 0xcc, 0xb6, 0x54, 0x5f, 0x69, 0x97, 0x3e, 0x5c, 0xec, 0x82, 0xa0, 0x2a, 0xf8, 0xd4, + 0x10, 0xd9, 0xda, 0x2f, 0x12, 0x14, 0x14, 0x3c, 0x24, 0xd4, 0x67, 0xa8, 0x0a, 0xc5, 0x61, 0x44, + 0x86, 0x84, 0x3a, 0x03, 0xdb, 0x77, 0xf9, 0x86, 0x39, 0x03, 0xd2, 0x90, 0xe6, 0xa2, 0xa7, 0xb0, + 0xe2, 0x26, 0x58, 0x12, 0x09, 0x5d, 0xf9, 0xc3, 0xc5, 0xee, 0xba, 0xd0, 0x6d, 0xb9, 0x6e, 0x84, + 0x29, 0x35, 0x59, 0xe4, 0x87, 0x9e, 0x31, 0x81, 0xa2, 0x2f, 0x21, 0xef, 0x04, 0x64, 0x14, 0x32, + 0x39, 0xbb, 0x9d, 0xad, 0x17, 0xf7, 0x37, 0xd2, 0x26, 0xe2, 0x8b, 0x11, 0x5d, 0xec, 0x35, 0x0e, + 0x88, 0x1f, 0xb6, 0x73, 0xef, 0xfe, 0xaa, 0x2e, 0x19, 0x02, 0x5e, 0xfb, 0x98, 0x83, 0xe5, 0x8e, + 0xd8, 0xff, 0xee, 0xf2, 0x9e, 0xc0, 0x72, 0x80, 0x29, 0x75, 0x3c, 0x4c, 0xe5, 0x0c, 0xdf, 0x68, + 0xbd, 0x91, 0xdc, 0x47, 0x23, 0xbd, 0x8f, 0x46, 0x2b, 0x1c, 0x1b, 0xd7, 0x28, 0xf4, 0x15, 0xe4, + 0x29, 0x73, 0xd8, 0x88, 0xca, 0x59, 0x7e, 0xba, 0xb5, 0x79, 0xa7, 0x9b, 0x16, 0x60, 0x72, 0xa4, + 0x21, 0x18, 0xe8, 0x08, 0xd0, 0x6b, 0x3f, 0x74, 0x06, 0x36, 0x73, 0x06, 0x83, 0xb1, 0x1d, 0x61, + 0x3a, 0x1a, 0x30, 0x39, 0xb7, 0x2d, 0xd5, 0x8b, 0xfb, 0xd5, 0x79, 0x3a, 0x56, 0x8c, 0x33, 0x38, + 0xcc, 0x28, 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0x01, 0x0d, 0xb8, 0x77, 0x46, 0x18, + 0xbe, 0xfb, 0x71, 0x26, 0xb0, 0xd8, 0xff, 0x62, 0xba, 0x64, 0x17, 0x99, 0x2e, 0xed, 0x8c, 0x2c, + 0x5d, 0x4f, 0x98, 0x67, 0x50, 0x48, 0x56, 0x54, 0xce, 0x71, 0x6f, 0xec, 0xcc, 0x23, 0xdf, 0x1e, + 0x69, 0x46, 0x4a, 0xab, 0xfd, 0x2a, 0xc1, 0x9a, 0x70, 0x4a, 0xc7, 0x89, 0x9c, 0x80, 0xa2, 0x67, + 0x50, 0x0c, 0xfc, 0xf0, 0xda, 0x73, 0xd2, 0x62, 0x9e, 0x83, 0xc0, 0x0f, 0x53, 0xc7, 0x1d, 0x01, + 0x0a, 0x9c, 0xf3, 0x54, 0xc1, 0x1e, 0xe2, 0xc8, 0x27, 0x2e, 0x3f, 0x8e, 0x58, 0x68, 0xd6, 0x26, + 0x8a, 0x98, 0xce, 0xed, 0xdc, 0x4f, 0xb1, 0x4b, 0xca, 0x81, 0x73, 0x9e, 0x16, 0xc4, 0x89, 0x35, + 0x0b, 0x56, 0xbb, 0xdc, 0x39, 0xa2, 0x40, 0x05, 0x84, 0x93, 0x52, 0x65, 0x69, 0x31, 0xe5, 0xd5, + 0x84, 0x25, 0x54, 0x7f, 0x4e, 0xed, 0x27, 0x54, 0x77, 0x20, 0xff, 0xc3, 0x88, 0x44, 0xa3, 0x60, + 0x8e, 0x03, 0xf9, 0xb0, 0x4e, 0xb2, 0xe8, 0x33, 0x58, 0x61, 0xfd, 0x08, 0xd3, 0x3e, 0x19, 0xb8, + 0xff, 0x31, 0xd7, 0x27, 0x00, 0xf4, 0x05, 0x94, 0x62, 0x83, 0xd9, 0x13, 0x4a, 0x76, 0x2e, 0x65, + 0x2d, 0x46, 0x59, 0x29, 0xa8, 0xe6, 0x01, 0x1c, 0x51, 0xef, 0x80, 0x84, 0x0c, 0x87, 0x0c, 0x7d, + 0x0d, 0x85, 0xd3, 0x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0x79, 0xcc, 0xe7, 0x2d, 0xed, + 0x50, 0x55, 0xca, 0xf7, 0xda, 0xed, 0x77, 0x97, 0x15, 0xe9, 0xfd, 0x65, 0x45, 0xfa, 0xe7, 0xb2, + 0x22, 0xbd, 0xbd, 0xaa, 0x2c, 0xbd, 0xbf, 0xaa, 0x2c, 0xfd, 0x79, 0x55, 0x59, 0xfa, 0xae, 0xee, + 0xf9, 0xac, 0x3f, 0xea, 0x35, 0x4e, 0x49, 0x20, 0x3e, 0x40, 0xc4, 0x9f, 0x5d, 0xea, 0x7e, 0xdf, + 0x3c, 0xe7, 0x9f, 0x57, 0x6c, 0x3c, 0xc4, 0xb4, 0x97, 0xe7, 0x57, 0xfc, 0xf9, 0xbf, 0x01, 0x00, + 0x00, 0xff, 0xff, 0x82, 0xec, 0xf0, 0xbf, 0x79, 0x09, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { @@ -1164,6 +1221,48 @@ func (m *TallyParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgContent) 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 *MsgContent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgContent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintGov(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0x12 + } + if m.Content != nil { + { + size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintGov(dAtA []byte, offset int, v uint64) int { offset -= sovGov(v) base := offset @@ -1363,6 +1462,23 @@ func (m *TallyParams) Size() (n int) { return n } +func (m *MsgContent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Content != nil { + l = m.Content.Size() + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + return n +} + func sovGov(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2625,6 +2741,124 @@ func (m *TallyParams) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgContent) 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: MsgContent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgContent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Content == nil { + m.Content = &types1.Any{} + } + if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", 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.Authority = 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 skipGov(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/gov/types/msgs.go b/x/gov/types/msgs.go index 8b9a6e58bb8b..c519439d5662 100644 --- a/x/gov/types/msgs.go +++ b/x/gov/types/msgs.go @@ -265,3 +265,24 @@ func (msg MsgVoteWeighted) GetSigners() []sdk.AccAddress { voter, _ := sdk.AccAddressFromBech32(msg.Voter) return []sdk.AccAddress{voter} } + +func NewMsgContent(content *types.Any, authority string) *MsgContent { + return &MsgContent{ + Content: content, + Authority: authority, + } +} + +func (c MsgContent) GetSigners() []sdk.AccAddress { + authority, _ := sdk.AccAddressFromBech32(c.Authority) + return []sdk.AccAddress{authority} +} + +func (c MsgContent) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(c.Authority) + if err != nil { + return err + } + + return nil +} diff --git a/x/gov/types/proposal.go b/x/gov/types/proposal.go index b22808f9c5cd..e4985a077a81 100644 --- a/x/gov/types/proposal.go +++ b/x/gov/types/proposal.go @@ -30,11 +30,13 @@ func NewProposal(messages []sdk.Msg, id uint64, submitTime, depositEndTime time. return Proposal{}, err } + tally := EmptyTallyResult() + p := Proposal{ ProposalId: id, Messages: msgs, Status: StatusDepositPeriod, - FinalTallyResult: EmptyTallyResult(), + FinalTallyResult: &tally, TotalDeposit: sdk.NewCoins(), SubmitTime: &submitTime, DepositEndTime: &depositEndTime, diff --git a/x/gov/types/query.pb.gw.go b/x/gov/types/query.pb.gw.go index db14e2a20439..7145295e7e10 100644 --- a/x/gov/types/query.pb.gw.go +++ b/x/gov/types/query.pb.gw.go @@ -20,7 +20,6 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -31,7 +30,6 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage -var _ = metadata.Join func request_Query_Proposal_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryProposalRequest @@ -530,14 +528,12 @@ func local_request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Ma // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -545,7 +541,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Proposal_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -559,8 +554,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Proposals_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -568,7 +561,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Proposals_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -582,8 +574,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Vote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -591,7 +581,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Vote_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -605,8 +594,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Votes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -614,7 +601,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Votes_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -628,8 +614,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -637,7 +621,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -651,8 +634,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Deposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -660,7 +641,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Deposit_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -674,8 +654,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Deposits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -683,7 +661,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Deposits_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -697,8 +674,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_TallyResult_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -706,7 +681,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_TallyResult_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) diff --git a/x/gov/types/tally.go b/x/gov/types/tally.go index 25d1e35846f5..21339c29e08b 100644 --- a/x/gov/types/tally.go +++ b/x/gov/types/tally.go @@ -27,8 +27,8 @@ func NewValidatorGovInfo(address sdk.ValAddress, bondedTokens sdk.Int, delegator } // NewTallyResult creates a new TallyResult instance -func NewTallyResult(yes, abstain, no, noWithVeto sdk.Int) *TallyResult { - return &TallyResult{ +func NewTallyResult(yes, abstain, no, noWithVeto sdk.Int) TallyResult { + return TallyResult{ Yes: yes.String(), Abstain: abstain.String(), No: no.String(), @@ -37,7 +37,7 @@ func NewTallyResult(yes, abstain, no, noWithVeto sdk.Int) *TallyResult { } // NewTallyResultFromMap creates a new TallyResult instance from a Option -> Dec map -func NewTallyResultFromMap(results map[VoteOption]sdk.Dec) *TallyResult { +func NewTallyResultFromMap(results map[VoteOption]sdk.Dec) TallyResult { return NewTallyResult( results[OptionYes].TruncateInt(), results[OptionAbstain].TruncateInt(), @@ -47,7 +47,7 @@ func NewTallyResultFromMap(results map[VoteOption]sdk.Dec) *TallyResult { } // EmptyTallyResult returns an empty TallyResult. -func EmptyTallyResult() *TallyResult { +func EmptyTallyResult() TallyResult { return NewTallyResult(sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroInt(), sdk.ZeroInt()) } diff --git a/x/gov/types/v1beta1/gov.pb.go b/x/gov/types/v1beta1/gov.pb.go index 019673127f7e..b17cc188ef18 100644 --- a/x/gov/types/v1beta1/gov.pb.go +++ b/x/gov/types/v1beta1/gov.pb.go @@ -242,7 +242,7 @@ var xxx_messageInfo_Deposit proto.InternalMessageInfo // Proposal defines the core field members of a governance proposal. type Proposal struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"id"` + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` Content *types1.Any `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta1.ProposalStatus" json:"status,omitempty"` FinalTallyResult TallyResult `protobuf:"bytes,4,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result"` @@ -373,10 +373,10 @@ var xxx_messageInfo_Vote proto.InternalMessageInfo // DepositParams defines the params for deposits on governance proposals. type DepositParams struct { // Minimum deposit for a proposal to enter voting period. - MinDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=min_deposit,json=minDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"min_deposit,omitempty"` + MinDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=min_deposit,json=minDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"min_deposit"` // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 // months. - MaxDepositPeriod time.Duration `protobuf:"bytes,2,opt,name=max_deposit_period,json=maxDepositPeriod,proto3,stdduration" json:"max_deposit_period,omitempty"` + MaxDepositPeriod time.Duration `protobuf:"bytes,2,opt,name=max_deposit_period,json=maxDepositPeriod,proto3,stdduration" json:"max_deposit_period"` } func (m *DepositParams) Reset() { *m = DepositParams{} } @@ -414,7 +414,7 @@ var xxx_messageInfo_DepositParams proto.InternalMessageInfo // VotingParams defines the params for voting on governance proposals. type VotingParams struct { // Length of the voting period. - VotingPeriod time.Duration `protobuf:"bytes,1,opt,name=voting_period,json=votingPeriod,proto3,stdduration" json:"voting_period,omitempty"` + VotingPeriod time.Duration `protobuf:"bytes,1,opt,name=voting_period,json=votingPeriod,proto3,stdduration" json:"voting_period"` } func (m *VotingParams) Reset() { *m = VotingParams{} } @@ -453,12 +453,12 @@ var xxx_messageInfo_VotingParams proto.InternalMessageInfo type TallyParams struct { // Minimum percentage of total stake needed to vote for a result to be // considered valid. - Quorum github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=quorum,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"quorum,omitempty"` + Quorum github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=quorum,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"quorum"` // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - Threshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=threshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"threshold,omitempty"` + Threshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=threshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"threshold"` // Minimum value of Veto votes to Total votes ratio for proposal to be // vetoed. Default value: 1/3. - VetoThreshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=veto_threshold,json=vetoThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"veto_threshold,omitempty"` + VetoThreshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=veto_threshold,json=vetoThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"veto_threshold"` } func (m *TallyParams) Reset() { *m = TallyParams{} } @@ -510,92 +510,88 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1beta1/gov.proto", fileDescriptor_6e82113c1a9a4b7c) } var fileDescriptor_6e82113c1a9a4b7c = []byte{ - // 1356 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcf, 0x6f, 0x13, 0x47, - 0x1b, 0xf6, 0xda, 0x8e, 0x93, 0xbc, 0x76, 0x92, 0x65, 0xc8, 0x07, 0x8e, 0x3f, 0x3e, 0x7b, 0xe5, - 0x4f, 0xa2, 0x11, 0x22, 0x0e, 0xa4, 0x12, 0x52, 0x43, 0x2f, 0x76, 0xbc, 0x69, 0x8d, 0x22, 0xdb, - 0x5a, 0x2f, 0x8e, 0xe0, 0xd0, 0xd5, 0xc6, 0x3b, 0x38, 0xdb, 0x7a, 0x77, 0x8c, 0x77, 0x1c, 0x92, - 0x5b, 0x2f, 0x95, 0x90, 0x4f, 0x1c, 0xb9, 0x58, 0x42, 0xed, 0xad, 0xa7, 0x1e, 0xf8, 0x07, 0x7a, - 0x43, 0x55, 0x0f, 0x94, 0x13, 0xea, 0x21, 0x94, 0xa0, 0x56, 0x94, 0xbf, 0xa2, 0xda, 0x99, 0xd9, - 0x64, 0xe3, 0x44, 0x0d, 0x2e, 0x3d, 0x79, 0x76, 0xe6, 0x79, 0x9e, 0xf7, 0x87, 0xdf, 0xf7, 0x9d, - 0x5d, 0xb8, 0xd4, 0x22, 0x9e, 0x43, 0xbc, 0xe5, 0x36, 0xd9, 0x59, 0xde, 0xb9, 0xbe, 0x85, 0xa9, -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54, 0xe7, 0xe8, 0x2a, 0x5c, 0x18, 0xa5, 0xd6, 0x8b, 0x8d, 0x86, 0x5a, 0x96, 0x63, 0x19, - 0x79, 0x30, 0x54, 0x52, 0x9c, 0x53, 0x37, 0x3d, 0x0f, 0x5b, 0xe8, 0x1a, 0xa4, 0x47, 0xd1, 0x9a, - 0x7a, 0x4b, 0x5d, 0xd3, 0xd5, 0xb2, 0x1c, 0xcf, 0xa0, 0xc1, 0x50, 0x99, 0x15, 0x6f, 0x48, 0xf8, - 0x4b, 0xdc, 0xa2, 0xf8, 0x54, 0xfd, 0xf5, 0x62, 0x65, 0x43, 0x2d, 0xcb, 0x13, 0x61, 0xfd, 0x75, - 0xd3, 0xee, 0x60, 0x8b, 0xa7, 0xb3, 0xd4, 0x7c, 0xf6, 0x3a, 0x1b, 0x79, 0xf9, 0x3a, 0x1b, 0xf9, - 0xfa, 0x20, 0x1b, 0x79, 0x76, 0x90, 0x95, 0x9e, 0x1f, 0x64, 0xa5, 0xdf, 0x0e, 0xb2, 0xd2, 0xa3, - 0x37, 0xd9, 0xc8, 0xf3, 0x37, 0xd9, 0xc8, 0xcb, 0x37, 0xd9, 0xc8, 0xdd, 0x6b, 0x7f, 0x5b, 0xb0, - 0xbb, 0xec, 0x9b, 0x87, 0x95, 0x6d, 0xf0, 0x19, 0xb3, 0x95, 0x60, 0x93, 0xe1, 0xe3, 0xbf, 0x02, - 0x00, 0x00, 0xff, 0xff, 0x14, 0x1f, 0x45, 0x67, 0x16, 0x0d, 0x00, 0x00, + // 1284 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xc1, 0x6f, 0x13, 0xc7, + 0x17, 0xf6, 0xda, 0x8e, 0x93, 0x3c, 0x3b, 0xc9, 0x32, 0x44, 0xe0, 0xf8, 0xf7, 0xeb, 0x7a, 0xe5, + 0x03, 0x8a, 0x10, 0x71, 0x20, 0x95, 0x90,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x75, 0xa3, 0x5a, 0xfb, 0x2c, + 0xe2, 0xc6, 0x73, 0x17, 0x86, 0x23, 0x15, 0x71, 0x6e, 0x6b, 0xac, 0x40, 0xd1, 0x15, 0xb8, 0x30, + 0x49, 0x6d, 0x94, 0x9a, 0x4d, 0xad, 0x22, 0x27, 0x72, 0xf2, 0x70, 0xa4, 0x66, 0x38, 0xa7, 0x61, + 0x05, 0x01, 0xb6, 0xd1, 0x55, 0xc8, 0x4e, 0xa2, 0x75, 0xed, 0x73, 0x6d, 0xc3, 0xd0, 0x2a, 0x72, + 0x32, 0x87, 0x86, 0x23, 0x75, 0x5e, 0xbc, 0x85, 0xe0, 0x6f, 0x70, 0x87, 0xe2, 0x13, 0xf5, 0x37, + 0x4b, 0xd5, 0x2d, 0xad, 0x22, 0x4f, 0x8d, 0xeb, 0x6f, 0x5a, 0x4e, 0x0f, 0xdb, 0x3c, 0x9d, 0xe5, + 0xd6, 0xe3, 0x97, 0x4a, 0xec, 0xd9, 0x4b, 0x25, 0xf6, 0xfd, 0x81, 0x12, 0x7b, 0x7c, 0xa0, 0x48, + 0x4f, 0x0e, 0x14, 0xe9, 0x8f, 0x03, 0x45, 0xba, 0xff, 0x4a, 0x89, 0x3d, 0x79, 0xa5, 0xc4, 0x9e, + 0xbd, 0x52, 0x62, 0x5f, 0x5d, 0xfd, 0xcf, 0xa2, 0xdc, 0x63, 0xdf, 0x13, 0xac, 0x34, 0xa3, 0x4f, + 0x84, 0x76, 0x8a, 0xf9, 0xf6, 0xe3, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xf2, 0xac, 0xb7, 0x42, + 0x72, 0x0c, 0x00, 0x00, } func (this *TextProposal) Equal(that interface{}) bool { diff --git a/x/gov/types/v1beta1/tx.pb.go b/x/gov/types/v1beta1/tx.pb.go index e10538a0f3d5..f0bf23af9e65 100644 --- a/x/gov/types/v1beta1/tx.pb.go +++ b/x/gov/types/v1beta1/tx.pb.go @@ -74,7 +74,7 @@ var xxx_messageInfo_MsgSubmitProposal proto.InternalMessageInfo // MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. type MsgSubmitProposalResponse struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` } func (m *MsgSubmitProposalResponse) Reset() { *m = MsgSubmitProposalResponse{} } @@ -119,7 +119,7 @@ func (m *MsgSubmitProposalResponse) GetProposalId() uint64 { // MsgVote defines a message to cast a vote. type MsgVote struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` } @@ -275,7 +275,7 @@ var xxx_messageInfo_MsgVoteWeightedResponse proto.InternalMessageInfo // MsgDeposit defines a message to submit a deposit to an existing proposal. type MsgDeposit struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` } @@ -363,48 +363,47 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1beta1/tx.proto", fileDescriptor_3c053992595e3dce) } var fileDescriptor_3c053992595e3dce = []byte{ - // 654 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4f, 0x6f, 0xd3, 0x4e, - 0x10, 0xb5, 0x93, 0xfe, 0x9a, 0x5f, 0x27, 0xa8, 0xa5, 0x56, 0x24, 0x92, 0x14, 0xd9, 0x51, 0x10, - 0x55, 0x24, 0x14, 0xbb, 0x0d, 0xa8, 0x07, 0x38, 0x35, 0x45, 0x08, 0x90, 0x22, 0xc0, 0x95, 0x40, - 0xe2, 0x52, 0x92, 0x78, 0xbb, 0xb5, 0x68, 0x3c, 0x56, 0x76, 0x13, 0xb5, 0x37, 0x8e, 0x9c, 0x10, - 0x47, 0x8e, 0x3d, 0x73, 0x2e, 0x37, 0x3e, 0x40, 0xc5, 0xa9, 0xe2, 0xc4, 0x01, 0x15, 0xd4, 0x5e, - 0x10, 0x82, 0xef, 0x80, 0xec, 0xdd, 0x75, 0xa1, 0x75, 0xd3, 0xf2, 0xe7, 0x94, 0xec, 0xbe, 0xf7, - 0x66, 0xe6, 0xcd, 0xce, 0x7a, 0x61, 0xa6, 0x8b, 0xac, 0x87, 0xcc, 0xa1, 0x38, 0x74, 0x86, 0xf3, - 0x1d, 0xc2, 0xdb, 0xf3, 0x0e, 0xdf, 0xb0, 0xc3, 0x3e, 0x72, 0x34, 0x0c, 0x01, 0xda, 0x14, 0x87, - 0xb6, 0x04, 0xcb, 0xa6, 0x14, 0x74, 0xda, 0x8c, 0x24, 0x8a, 0x2e, 0xfa, 0x81, 0xd0, 0x94, 0x2f, - 0xa6, 0x04, 0x8c, 0xf4, 0x02, 0x2d, 0x09, 0x74, 0x25, 0x5e, 0x39, 0x32, 0xbc, 0x80, 0x0a, 0x14, - 0x29, 0x8a, 0xfd, 0xe8, 0x9f, 0x12, 0x50, 0x44, 0xba, 0x4e, 0x9c, 0x78, 0xd5, 0x19, 0xac, 0x3a, - 0xed, 0x60, 0x53, 0x40, 0xd5, 0x17, 0x19, 0x98, 0x6e, 0x31, 0xba, 0x3c, 0xe8, 0xf4, 0x7c, 0x7e, - 0xbf, 0x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 0xe2, 0x6b, 0x31, 0x73, - 0x82, 0x2c, 0x02, 0xcb, 0x97, 0x46, 0x80, 0x49, 0xa4, 0x27, 0x70, 0xee, 0x97, 0xa9, 0x1c, 0x25, - 0x52, 0xa4, 0xf2, 0x95, 0x33, 0x90, 0x92, 0x0c, 0x0f, 0x20, 0xa7, 0xa6, 0xc3, 0x3c, 0x41, 0x27, - 0xf1, 0xf2, 0xec, 0x68, 0x5c, 0x85, 0x6c, 0xde, 0xdd, 0xd9, 0x37, 0xf5, 0xdd, 0x7d, 0x53, 0xff, - 0xbc, 0x6f, 0xea, 0x2f, 0x0f, 0x4c, 0x6d, 0xf7, 0xc0, 0xd4, 0x3e, 0x1c, 0x98, 0xda, 0xe3, 0xb9, - 0x91, 0x47, 0xbc, 0x11, 0xbf, 0x0a, 0xf1, 0x41, 0xab, 0xb7, 0xa1, 0x33, 0x1e, 0x7f, 0x96, 0xaf, - 0xfe, 0x08, 0x00, 0x00, 0xff, 0xff, 0xde, 0x27, 0x9f, 0x48, 0x89, 0x06, 0x00, 0x00, + // 638 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x3f, 0x6f, 0xd3, 0x5e, + 0x14, 0xb5, 0x93, 0xfe, 0x9a, 0x5f, 0x6f, 0x50, 0x4b, 0xad, 0x48, 0x24, 0x29, 0x72, 0xa2, 0x20, + 0xaa, 0x48, 0x28, 0x76, 0x1b, 0x50, 0x07, 0x60, 0x69, 0x8a, 0x10, 0x20, 0x45, 0x80, 0x2b, 0x81, + 0xc4, 0x52, 0x92, 0xf8, 0xf5, 0xd5, 0xa2, 0xf1, 0xb5, 0xf2, 0x5e, 0xa2, 0x76, 0x63, 0x64, 0x42, + 0x8c, 0x8c, 0x1d, 0x98, 0x98, 0x3b, 0xf2, 0x01, 0x2a, 0xa6, 0x8a, 0x89, 0xa1, 0x02, 0xd4, 0x2e, + 0x0c, 0x7c, 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, 0xff, 0xff, 0x81, 0x69, 0x26, 0x56, 0x56, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/gov/types/vote.go b/x/gov/types/vote.go index 4b83d3ac325d..02cf192bb83b 100644 --- a/x/gov/types/vote.go +++ b/x/gov/types/vote.go @@ -78,6 +78,15 @@ func NewNonSplitVoteOption(option VoteOption) WeightedVoteOptions { return WeightedVoteOptions{{option, sdk.NewDec(1).String()}} } +// ValidWeightedVoteOption returns true if the sub vote is valid and false otherwise. +func ValidWeightedVoteOption(option WeightedVoteOption) bool { + weight, err := sdk.NewDecFromStr(option.Weight) + if err != nil || !weight.IsPositive() || weight.GT(sdk.NewDec(1)) { + return false + } + return ValidVoteOption(option.Option) +} + // WeightedVoteOptions describes array of WeightedVoteOptions type WeightedVoteOptions []*WeightedVoteOption diff --git a/x/staking/types/staking.pb.go b/x/staking/types/staking.pb.go index 6c228fb4a376..737d4c2910c8 100644 --- a/x/staking/types/staking.pb.go +++ b/x/staking/types/staking.pb.go @@ -1253,611 +1253,610 @@ func (this *Pool) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_ func StakingDescription() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) { d := &github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet{} var gzipped = []byte{ - // 9649 bytes of a gzipped FileDescriptorSet - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0xbd, 0x6b, 0x70, 0x24, 0xd7, - 0x75, 0x1f, 0x8e, 0x9e, 0x17, 0x66, 0x0e, 0x06, 0xc0, 0xe0, 0x02, 0xbb, 0x9c, 0x1d, 0x92, 0x00, - 0x38, 0x7c, 0xec, 0x72, 0x49, 0x62, 0xc9, 0x25, 0xf7, 0x35, 0x2b, 0x89, 0xc2, 0x00, 0xb3, 0x58, - 0xec, 0xe2, 0xc5, 0x06, 0xb0, 0x7c, 0xc8, 0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16, 0x21, 0xe7, 0x98, 0x4d, 0x5b, 0xc5, 0x55, 0xd5, 0xac, 0xe1, 0xaa, 0x66, - 0x6c, 0x9b, 0xf9, 0x0c, 0x05, 0x98, 0x6a, 0x6f, 0x08, 0x25, 0x9c, 0x33, 0x6b, 0x78, 0xd1, 0xd8, - 0x36, 0xe5, 0x11, 0x27, 0x94, 0x46, 0x47, 0x21, 0xe5, 0xec, 0x19, 0xae, 0x72, 0x23, 0x9f, 0xa5, - 0x16, 0xc2, 0x53, 0xc5, 0xdf, 0x4c, 0xc1, 0x68, 0x3f, 0x26, 0x76, 0x11, 0x92, 0xdb, 0xa4, 0x95, - 0xf9, 0xd8, 0x7e, 0x74, 0xc0, 0x78, 0xc2, 0x4a, 0x4c, 0x1d, 0x50, 0x89, 0xb3, 0x30, 0x64, 0x60, - 0xc7, 0xc5, 0x35, 0x66, 0x11, 0xf1, 0x3e, 0x6d, 0x0a, 0x18, 0x53, 0xbb, 0x49, 0x25, 0x0e, 0x64, - 0x52, 0x4f, 0xc1, 0xa8, 0x27, 0x52, 0xd5, 0x56, 0x8c, 0xba, 0xb0, 0xcd, 0x53, 0x51, 0x92, 0xcc, - 0x54, 0x04, 0x9f, 0x4c, 0xd8, 0xe4, 0x11, 0x1c, 0x4a, 0xa3, 0x79, 0x00, 0xd3, 0xc0, 0xe6, 0x76, - 0xb5, 0x86, 0x55, 0x3d, 0x9f, 0xee, 0xa2, 0xa5, 0x55, 0x42, 0xd2, 0xa6, 0x25, 0x93, 0xe5, 0xaa, - 0x3a, 0xba, 0xe0, 0x9b, 0xda, 0x60, 0x17, 0x4b, 0x59, 0x66, 0x83, 0xac, 0xcd, 0xda, 0x36, 0x61, - 0xc4, 0xc6, 0xc4, 0xee, 0x71, 0x8d, 0xb7, 0x2c, 0x43, 0x85, 0x98, 0x89, 0x6c, 0x99, 0xcc, 0xd9, - 0x58, 0xc3, 0x86, 0xed, 0x60, 0x12, 0xdd, 0x0d, 0x5e, 0x46, 0x95, 0x9a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 0xaa, 0x98, 0x26, 0x86, 0x48, 0xde, 0x1a, 0x5f, 0x58, 0x3d, - 0x0c, 0x13, 0x94, 0xc4, 0x6c, 0xba, 0xd8, 0xae, 0xaa, 0xba, 0xe2, 0x38, 0x54, 0x69, 0x69, 0x4a, - 0x8a, 0x48, 0xd9, 0x2a, 0x29, 0x9a, 0x13, 0x25, 0xe8, 0x0c, 0x8c, 0x53, 0x8e, 0x46, 0x53, 0x77, - 0x35, 0x4b, 0xc7, 0x55, 0xb2, 0xcc, 0x73, 0xe8, 0x94, 0xe3, 0x49, 0x36, 0x46, 0x28, 0x96, 0x39, - 0x01, 0x91, 0xc8, 0x41, 0xf3, 0x70, 0x27, 0x65, 0xab, 0x63, 0x03, 0xdb, 0x8a, 0x8b, 0xab, 0xf8, - 0x9d, 0x4d, 0x45, 0x77, 0xaa, 0x8a, 0x51, 0xab, 0xee, 0x28, 0xce, 0x4e, 0x7e, 0x82, 0x00, 0x94, - 0x63, 0x79, 0x49, 0x3e, 0x46, 0x08, 0x17, 0x38, 0x5d, 0x85, 0x92, 0xcd, 0x1a, 0xb5, 0xcb, 0x8a, - 0xb3, 0x83, 0x4a, 0x70, 0x94, 0xa2, 0x38, 0xae, 0xad, 0x19, 0xf5, 0xaa, 0xba, 0x83, 0xd5, 0xdd, - 0x6a, 0xd3, 0xdd, 0x3e, 0x9f, 0xbf, 0x3d, 0x58, 0x3f, 0x95, 0x70, 0x9d, 0xd2, 0xcc, 0x11, 0x92, - 0x4d, 0x77, 0xfb, 0x3c, 0x5a, 0x87, 0x2c, 0xe9, 0x8c, 0x86, 0xf6, 0x3c, 0xae, 0x6e, 0x9b, 0x36, - 0x9d, 0x43, 0x47, 0x3a, 0xb8, 0xa6, 0x80, 0x06, 0x67, 0x56, 0x39, 0xc3, 0xb2, 0x59, 0xc3, 0xa5, - 0xe4, 0xfa, 0x5a, 0xa5, 0x32, 0x2f, 0x0f, 0x09, 0x94, 0x4b, 0xa6, 0x4d, 0x0c, 0xaa, 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0xb1, 0xe9, - 0xd8, 0x89, 0xb4, 0x3c, 0xa4, 0x39, 0xde, 0x96, 0x68, 0xf1, 0x93, 0x31, 0x18, 0x09, 0x1f, 0x4b, - 0xa0, 0x79, 0x48, 0xeb, 0xa6, 0xaa, 0x50, 0xd3, 0x62, 0x67, 0x62, 0x27, 0x22, 0x4e, 0x32, 0x66, - 0x96, 0x38, 0xbd, 0xec, 0x71, 0x16, 0xfe, 0xad, 0x04, 0x69, 0x91, 0x8d, 0x8e, 0x42, 0xc2, 0x52, - 0xdc, 0x1d, 0x0a, 0x97, 0x2c, 0xc7, 0x72, 0x92, 0x4c, 0xd3, 0x24, 0xdf, 0xb1, 0x14, 0x83, 0x9a, - 0x00, 0xcf, 0x27, 0x69, 0xd2, 0xaf, 0x3a, 0x56, 0x6a, 0x74, 0x19, 0x64, 0x36, 0x1a, 0xd8, 0x70, - 0x1d, 0xd1, 0xaf, 0x3c, 0x7f, 0x8e, 0x67, 0xa3, 0x07, 0x60, 0xcc, 0xb5, 0x15, 0x4d, 0x0f, 0xd1, - 0x26, 0x28, 0x6d, 0x4e, 0x14, 0x78, 0xc4, 0x25, 0x38, 0x26, 0x70, 0x6b, 0xd8, 0x55, 0xd4, 0x1d, - 0x5c, 0xf3, 0x99, 0x52, 0x74, 0xbb, 0xe3, 0x36, 0x4e, 0x30, 0xcf, 0xcb, 0x05, 0x6f, 0xf1, 0x6b, - 0x12, 0x8c, 0x89, 0x85, 0x5b, 0xcd, 0x53, 0xd6, 0x32, 0x80, 0x62, 0x18, 0xa6, 0x1b, 0x54, 0x57, - 0xbb, 0x29, 0xb7, 0xf1, 0xcd, 0xcc, 0x7a, 0x4c, 0x72, 0x00, 0xa0, 0xd0, 0x00, 0xf0, 0x4b, 0xba, - 0xaa, 0x6d, 0x0a, 0x86, 0xf8, 0x99, 0x13, 0x3d, 0xb8, 0x64, 0x4b, 0x7d, 0x60, 0x59, 0x64, 0x85, - 0x87, 0x26, 0x20, 0xb9, 0x85, 0xeb,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9e, 0xf3, 0xfb, 0x3c, 0x44, 0x03, 0x81, 0xc9, 0x2e, 0x1a, 0xe2, - 0xef, 0x0b, 0x0d, 0x04, 0xb8, 0xc8, 0x30, 0x6a, 0x0d, 0x60, 0xa2, 0x91, 0x3e, 0x20, 0x86, 0x51, - 0x4b, 0xfc, 0x42, 0x7a, 0x93, 0xfa, 0xfc, 0x68, 0x88, 0x7f, 0x20, 0x7a, 0x93, 0xd2, 0x13, 0x31, - 0x5a, 0x23, 0x82, 0x68, 0x8c, 0x5f, 0x10, 0x62, 0xb4, 0x04, 0x04, 0xa5, 0x35, 0x40, 0xed, 0xd1, - 0x40, 0x34, 0xde, 0x07, 0x39, 0xde, 0x58, 0x5b, 0x30, 0x50, 0x7a, 0x12, 0x8e, 0x76, 0x8e, 0x04, - 0xa2, 0x51, 0x3f, 0xf4, 0x7a, 0xcb, 0xda, 0x2d, 0x18, 0x08, 0x94, 0x36, 0xfc, 0x29, 0x25, 0x18, - 0x05, 0x44, 0xc3, 0x7e, 0xf8, 0xf5, 0xb0, 0xe3, 0x0e, 0x06, 0x01, 0xa5, 0x59, 0x00, 0x7f, 0x02, - 0x8e, 0xc6, 0xfa, 0x08, 0xc7, 0x0a, 0x30, 0x91, 0xa1, 0xc1, 0xe7, 0xdf, 0x68, 0xfe, 0x9b, 0x62, - 0x68, 0x70, 0x0e, 0x32, 0x34, 0xc4, 0xd4, 0x1b, 0xcd, 0xfd, 0x51, 0x31, 0x34, 0x04, 0x0b, 0xb1, - 0xec, 0xc0, 0xec, 0x16, 0x8d, 0xf0, 0x31, 0x61, 0xd9, 0x01, 0xae, 0xd2, 0x0a, 0x8c, 0xb5, 0x4d, - 0x88, 0xd1, 0x50, 0xbf, 0xc4, 0xa1, 0x72, 0xad, 0xf3, 0x61, 0x70, 0xf2, 0xe2, 0x93, 0x61, 0x34, - 0xda, 0xc7, 0x5b, 0x26, 0x2f, 0x3e, 0x17, 0x96, 0x2e, 0x42, 0xda, 0x68, 0xea, 0x3a,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0x15, 0xc7, 0xad, 0xd2, - 0x19, 0x8c, 0x54, 0x9f, 0xe4, 0x2b, 0xf1, 0x36, 0x85, 0x70, 0xc5, 0x72, 0xd1, 0x87, 0x08, 0x17, - 0xcb, 0xaa, 0xa1, 0x13, 0x90, 0xa3, 0x20, 0xaa, 0xd9, 0x68, 0x68, 0x2e, 0x8b, 0xad, 0x52, 0x54, - 0xef, 0x23, 0x24, 0x7f, 0x8e, 0x66, 0xd3, 0x08, 0xeb, 0x76, 0xc8, 0xd0, 0x97, 0x60, 0x94, 0x84, - 0xdd, 0x71, 0x4e, 0x93, 0x0c, 0x5a, 0x78, 0x1c, 0x46, 0x7d, 0xff, 0xc8, 0x48, 0xd2, 0x0c, 0xc5, - 0xcf, 0xa6, 0x84, 0x0f, 0xc3, 0x84, 0x81, 0x6f, 0xd0, 0x5b, 0xd7, 0x21, 0xea, 0x0c, 0xa5, 0x46, - 0xa4, 0xec, 0x5a, 0x98, 0xe3, 0x5e, 0x18, 0x51, 0x85, 0xf2, 0x19, 0x2d, 0x50, 0xda, 0x61, 0x2f, - 0x97, 0x92, 0x1d, 0x83, 0xb4, 0x62, 0x59, 0x8c, 0x60, 0x88, 0xfb, 0x47, 0xcb, 0xa2, 0x45, 0x27, - 0x61, 0x8c, 0xb6, 0xd1, 0xc6, 0x4e, 0x53, 0x77, 0x39, 0x48, 0x96, 0xd2, 0x8c, 0x92, 0x02, 0x99, - 0xe5, 0x53, 0xda, 0xbb, 0x61, 0x18, 0x5f, 0xd7, 0x6a, 0xd8, 0x50, 0x31, 0xa3, 0x1b, 0xa6, 0x74, - 0x59, 0x91, 0x49, 0x89, 0xee, 0x07, 0xcf, 0xef, 0x55, 0x85, 0x4f, 0x1e, 0x61, 0x78, 0x22, 0x9f, - 0xaf, 0xc4, 0x8b, 0x79, 0x48, 0xcc, 0x2b, 0xae, 0x42, 0x02, 0x0c, 0xf7, 0x06, 0x9b, 0x68, 0xb2, - 0x32, 0xf9, 0x59, 0xfc, 0x4e,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x41, 0x26, 0x45, 0x42, 0x4f, 0x42, 0xba, 0xa1, - 0xdc, 0xa8, 0x52, 0xd4, 0xd8, 0x21, 0xa0, 0x0e, 0x36, 0x94, 0x1b, 0x44, 0x56, 0x54, 0x83, 0x51, - 0x02, 0xac, 0xee, 0x28, 0x46, 0x1d, 0x33, 0xfc, 0xf8, 0x21, 0xe0, 0x0f, 0x37, 0x94, 0x1b, 0x73, - 0x14, 0x93, 0xd4, 0x52, 0x4a, 0x7f, 0xf0, 0xe5, 0xa9, 0x01, 0x7a, 0x08, 0xfc, 0xdb, 0x12, 0x80, - 0xaf, 0x2e, 0xf4, 0x53, 0x90, 0x53, 0xbd, 0x14, 0xad, 0x5e, 0x1c, 0x59, 0x1e, 0xef, 0xd6, 0x11, - 0x2d, 0xca, 0x66, 0x13, 0xf3, 0x57, 0x5f, 0x9d, 0x92, 0xe4, 0x51, 0xb5, 0xa5, 0x1f, 0x2a, 0x30, - 0xd4, 0xb4, 0x6a, 0x8a, 0x8b, 0xab, 0x74, 0x11, 0x17, 0xdb, 0xc7, 0x24, 0x0f, 0x8c, 0x91, 0x14, - 0x05, 0xa4, 0xff, 0xb4, 0x04, 0x43, 0xf3, 0x81, 0xfb, 0x98, 0x79, 0x18, 0x6c, 0x98, 0x86, 0xb6, - 0xcb, 0xcd, 0x2e, 0x23, 0x8b, 0x24, 0x2a, 0x40, 0x9a, 0x3d, 0x84, 0x75, 0xf7, 0xc4, 0x8e, 0xa7, - 0x48, 0x13, 0xae, 0xe7, 0xf0, 0x96, 0xa3, 0x09, 0x5d, 0xcb, 0x22, 0x49, 0x96, 0x2e, 0x0e, 0x56, - 0x9b, 0xb6, 0xe6, 0xee, 0x55, 0x55, 0xd3, 0x70, 0x15, 0xd5, 0xe5, 0x4f, 0x2a, 0x47, 0x45, 0xfe, - 0x1c, 0xcb, 0x26, 0x20, 0x35, 0xec, 0x2a, 0x9a, 0xee, 0xe4, 0xd9, 0x15, 0x06, 0x91, 0x0c, 0x88, - 0xf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, 0x0c, 0x2f, 0x3b, 0xf5, 0x4d, 0xa3, 0xf6, 0xff, 0xac, 0x8d, 0x6e, 0xc3, - 0x91, 0x50, 0x0b, 0x6f, 0x91, 0x2a, 0x4f, 0x7f, 0x38, 0x01, 0xf1, 0x65, 0xa7, 0x8e, 0xde, 0x09, - 0xa3, 0xad, 0x53, 0x7c, 0xd7, 0xc8, 0xad, 0xdd, 0xaf, 0x77, 0x5f, 0x5d, 0x75, 0x9f, 0x03, 0xd0, - 0x2e, 0x0c, 0x87, 0xfd, 0xff, 0x89, 0x1e, 0x20, 0x21, 0xca, 0xc2, 0xc3, 0xfd, 0x52, 0x7a, 0x95, - 0xfd, 0x14, 0xa4, 0x3d, 0x87, 0x76, 0x77, 0x0f, 0x6e, 0x41, 0xd4, 0x3d, 0x16, 0xed, 0xe0, 0x3a, - 0x88, 0xf6, 0x5a, 0xdd, 0x46, 0x2f, 0xed, 0xb5, 0xd0, 0xf6, 0xd4, 0x5e, 0xb7, 0x21, 0xb5, 0x05, - 0x10, 0xb0, 0xff, 0x7b, 0x7b, 0x20, 0xf8, 0x64, 0x85, 0x87, 0xfa, 0x22, 0xf3, 0x4e, 0x9c, 0x0e, - 0x39, 0x74, 0xfe, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x62, 0x7a, 0xa4, 0xa8, 0x3d, 0x98, 0x00, - 0x00, + // 9634 bytes of a gzipped FileDescriptorSet + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x7d, 0x7b, 0x70, 0x24, 0xc7, + 0x79, 0x1f, 0x66, 0x5f, 0xd8, 0xfd, 0xb0, 0x00, 0x16, 0x0d, 0xdc, 0x71, 0x6f, 0x49, 0x02, 0xe0, + 0xf2, 0x71, 0xc7, 0x23, 0x89, 0x23, 0x8f, 0xbc, 0xd7, 0x9e, 0x24, 0x1a, 0x0b, 0xec, 0xe1, 0xc0, + 0xc3, 0x8b, 0x03, 0xe0, 0x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, 0xf6, 0x30, 0xd7, 0x37, 0xe4, 0xc5, 0x95, 0x85, 0x5c, 0xc6, 0xc3, 0x5c, 0x90, + 0x57, 0x37, 0xd7, 0x72, 0xe0, 0x21, 0x2c, 0x57, 0xd6, 0xd7, 0x67, 0x17, 0x2a, 0xb9, 0x21, 0x8f, + 0xa2, 0xfc, 0xcc, 0x46, 0x65, 0x3d, 0x97, 0x0d, 0x89, 0xf5, 0xe8, 0xe9, 0xdc, 0xb0, 0x57, 0x45, + 0x65, 0x65, 0x73, 0x39, 0x37, 0x82, 0xc6, 0x60, 0x98, 0x55, 0x21, 0x84, 0x18, 0x6d, 0xc9, 0x3a, + 0xfb, 0x58, 0x2e, 0xe7, 0x0b, 0xc2, 0x50, 0xc6, 0x42, 0x19, 0x67, 0x1f, 0xcb, 0xa1, 0xe2, 0x1c, + 0x24, 0xa9, 0x19, 0x22, 0x04, 0x23, 0x4b, 0xb3, 0xe5, 0xca, 0x52, 0x75, 0x75, 0x6d, 0x63, 0x71, + 0x75, 0x65, 0x76, 0x29, 0x27, 0xf9, 0x79, 0x72, 0xe5, 0xc9, 0xcd, 0x45, 0xb9, 0x32, 0x9f, 0x8b, + 0x05, 0xf3, 0xd6, 0x2a, 0xb3, 0x1b, 0x95, 0xf9, 0x5c, 0xbc, 0xa8, 0xc2, 0x44, 0x27, 0x87, 0xda, + 0x71, 0x08, 0x05, 0x6c, 0x21, 0xd6, 0xc5, 0x16, 0x28, 0x56, 0xab, 0x2d, 0x14, 0xbf, 0x15, 0x83, + 0xf1, 0x0e, 0x93, 0x4a, 0xc7, 0x4a, 0x1e, 0x87, 0x24, 0xb3, 0x65, 0x36, 0xcd, 0xde, 0xdf, 0x71, + 0x76, 0xa2, 0x96, 0xdd, 0x36, 0xd5, 0x52, 0xbe, 0x60, 0xa8, 0x11, 0xef, 0x12, 0x6a, 0x10, 0x88, + 0x36, 0x83, 0xfd, 0x99, 0x36, 0xe7, 0xcf, 0xe6, 0xc7, 0xb3, 0xfd, 0xcc, 0x8f, 0x34, 0x6f, 0x7f, + 0x93, 0x40, 0xb2, 0xc3, 0x24, 0x70, 0x11, 0xc6, 0xda, 0x80, 0xfa, 0x76, 0xc6, 0xef, 0x91, 0x20, + 0xdf, 0x4d, 0x39, 0x11, 0x2e, 0x31, 0x16, 0x72, 0x89, 0x17, 0x5b, 0x35, 0x78, 0x57, 0xf7, 0x4e, + 0x68, 0xeb, 0xeb, 0x4f, 0x48, 0x70, 0xb4, 0x73, 0x48, 0xd9, 0x51, 0x86, 0xb7, 0x41, 0xaa, 0x81, + 0xdd, 0x1d, 0x53, 0x84, 0x55, 0xf7, 0x75, 0x98, 0xac, 0x49, 0x71, 0x6b, 0x67, 0x73, 0xae, 0xe0, + 0x6c, 0x1f, 0xef, 0x16, 0x17, 0x32, 0x69, 0xda, 0x24, 0x7d, 0x6f, 0x0c, 0x8e, 0x74, 0x04, 0xef, + 0x28, 0xe8, 0x9d, 0x00, 0x9a, 0x61, 0x35, 0x5d, 0x16, 0x3a, 0x31, 0x4f, 0x9c, 0xa1, 0x39, 0xd4, + 0x79, 0x11, 0x2f, 0xdb, 0x74, 0xbd, 0xf2, 0x38, 0x2d, 0x07, 0x96, 0x45, 0x09, 0xce, 0xfb, 0x82, + 0x26, 0xa8, 0xa0, 0x93, 0x5d, 0x5a, 0xda, 0x66, 0x98, 0x0f, 0x43, 0x4e, 0xd5, 0x35, 0x6c, 0xb8, + 0x55, 0xc7, 0xb5, 0xb1, 0xd2, 0xd0, 0x8c, 0x3a, 0x9d, 0x6a, 0xd2, 0xa5, 0xe4, 0xb6, 0xa2, 0x3b, + 0x58, 0x1e, 0x65, 0xc5, 0xeb, 0xa2, 0x94, 0x70, 0x50, 0x03, 0xb2, 0x03, 0x1c, 0xa9, 0x10, 0x07, + 0x2b, 0xf6, 0x38, 0x8a, 0xbf, 0x90, 0x81, 0xa1, 0x40, 0x00, 0x8e, 0xee, 0x82, 0xec, 0x73, 0xca, + 0x35, 0xa5, 0x2a, 0x16, 0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, 0x1e, 0xca, 0x1d, 0x86, 0xb9, 0xce, 0x89, 0xfd, 0x19, 0x62, 0x96, + 0x93, 0xb6, 0x98, 0x6f, 0xbc, 0x9b, 0xf9, 0xde, 0x0e, 0x99, 0x86, 0x62, 0x55, 0xb1, 0xe1, 0xda, + 0x7b, 0x34, 0x3e, 0x4f, 0xcb, 0xe9, 0x86, 0x62, 0x55, 0x48, 0xfa, 0xc7, 0xb2, 0x4c, 0x7a, 0x22, + 0x91, 0x4e, 0xe7, 0x32, 0x4f, 0x24, 0xd2, 0x99, 0x1c, 0x14, 0x5f, 0x8b, 0x43, 0x36, 0x18, 0xaf, + 0x93, 0xe5, 0x8f, 0x4a, 0x67, 0x2c, 0x89, 0xfa, 0xb4, 0xbb, 0x7b, 0x46, 0xf7, 0x33, 0x73, 0x64, + 0x2a, 0x2b, 0xa5, 0x58, 0x70, 0x2c, 0x33, 0x4e, 0x12, 0x46, 0x10, 0x63, 0xc3, 0x2c, 0x18, 0x49, + 0xcb, 0x3c, 0x85, 0x16, 0x20, 0xf5, 0x9c, 0x43, 0xb1, 0x53, 0x14, 0xfb, 0x9e, 0xde, 0xd8, 0x4f, + 0xac, 0x53, 0xf0, 0xcc, 0x13, 0xeb, 0xd5, 0x95, 0x55, 0x79, 0x79, 0x76, 0x49, 0xe6, 0xec, 0xe8, + 0x18, 0x24, 0x74, 0xe5, 0xc6, 0x5e, 0x78, 0xd2, 0xa3, 0x59, 0xfd, 0x76, 0xc2, 0x31, 0x48, 0x3c, + 0x8f, 0x95, 0xdd, 0xf0, 0x54, 0x43, 0xb3, 0x6e, 0xe1, 0x60, 0x38, 0x05, 0x49, 0xaa, 0x2f, 0x04, + 0xc0, 0x35, 0x96, 0x1b, 0x40, 0x69, 0x48, 0xcc, 0xad, 0xca, 0x64, 0x40, 0xe4, 0x20, 0xcb, 0x72, + 0xab, 0x6b, 0x8b, 0x95, 0xb9, 0x4a, 0x2e, 0x56, 0x3c, 0x03, 0x29, 0xa6, 0x04, 0x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 0x7e, 0x29, 0xff, 0x4d, 0x18, 0x57, 0xcd, 0x46, 0xab, 0xb8, 0xe5, 0x5c, 0xcb, 0xe6, + 0x82, 0x73, 0x59, 0x7a, 0xf6, 0x21, 0x4e, 0x54, 0x37, 0x75, 0xc5, 0xa8, 0xcf, 0x98, 0x76, 0xdd, + 0x3f, 0x66, 0x25, 0x11, 0x8f, 0x13, 0x38, 0x6c, 0xb5, 0xb6, 0xfe, 0xb7, 0x24, 0xfd, 0x72, 0x2c, + 0xbe, 0xb0, 0x56, 0xfe, 0x64, 0xac, 0xb0, 0xc0, 0x18, 0xd7, 0x84, 0x32, 0x64, 0xbc, 0xad, 0x63, + 0x95, 0x34, 0x10, 0xbe, 0xfb, 0x00, 0x4c, 0xd4, 0xcd, 0xba, 0x49, 0x91, 0x4e, 0x91, 0x5f, 0xfc, + 0x9c, 0x36, 0xe3, 0xe5, 0x16, 0x22, 0x0f, 0x75, 0x4b, 0x2b, 0x30, 0xce, 0x89, 0xab, 0xf4, 0xa0, + 0x88, 0x2d, 0x63, 0x50, 0xcf, 0x3d, 0xb4, 0xfc, 0x67, 0xbe, 0x4d, 0xa7, 0x6f, 0x79, 0x8c, 0xb3, + 0x92, 0x32, 0xb6, 0xd2, 0x29, 0xc9, 0x70, 0x24, 0x84, 0xc7, 0x06, 0x29, 0xb6, 0x23, 0x10, 0x7f, + 0x8f, 0x23, 0x8e, 0x07, 0x10, 0xd7, 0x39, 0x6b, 0x69, 0x0e, 0x86, 0xf7, 0x83, 0xf5, 0x6f, 0x39, + 0x56, 0x16, 0x07, 0x41, 0x16, 0x60, 0x94, 0x82, 0xa8, 0x4d, 0xc7, 0x35, 0x1b, 0xd4, 0x03, 0xf6, + 0x86, 0xf9, 0xfd, 0x6f, 0xb3, 0x51, 0x33, 0x42, 0xd8, 0xe6, 0x3c, 0xae, 0x52, 0x09, 0xe8, 0xd9, + 0x58, 0x0d, 0xab, 0x7a, 0x04, 0xc2, 0x97, 0xb8, 0x20, 0x1e, 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x72, 0xd1, 0x87, 0x08, + 0x17, 0xcb, 0xaa, 0xa1, 0x13, 0x90, 0xa3, 0x20, 0xaa, 0xd9, 0x68, 0x68, 0x2e, 0x8b, 0xad, 0x52, + 0x54, 0xef, 0x23, 0x24, 0x7f, 0x8e, 0x66, 0xd3, 0x08, 0xeb, 0x76, 0xc8, 0xd0, 0x77, 0x5f, 0x94, + 0x84, 0xdd, 0x71, 0x4e, 0x93, 0x0c, 0x5a, 0x78, 0x1c, 0x46, 0x7d, 0xff, 0xc8, 0x48, 0xd2, 0x0c, + 0xc5, 0xcf, 0xa6, 0x84, 0x0f, 0xc3, 0x84, 0x81, 0xaf, 0xd3, 0x5b, 0xd7, 0x21, 0xea, 0x0c, 0xa5, + 0x46, 0xa4, 0xec, 0x6a, 0x98, 0xe3, 0x5e, 0x18, 0x51, 0x85, 0xf2, 0x19, 0x2d, 0x50, 0xda, 0x61, + 0x2f, 0x97, 0x92, 0x1d, 0x83, 0xb4, 0x62, 0x59, 0x8c, 0x60, 0x88, 0xfb, 0x47, 0xcb, 0xa2, 0x45, + 0x27, 0x61, 0x8c, 0xb6, 0xd1, 0xc6, 0x4e, 0x53, 0x77, 0x39, 0x48, 0x96, 0xd2, 0x8c, 0x92, 0x02, + 0x99, 0xe5, 0x53, 0xda, 0xbb, 0x61, 0x18, 0x5f, 0xd3, 0x6a, 0xd8, 0x50, 0x31, 0xa3, 0x1b, 0xa6, + 0x74, 0x59, 0x91, 0x49, 0x89, 0xee, 0x07, 0xcf, 0xef, 0x55, 0x85, 0x4f, 0x1e, 0x61, 0x78, 0x22, + 0x9f, 0xaf, 0xc4, 0x8b, 0x79, 0x48, 0xcc, 0x2b, 0xae, 0x42, 0x02, 0x0c, 0xf7, 0x3a, 0x9b, 0x68, + 0xb2, 0x32, 0xf9, 0x59, 0xfc, 0x4e, 0x0c, 0x12, 0x57, 0x4d, 0x17, 0xa3, 0x47, 0x03, 0x01, 0xe0, + 0x48, 0x27, 0x7b, 0x5e, 0xd7,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x74, 0xe8, 0x69, 0xf8, 0xf7, 0x92, 0x70, 0x84, 0x9f, 0x31, 0x29, 0x96, 0x76, 0x6a, 0xc7, 0x75, + 0xc5, 0x15, 0x7f, 0xe0, 0x51, 0xac, 0x62, 0x69, 0xc5, 0x3d, 0x48, 0x5c, 0x76, 0x5d, 0x0b, 0x9d, + 0x84, 0xa4, 0xdd, 0xd4, 0xb1, 0xd8, 0x4e, 0xf1, 0xb6, 0xa3, 0x15, 0x4b, 0x9b, 0x21, 0x04, 0x72, + 0x53, 0xc7, 0x32, 0x23, 0x41, 0x15, 0x98, 0xda, 0x6e, 0xea, 0xfa, 0x5e, 0xb5, 0x86, 0xe9, 0xbf, + 0x8a, 0xf2, 0xfe, 0xd9, 0x02, 0xbe, 0x6e, 0x29, 0xe2, 0x93, 0x8d, 0x44, 0x31, 0x77, 0x50, 0xb2, + 0x79, 0x4a, 0x25, 0xfe, 0xd1, 0x42, 0x45, 0xd0, 0x14, 0xff, 0x38, 0x06, 0x69, 0x01, 0x4d, 0xef, + 0x38, 0x63, 0x1d, 0xab, 0xae, 0x29, 0x0e, 0x03, 0xbc, 0x34, 0x42, 0x10, 0xaf, 0xf3, 0xce, 0xcb, + 0x5c, 0x1e, 0x90, 0x49, 0x82, 0xe4, 0x79, 0x37, 0xcf, 0x49, 0x9e, 0xd5, 0x24, 0xfd, 0x99, 0xb0, + 0x4c, 0xb1, 0xde, 0xba, 0x3c, 0x20, 0xd3, 0x14, 0xca, 0x43, 0x8a, 0x0c, 0x27, 0x97, 0xf5, 0x16, + 0xc9, 0xe7, 0x69, 0x74, 0x14, 0x92, 0x96, 0xe2, 0xaa, 0xec, 0x52, 0x18, 0x29, 0x60, 0x49, 0x74, + 0x0e, 0x52, 0xec, 0x45, 0x72, 0xeb, 0xff, 0x61, 0x21, 0xca, 0x60, 0x9f, 0x7e, 0x23, 0x72, 0xaf, + 0x29, 0xae, 0x8b, 0x6d, 0x83, 0x00, 0x32, 0x72, 0x84, 0x20, 0xb1,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, 0x6b, 0xe4, 0xd6, 0xee, 0xd7, 0xbb, 0xaf, 0xae, 0xba, 0xcf, 0x01, + 0x68, 0x17, 0x86, 0xc3, 0xfe, 0xff, 0x44, 0x0f, 0x90, 0x10, 0x65, 0xe1, 0xe1, 0x7e, 0x29, 0xbd, + 0xca, 0x7e, 0x1a, 0xd2, 0x9e, 0x43, 0xbb, 0xbb, 0x07, 0xb7, 0x20, 0xea, 0x1e, 0x8b, 0x76, 0x70, + 0x1d, 0x44, 0x7b, 0xad, 0x6e, 0xa3, 0x97, 0xf6, 0x5a, 0x68, 0x7b, 0x6a, 0xaf, 0xdb, 0x90, 0xda, + 0x02, 0x08, 0xd8, 0xff, 0xbd, 0x3d, 0x10, 0x7c, 0xb2, 0xc2, 0x43, 0x7d, 0x91, 0x79, 0x27, 0x4e, + 0x87, 0x1c, 0x3a, 0xff, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbc, 0x80, 0x9c, 0x18, 0x2b, 0x98, + 0x00, 0x00, } r := bytes.NewReader(gzipped) gzipr, err := compress_gzip.NewReader(r) From f9d43a7665a8cfd0352efedcc46d84f1bae246d6 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Tue, 4 Jan 2022 12:44:10 +0100 Subject: [PATCH 02/39] add logic for executing and submitting a proposal --- simapp/app.go | 2 +- x/auth/middleware/tips_test.go | 4 +- x/gov/abci.go | 53 ++++++++++++-------- x/gov/abci_test.go | 47 +++++++++--------- x/gov/common_test.go | 2 +- x/gov/genesis.go | 37 +++++++------- x/gov/genesis_test.go | 65 ++++-------------------- x/gov/keeper/keeper.go | 7 ++- x/gov/keeper/proposal.go | 46 ++++++++++++++--- x/gov/keeper/querier_test.go | 2 +- x/gov/module.go | 15 ++++-- x/gov/simulation/operations.go | 26 +++++----- x/gov/simulation/operations_test.go | 76 +++++++++++++++++------------ x/gov/types/codec.go | 10 ++-- x/gov/types/errors.go | 2 +- x/gov/types/proposal.go | 2 +- x/gov/types/v1beta1/errors.go | 2 - x/gov/types/v1beta1/params.go | 17 ------- x/params/proposal_handler_test.go | 5 +- 19 files changed, 217 insertions(+), 203 deletions(-) diff --git a/simapp/app.go b/simapp/app.go index bc726c5aed2c..443e1f6d66be 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -616,7 +616,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(minttypes.ModuleName) paramsKeeper.Subspace(distrtypes.ModuleName) paramsKeeper.Subspace(slashingtypes.ModuleName) - paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(oldgovtypes.ParamKeyTable()) + paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable()) paramsKeeper.Subspace(crisistypes.ModuleName) return paramsKeeper diff --git a/x/auth/middleware/tips_test.go b/x/auth/middleware/tips_test.go index f55c2501858c..1edfd00d52c5 100644 --- a/x/auth/middleware/tips_test.go +++ b/x/auth/middleware/tips_test.go @@ -13,7 +13,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) @@ -32,7 +32,7 @@ func (s *MWTestSuite) setupAcctsForTips(ctx sdk.Context) (sdk.Context, []testAcc s.Require().NoError(err) // Create dummy proposal for tipper to vote on. - prop, err := govtypes.NewProposal(govtypes.NewTextProposal("foo", "bar"), 1, time.Now(), time.Now().Add(time.Hour)) + prop, err := govtypes.NewProposal([]sdk.Msg{}, 1, time.Now(), time.Now().Add(time.Hour)) s.Require().NoError(err) s.app.GovKeeper.SetProposal(ctx, prop) s.app.GovKeeper.ActivateVotingPeriod(ctx, prop) diff --git a/x/gov/abci.go b/x/gov/abci.go index f7bdbcfa9710..85a2326b5e92 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -8,17 +8,16 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // EndBlocker called every block, process inflation, update validator set. func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) { - defer telemetry.ModuleMeasureSince(v1beta1.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker) logger := keeper.Logger(ctx) // delete dead proposals from store and burn theirs deposits. A proposal is dead when it's inactive and didn't get enough deposit on time to get into voting phase. - keeper.IterateInactiveProposalsQueue(ctx, ctx.BlockHeader().Time, func(proposal v1beta1.Proposal) bool { + keeper.IterateInactiveProposalsQueue(ctx, ctx.BlockHeader().Time, func(proposal types.Proposal) bool { keeper.DeleteProposal(ctx, proposal.ProposalId) keeper.DeleteAndBurnDeposits(ctx, proposal.ProposalId) @@ -36,16 +35,15 @@ func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) { logger.Info( "proposal did not meet minimum deposit; deleted", "proposal", proposal.ProposalId, - "title", proposal.GetTitle(), - "min_deposit", keeper.GetDepositParams(ctx).MinDeposit.String(), - "total_deposit", proposal.TotalDeposit.String(), + "min_deposit", sdk.NewCoins(keeper.GetDepositParams(ctx).MinDeposit...).String(), + "total_deposit", sdk.NewCoins(proposal.TotalDeposit...).String(), ) return false }) // fetch active proposals whose voting periods have ended (are passed the block time) - keeper.IterateActiveProposalsQueue(ctx, ctx.BlockHeader().Time, func(proposal v1beta1.Proposal) bool { + keeper.IterateActiveProposalsQueue(ctx, ctx.BlockHeader().Time, func(proposal types.Proposal) bool { var tagValue, logMsg string passes, burnDeposits, tallyResults := keeper.Tally(ctx, proposal) @@ -57,15 +55,31 @@ func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) { } if passes { - handler := keeper.Router().GetRoute(proposal.ProposalRoute()) + var ( + messages []sdk.Msg + err error + idx int + msg sdk.Msg + ) + + // attempt to execute all messages within the passed proposal + // Messages may mutate state thus we use a cached context. If one of + // the handlers fails, no state mutation is written and the error + // message is logged. cacheCtx, writeCache := ctx.CacheContext() + messages, err = proposal.GetMsgs() + if err != nil { + for idx, msg = range messages { + handler := keeper.Router().Handler(msg) + _, err = handler(cacheCtx, msg) + if err != nil { + break + } + } + } - // The proposal handler may execute state mutating logic depending - // on the proposal content. If the handler fails, no state mutation - // is written and the error message is logged. - err := handler(cacheCtx, proposal.GetContent()) if err == nil { - proposal.Status = v1beta1.StatusPassed + proposal.Status = types.StatusPassed tagValue = types.AttributeValueProposalPassed logMsg = "passed" @@ -78,20 +92,20 @@ func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) { // write state to the underlying multi-store writeCache() } else { - proposal.Status = v1beta1.StatusFailed + proposal.Status = types.StatusFailed tagValue = types.AttributeValueProposalFailed - logMsg = fmt.Sprintf("passed, but failed on execution: %s", err) + logMsg = fmt.Sprintf("passed, but msg %d failed on execution: %s", idx, err) } } else { - proposal.Status = v1beta1.StatusRejected + proposal.Status = types.StatusRejected tagValue = types.AttributeValueProposalRejected logMsg = "rejected" } - proposal.FinalTallyResult = tallyResults + proposal.FinalTallyResult = &tallyResults keeper.SetProposal(ctx, proposal) - keeper.RemoveFromActiveProposalQueue(ctx, proposal.ProposalId, proposal.VotingEndTime) + keeper.RemoveFromActiveProposalQueue(ctx, proposal.ProposalId, *proposal.VotingEndTime) // when proposal become active keeper.AfterProposalVotingPeriodEnded(ctx, proposal.ProposalId) @@ -99,8 +113,7 @@ func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) { logger.Info( "proposal tallied", "proposal", proposal.ProposalId, - "title", proposal.GetTitle(), - "result", logMsg, + "results", logMsg, ) ctx.EventManager().EmitEvent( diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 0bc855bce04f..61060b6d6cf7 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -13,7 +13,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -33,8 +32,8 @@ func TestTickExpiredDepositPeriod(t *testing.T) { require.False(t, inactiveQueue.Valid()) inactiveQueue.Close() - newProposalMsg, err := v1beta1.NewMsgSubmitProposal( - v1beta1.ContentFromProposalType("test", "test", v1beta1.ProposalTypeText), + newProposalMsg, err := types.NewMsgSubmitProposal( + []sdk.Msg{}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0], ) @@ -57,7 +56,7 @@ func TestTickExpiredDepositPeriod(t *testing.T) { inactiveQueue.Close() newHeader = ctx.BlockHeader() - newHeader.Time = ctx.BlockHeader().Time.Add(app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod) + newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod) ctx = ctx.WithBlockHeader(newHeader) inactiveQueue = app.GovKeeper.InactiveProposalQueueIterator(ctx, ctx.BlockHeader().Time) @@ -85,8 +84,8 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { require.False(t, inactiveQueue.Valid()) inactiveQueue.Close() - newProposalMsg, err := v1beta1.NewMsgSubmitProposal( - v1beta1.ContentFromProposalType("test", "test", v1beta1.ProposalTypeText), + newProposalMsg, err := types.NewMsgSubmitProposal( + []sdk.Msg{}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0], ) @@ -108,8 +107,8 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { require.False(t, inactiveQueue.Valid()) inactiveQueue.Close() - newProposalMsg2, err := v1beta1.NewMsgSubmitProposal( - v1beta1.ContentFromProposalType("test2", "test2", v1beta1.ProposalTypeText), + newProposalMsg2, err := types.NewMsgSubmitProposal( + []sdk.Msg{}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0], ) @@ -120,7 +119,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { require.NotNil(t, res) newHeader = ctx.BlockHeader() - newHeader.Time = ctx.BlockHeader().Time.Add(app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod).Add(time.Duration(-1) * time.Second) + newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod).Add(time.Duration(-1) * time.Second) ctx = ctx.WithBlockHeader(newHeader) inactiveQueue = app.GovKeeper.InactiveProposalQueueIterator(ctx, ctx.BlockHeader().Time) @@ -165,8 +164,8 @@ func TestTickPassedDepositPeriod(t *testing.T) { require.False(t, activeQueue.Valid()) activeQueue.Close() - newProposalMsg, err := v1beta1.NewMsgSubmitProposal( - v1beta1.ContentFromProposalType("test2", "test2", v1beta1.ProposalTypeText), + newProposalMsg, err := types.NewMsgSubmitProposal( + []sdk.Msg{}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0], ) @@ -190,7 +189,7 @@ func TestTickPassedDepositPeriod(t *testing.T) { require.False(t, inactiveQueue.Valid()) inactiveQueue.Close() - newDepositMsg := v1beta1.NewMsgDeposit(addrs[1], proposalID, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}) + newDepositMsg := types.NewMsgDeposit(addrs[1], proposalID, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}) res1, err := govMsgSvr.Deposit(sdk.WrapSDKContext(ctx), newDepositMsg) require.NoError(t, err) @@ -221,7 +220,7 @@ func TestTickPassedVotingPeriod(t *testing.T) { activeQueue.Close() proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 5))} - newProposalMsg, err := v1beta1.NewMsgSubmitProposal(TestProposal, proposalCoins, addrs[0]) + newProposalMsg, err := types.NewMsgSubmitProposal([]sdk.Msg{}, proposalCoins, addrs[0]) require.NoError(t, err) wrapCtx := sdk.WrapSDKContext(ctx) @@ -236,14 +235,14 @@ func TestTickPassedVotingPeriod(t *testing.T) { newHeader.Time = ctx.BlockHeader().Time.Add(time.Duration(1) * time.Second) ctx = ctx.WithBlockHeader(newHeader) - newDepositMsg := v1beta1.NewMsgDeposit(addrs[1], proposalID, proposalCoins) + newDepositMsg := types.NewMsgDeposit(addrs[1], proposalID, proposalCoins) res1, err := govMsgSvr.Deposit(wrapCtx, newDepositMsg) require.NoError(t, err) require.NotNil(t, res1) newHeader = ctx.BlockHeader() - newHeader.Time = ctx.BlockHeader().Time.Add(app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod).Add(app.GovKeeper.GetVotingParams(ctx).VotingPeriod) + newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod).Add(*app.GovKeeper.GetVotingParams(ctx).VotingPeriod) ctx = ctx.WithBlockHeader(newHeader) inactiveQueue = app.GovKeeper.InactiveProposalQueueIterator(ctx, ctx.BlockHeader().Time) @@ -256,7 +255,7 @@ func TestTickPassedVotingPeriod(t *testing.T) { activeProposalID := types.GetProposalIDFromBytes(activeQueue.Value()) proposal, ok := app.GovKeeper.GetProposal(ctx, activeProposalID) require.True(t, ok) - require.Equal(t, v1beta1.StatusVotingPeriod, proposal.Status) + require.Equal(t, types.StatusVotingPeriod, proposal.Status) activeQueue.Close() @@ -289,11 +288,11 @@ func TestProposalPassedEndblocker(t *testing.T) { require.NotNil(t, macc) initialModuleAccCoins := app.BankKeeper.GetAllBalances(ctx, macc.GetAddress()) - proposal, err := app.GovKeeper.SubmitProposal(ctx, TestProposal) + proposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{}) require.NoError(t, err) proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 10))} - newDepositMsg := v1beta1.NewMsgDeposit(addrs[0], proposal.ProposalId, proposalCoins) + newDepositMsg := types.NewMsgDeposit(addrs[0], proposal.ProposalId, proposalCoins) res, err := govMsgSvr.Deposit(sdk.WrapSDKContext(ctx), newDepositMsg) require.NoError(t, err) @@ -306,11 +305,11 @@ func TestProposalPassedEndblocker(t *testing.T) { deposits := initialModuleAccCoins.Add(proposal.TotalDeposit...).Add(proposalCoins...) require.True(t, moduleAccCoins.IsEqual(deposits)) - err = app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)) + err = app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], types.NewNonSplitVoteOption(types.OptionYes)) require.NoError(t, err) newHeader := ctx.BlockHeader() - newHeader.Time = ctx.BlockHeader().Time.Add(app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod).Add(app.GovKeeper.GetVotingParams(ctx).VotingPeriod) + newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod).Add(*app.GovKeeper.GetVotingParams(ctx).VotingPeriod) ctx = ctx.WithBlockHeader(newHeader) gov.EndBlocker(ctx, app.GovKeeper) @@ -339,22 +338,22 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) { // Create a proposal where the handler will pass for the test proposal // because the value of contextKeyBadProposal is true. ctx = ctx.WithValue(contextKeyBadProposal, true) - proposal, err := app.GovKeeper.SubmitProposal(ctx, TestProposal) + proposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{}) require.NoError(t, err) proposalCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 10))) - newDepositMsg := v1beta1.NewMsgDeposit(addrs[0], proposal.ProposalId, proposalCoins) + newDepositMsg := types.NewMsgDeposit(addrs[0], proposal.ProposalId, proposalCoins) govMsgSvr := keeper.NewMsgServerImpl(app.GovKeeper) res, err := govMsgSvr.Deposit(sdk.WrapSDKContext(ctx), newDepositMsg) require.NoError(t, err) require.NotNil(t, res) - err = app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)) + err = app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], types.NewNonSplitVoteOption(types.OptionYes)) require.NoError(t, err) newHeader := ctx.BlockHeader() - newHeader.Time = ctx.BlockHeader().Time.Add(app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod).Add(app.GovKeeper.GetVotingParams(ctx).VotingPeriod) + newHeader.Time = ctx.BlockHeader().Time.Add(*app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod).Add(*app.GovKeeper.GetVotingParams(ctx).VotingPeriod) ctx = ctx.WithBlockHeader(newHeader) // Set the contextKeyBadProposal value to false so that the handler will fail diff --git a/x/gov/common_test.go b/x/gov/common_test.go index dc1d9ad63e77..efeddc3c004e 100644 --- a/x/gov/common_test.go +++ b/x/gov/common_test.go @@ -14,7 +14,7 @@ import ( var ( valTokens = sdk.TokensFromConsensusPower(42, sdk.DefaultPowerReduction) - TestProposal = v1beta1.NewTextProposal("Test", "description") + TestLegacyProposal = v1beta1.NewTextProposal("Test", "description") TestDescription = stakingtypes.NewDescription("T", "E", "S", "T", "Z") TestCommissionRates = stakingtypes.NewCommissionRates(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()) ) diff --git a/x/gov/genesis.go b/x/gov/genesis.go index f826028258a3..8d40949a5514 100644 --- a/x/gov/genesis.go +++ b/x/gov/genesis.go @@ -6,15 +6,14 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // InitGenesis - store genesis parameters -func InitGenesis(ctx sdk.Context, ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper, data *v1beta1.GenesisState) { +func InitGenesis(ctx sdk.Context, ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper, data *types.GenesisState) { k.SetProposalID(ctx, data.StartingProposalId) - k.SetDepositParams(ctx, data.DepositParams) - k.SetVotingParams(ctx, data.VotingParams) - k.SetTallyParams(ctx, data.TallyParams) + k.SetDepositParams(ctx, *data.DepositParams) + k.SetVotingParams(ctx, *data.VotingParams) + k.SetTallyParams(ctx, *data.TallyParams) // check if the deposits pool account exists moduleAcc := k.GetGovernanceAccount(ctx) @@ -24,22 +23,22 @@ func InitGenesis(ctx sdk.Context, ak types.AccountKeeper, bk types.BankKeeper, k var totalDeposits sdk.Coins for _, deposit := range data.Deposits { - k.SetDeposit(ctx, deposit) + k.SetDeposit(ctx, *deposit) totalDeposits = totalDeposits.Add(deposit.Amount...) } for _, vote := range data.Votes { - k.SetVote(ctx, vote) + k.SetVote(ctx, *vote) } for _, proposal := range data.Proposals { switch proposal.Status { - case v1beta1.StatusDepositPeriod: - k.InsertInactiveProposalQueue(ctx, proposal.ProposalId, proposal.DepositEndTime) - case v1beta1.StatusVotingPeriod: - k.InsertActiveProposalQueue(ctx, proposal.ProposalId, proposal.VotingEndTime) + case types.StatusDepositPeriod: + k.InsertInactiveProposalQueue(ctx, proposal.ProposalId, *proposal.DepositEndTime) + case types.StatusVotingPeriod: + k.InsertActiveProposalQueue(ctx, proposal.ProposalId, *proposal.VotingEndTime) } - k.SetProposal(ctx, proposal) + k.SetProposal(ctx, *proposal) } // if account has zero balance it probably means it's not set, so we set it @@ -55,15 +54,15 @@ func InitGenesis(ctx sdk.Context, ak types.AccountKeeper, bk types.BankKeeper, k } // ExportGenesis - output genesis parameters -func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *v1beta1.GenesisState { +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { startingProposalID, _ := k.GetProposalID(ctx) depositParams := k.GetDepositParams(ctx) votingParams := k.GetVotingParams(ctx) tallyParams := k.GetTallyParams(ctx) proposals := k.GetProposals(ctx) - var proposalsDeposits v1beta1.Deposits - var proposalsVotes v1beta1.Votes + var proposalsDeposits types.Deposits + var proposalsVotes types.Votes for _, proposal := range proposals { deposits := k.GetDeposits(ctx, proposal.ProposalId) proposalsDeposits = append(proposalsDeposits, deposits...) @@ -72,13 +71,13 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *v1beta1.GenesisState { proposalsVotes = append(proposalsVotes, votes...) } - return &v1beta1.GenesisState{ + return &types.GenesisState{ StartingProposalId: startingProposalID, Deposits: proposalsDeposits, Votes: proposalsVotes, Proposals: proposals, - DepositParams: depositParams, - VotingParams: votingParams, - TallyParams: tallyParams, + DepositParams: &depositParams, + VotingParams: &votingParams, + TallyParams: &tallyParams, } } diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index a3eef13f691a..6a12bdf39a41 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -18,7 +18,6 @@ import ( distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/gov" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/staking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -36,12 +35,11 @@ func TestImportExportQueues(t *testing.T) { ctx = app.BaseApp.NewContext(false, tmproto.Header{}) // Create two proposals, put the second into the voting period - proposal := TestProposal - proposal1, err := app.GovKeeper.SubmitProposal(ctx, proposal) + proposal1, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{}) require.NoError(t, err) proposalID1 := proposal1.ProposalId - proposal2, err := app.GovKeeper.SubmitProposal(ctx, proposal) + proposal2, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{}) require.NoError(t, err) proposalID2 := proposal2.ProposalId @@ -53,8 +51,8 @@ func TestImportExportQueues(t *testing.T) { require.True(t, ok) proposal2, ok = app.GovKeeper.GetProposal(ctx, proposalID2) require.True(t, ok) - require.True(t, proposal1.Status == v1beta1.StatusDepositPeriod) - require.True(t, proposal2.Status == v1beta1.StatusVotingPeriod) + require.True(t, proposal1.Status == types.StatusDepositPeriod) + require.True(t, proposal2.Status == types.StatusVotingPeriod) authGenState := auth.ExportGenesis(ctx, app.AccountKeeper) bankGenState := app.BankKeeper.ExportGenesis(ctx) @@ -96,15 +94,15 @@ func TestImportExportQueues(t *testing.T) { ctx2 := app2.BaseApp.NewContext(false, tmproto.Header{}) // Jump the time forward past the DepositPeriod and VotingPeriod - ctx2 = ctx2.WithBlockTime(ctx2.BlockHeader().Time.Add(app2.GovKeeper.GetDepositParams(ctx2).MaxDepositPeriod).Add(app2.GovKeeper.GetVotingParams(ctx2).VotingPeriod)) + ctx2 = ctx2.WithBlockTime(ctx2.BlockHeader().Time.Add(*app2.GovKeeper.GetDepositParams(ctx2).MaxDepositPeriod).Add(*app2.GovKeeper.GetVotingParams(ctx2).VotingPeriod)) // Make sure that they are still in the DepositPeriod and VotingPeriod respectively proposal1, ok = app2.GovKeeper.GetProposal(ctx2, proposalID1) require.True(t, ok) proposal2, ok = app2.GovKeeper.GetProposal(ctx2, proposalID2) require.True(t, ok) - require.True(t, proposal1.Status == v1beta1.StatusDepositPeriod) - require.True(t, proposal2.Status == v1beta1.StatusVotingPeriod) + require.True(t, proposal1.Status == types.StatusDepositPeriod) + require.True(t, proposal2.Status == types.StatusVotingPeriod) macc := app2.GovKeeper.GetGovernanceAccount(ctx2) require.Equal(t, app2.GovKeeper.GetDepositParams(ctx2).MinDeposit, app2.BankKeeper.GetAllBalances(ctx2, macc.GetAddress())) @@ -117,15 +115,15 @@ func TestImportExportQueues(t *testing.T) { proposal2, ok = app2.GovKeeper.GetProposal(ctx2, proposalID2) require.True(t, ok) - require.True(t, proposal2.Status == v1beta1.StatusRejected) + require.True(t, proposal2.Status == types.StatusRejected) } func TestImportExportQueues_ErrorUnconsistentState(t *testing.T) { app := simapp.Setup(t, false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) require.Panics(t, func() { - gov.InitGenesis(ctx, app.AccountKeeper, app.BankKeeper, app.GovKeeper, &v1beta1.GenesisState{ - Deposits: v1beta1.Deposits{ + gov.InitGenesis(ctx, app.AccountKeeper, app.BankKeeper, app.GovKeeper, &types.GenesisState{ + Deposits: types.Deposits{ { ProposalId: 1234, Depositor: "me", @@ -140,46 +138,3 @@ func TestImportExportQueues_ErrorUnconsistentState(t *testing.T) { }) }) } - -func TestEqualProposals(t *testing.T) { - app := simapp.Setup(t, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - addrs := simapp.AddTestAddrs(app, ctx, 2, valTokens) - - SortAddresses(addrs) - - header := tmproto.Header{Height: app.LastBlockHeight() + 1} - app.BeginBlock(abci.RequestBeginBlock{Header: header}) - - // Submit two proposals - proposal := TestProposal - proposal1, err := app.GovKeeper.SubmitProposal(ctx, proposal) - require.NoError(t, err) - - proposal2, err := app.GovKeeper.SubmitProposal(ctx, proposal) - require.NoError(t, err) - - // They are similar but their IDs should be different - require.NotEqual(t, proposal1, proposal2) - require.NotEqual(t, proposal1, proposal2) - - // Now create two genesis blocks - state1 := v1beta1.GenesisState{Proposals: []v1beta1.Proposal{proposal1}} - state2 := v1beta1.GenesisState{Proposals: []v1beta1.Proposal{proposal2}} - require.NotEqual(t, state1, state2) - require.False(t, state1.Equal(state2)) - - // Now make proposals identical by setting both IDs to 55 - proposal1.ProposalId = 55 - proposal2.ProposalId = 55 - require.Equal(t, proposal1, proposal1) - require.Equal(t, proposal1, proposal2) - - // Reassign proposals into state - state1.Proposals[0] = proposal1 - state2.Proposals[0] = proposal2 - - // State should be identical now.. - require.Equal(t, state1, state2) - require.True(t, state1.Equal(state2)) -} diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 3c93ed3332c3..33b874cef19a 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -93,7 +93,12 @@ func (keeper Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", "x/"+types.ModuleName) } -// Router returns the gov Keeper's Router +// Router returns the gov keeper's router +func (keeper Keeper) Router() *middleware.MsgServiceRouter { + return keeper.router +} + +// LegacyRouter returns the gov keeper's legacy router func (keeper Keeper) LegacyRouter() v1beta1.Router { return keeper.legacyRouter } diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 9d89dc03ce93..b7d9ab4e9669 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -13,22 +13,47 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) -// SubmitProposal create new proposal given a content -// SubmitProposal create new proposal given a content +// SubmitProposal create new proposal given an array of messages func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg) (types.Proposal, error) { // Loop through all messages and confirm that each has a handler and the gov module account // as the only signer for _, msg := range messages { + // perform a basic validation of the message + if err := msg.ValidateBasic(); err != nil { + return types.Proposal{}, sdkerrors.Wrap(types.ErrInvalidProposalMsg, err.Error()) + } + signers := msg.GetSigners() if len(signers) != 1 { return types.Proposal{}, types.ErrInvalidSigner } + // assert that the governance module account is the only signer of the messages if !signers[0].Equals(keeper.GetGovernanceAccount(ctx).GetAddress()) { return types.Proposal{}, sdkerrors.Wrap(types.ErrInvalidSigner, signers[0].String()) } - if keeper.router.Handler(msg) == nil { + // check if the message wraps the legacy content type + if contentMsg, ok := msg.(*types.MsgContent); ok { + content := ContentFromMessage(contentMsg) + + // if so ensure that the content has a respective handler + if !keeper.legacyRouter.HasRoute(content.ProposalRoute()) { + return types.Proposal{}, sdkerrors.Wrap(types.ErrNoProposalHandlerExists, content.ProposalRoute()) + } + + // Execute the proposal content in a new context branch (with branched store) + // to validate the actual parameter changes before the proposal proceeds + // through the governance process. State is not persisted. + cacheCtx, _ := ctx.CacheContext() + handler := keeper.legacyRouter.GetRoute(content.ProposalRoute()) + if err := handler(cacheCtx, content); err != nil { + return types.Proposal{}, sdkerrors.Wrap(v1beta1.ErrInvalidProposalContent, err.Error()) + } + + // for all other message types use the msg service router to see that there is a valid route for that + // message. NOTE: we do not verify the proposal messages any further. They may fail upon execution + } else if keeper.router.Handler(msg) == nil { return types.Proposal{}, sdkerrors.Wrap(types.ErrUnroutableProposalMsg, sdk.MsgTypeURL(msg)) } } @@ -130,7 +155,7 @@ func (keeper Keeper) IterateProposals(ctx sdk.Context, cb func(proposal types.Pr // GetProposals returns all the proposals from store func (keeper Keeper) GetProposals(ctx sdk.Context) (proposals types.Proposals) { keeper.IterateProposals(ctx, func(proposal types.Proposal) bool { - proposals = append(proposals, proposal) + proposals = append(proposals, &proposal) return false }) return @@ -147,7 +172,7 @@ func (keeper Keeper) GetProposals(ctx sdk.Context) (proposals types.Proposals) { // form. func (keeper Keeper) GetProposalsFiltered(ctx sdk.Context, params types.QueryProposalsParams) types.Proposals { proposals := keeper.GetProposals(ctx) - filteredProposals := make([]types.Proposal, 0, len(proposals)) + filteredProposals := make([]*types.Proposal, 0, len(proposals)) for _, p := range proposals { matchVoter, matchDepositor, matchStatus := true, true, true @@ -174,7 +199,7 @@ func (keeper Keeper) GetProposalsFiltered(ctx sdk.Context, params types.QueryPro start, end := client.Paginate(len(filteredProposals), params.Page, params.Limit, 100) if start < 0 || end < 0 { - filteredProposals = []types.Proposal{} + filteredProposals = []*types.Proposal{} } else { filteredProposals = filteredProposals[start:end] } @@ -229,6 +254,7 @@ func (keeper Keeper) UnmarshalProposal(bz []byte, proposal *types.Proposal) erro return nil } +// TODO: move both these functions to the migration package func NewContentProposal(content v1beta1.Content, authority string) (*types.MsgContent, error) { msg, ok := content.(proto.Message) if !ok { @@ -241,3 +267,11 @@ func NewContentProposal(content v1beta1.Content, authority string) (*types.MsgCo } return types.NewMsgContent(any, authority), nil } + +func ContentFromMessage(msg *types.MsgContent) v1beta1.Content { + content, ok := msg.Content.GetCachedValue().(v1beta1.Content) + if !ok { + return nil + } + return content +} \ No newline at end of file diff --git a/x/gov/keeper/querier_test.go b/x/gov/keeper/querier_test.go index 1df0f0556f8c..51e2c7f079c5 100644 --- a/x/gov/keeper/querier_test.go +++ b/x/gov/keeper/querier_test.go @@ -62,7 +62,7 @@ func getQueriedParams(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, que func getQueriedProposals( t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier, depositor, voter sdk.AccAddress, status types.ProposalStatus, page, limit int, -) []types.Proposal { +) []*types.Proposal { query := abci.RequestQuery{ Path: strings.Join([]string{custom, types.QuerierRoute, types.QueryProposals}, "/"), diff --git a/x/gov/module.go b/x/gov/module.go index 7525a5429ad5..ba7c425185e1 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -54,6 +54,7 @@ func (AppModuleBasic) Name() string { // RegisterLegacyAminoCodec registers the gov module's types for the given codec. func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { v1beta1.RegisterLegacyAminoCodec(cdc) + types.RegisterLegacyAminoCodec(cdc) } // DefaultGenesis returns default genesis state as raw bytes for the gov @@ -64,12 +65,12 @@ func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { // ValidateGenesis performs genesis state validation for the gov module. func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { - var data v1beta1.GenesisState + var data types.GenesisState if err := cdc.UnmarshalJSON(bz, &data); err != nil { return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) } - return v1beta1.ValidateGenesis(&data) + return types.ValidateGenesis(&data) } // RegisterRESTRoutes registers the REST routes for the gov module. @@ -79,6 +80,9 @@ func (a AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Ro // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the gov module. func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } if err := v1beta1.RegisterQueryHandlerClient(context.Background(), mux, v1beta1.NewQueryClient(clientCtx)); err != nil { panic(err) } @@ -101,6 +105,7 @@ func (AppModuleBasic) GetQueryCmd() *cobra.Command { // RegisterInterfaces implements InterfaceModule.RegisterInterfaces func (a AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { + types.RegisterInterfaces(registry) v1beta1.RegisterInterfaces(registry) } @@ -150,8 +155,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { - v1beta1.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) - v1beta1.RegisterQueryServer(cfg.QueryServer(), am.keeper) + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) m := keeper.NewMigrator(am.keeper) err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2) @@ -163,7 +168,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // InitGenesis performs genesis initialization for the gov module. It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { - var genesisState v1beta1.GenesisState + var genesisState types.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) InitGenesis(ctx, am.accountKeeper, am.bankKeeper, am.keeper, &genesisState) return []abci.ValidatorUpdate{} diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index 8a8772538af7..c4ebc1b4a1b6 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -137,10 +137,14 @@ func SimulateMsgSubmitProposal( return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSubmitProposal, "unable to generate deposit"), nil, err } - NewContentProposal(content, app.GovKeeper.GetGovernanceAccount().GetAddress().String()) - msg, err := types.NewMsgSubmitProposal(content, deposit, simAccount.Address) + contentMsg, err := keeper.NewContentProposal(content, k.GetGovernanceAccount(ctx).GetAddress().String()) if err != nil { - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate a submit proposal msg"), nil, err + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSubmitProposal, "unable to create a content proposal message"), nil, err + } + + msg, err := types.NewMsgSubmitProposal([]sdk.Msg{contentMsg}, deposit, simAccount.Address) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSubmitProposal, "unable to generate a submit proposal msg"), nil, err } account := ak.GetAccount(ctx, simAccount.Address) @@ -451,27 +455,27 @@ func randomWeightedVotingOptions(r *rand.Rand) types.WeightedVoteOptions { w4 := 100 - w1 - w2 - w3 weightedVoteOptions := types.WeightedVoteOptions{} if w1 > 0 { - weightedVoteOptions = append(weightedVoteOptions, types.WeightedVoteOption{ + weightedVoteOptions = append(weightedVoteOptions, &types.WeightedVoteOption{ Option: types.OptionYes, - Weight: sdk.NewDecWithPrec(int64(w1), 2), + Weight: sdk.NewDecWithPrec(int64(w1), 2).String(), }) } if w2 > 0 { - weightedVoteOptions = append(weightedVoteOptions, types.WeightedVoteOption{ + weightedVoteOptions = append(weightedVoteOptions, &types.WeightedVoteOption{ Option: types.OptionAbstain, - Weight: sdk.NewDecWithPrec(int64(w2), 2), + Weight: sdk.NewDecWithPrec(int64(w2), 2).String(), }) } if w3 > 0 { - weightedVoteOptions = append(weightedVoteOptions, types.WeightedVoteOption{ + weightedVoteOptions = append(weightedVoteOptions, &types.WeightedVoteOption{ Option: types.OptionNo, - Weight: sdk.NewDecWithPrec(int64(w3), 2), + Weight: sdk.NewDecWithPrec(int64(w3), 2).String(), }) } if w4 > 0 { - weightedVoteOptions = append(weightedVoteOptions, types.WeightedVoteOption{ + weightedVoteOptions = append(weightedVoteOptions, &types.WeightedVoteOption{ Option: types.OptionNoWithVeto, - Weight: sdk.NewDecWithPrec(int64(w4), 2), + Weight: sdk.NewDecWithPrec(int64(w4), 2).String(), }) } return weightedVoteOptions diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index dc12482f5145..a40ffde10e05 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -15,7 +15,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/bank/testutil" + "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/simulation" + "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) @@ -76,12 +78,12 @@ func TestWeightedOperations(t *testing.T) { opMsgRoute string opMsgName string }{ - {0, v1beta1.ModuleName, "submit_proposal"}, - {1, v1beta1.ModuleName, "submit_proposal"}, - {2, v1beta1.ModuleName, "submit_proposal"}, - {simappparams.DefaultWeightMsgDeposit, v1beta1.ModuleName, v1beta1.TypeMsgDeposit}, - {simappparams.DefaultWeightMsgVote, v1beta1.ModuleName, v1beta1.TypeMsgVote}, - {simappparams.DefaultWeightMsgVoteWeighted, v1beta1.ModuleName, v1beta1.TypeMsgVoteWeighted}, + {0, types.ModuleName, "submit_proposal"}, + {1, types.ModuleName, "submit_proposal"}, + {2, types.ModuleName, "submit_proposal"}, + {simappparams.DefaultWeightMsgDeposit, types.ModuleName, types.TypeMsgDeposit}, + {simappparams.DefaultWeightMsgVote, types.ModuleName, types.TypeMsgVote}, + {simappparams.DefaultWeightMsgVoteWeighted, types.ModuleName, types.TypeMsgVoteWeighted}, } for i, w := range weightesOps { @@ -113,16 +115,23 @@ func TestSimulateMsgSubmitProposal(t *testing.T) { operationMsg, _, err := op(r, app.BaseApp, ctx, accounts, "") require.NoError(t, err) - var msg v1beta1.MsgSubmitProposal - v1beta1.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + var proposal types.MsgSubmitProposal + types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &proposal) require.True(t, operationMsg.OK) - require.Equal(t, "cosmos1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7u4x9a0", msg.Proposer) - require.Equal(t, "2686011stake", msg.InitialDeposit.String()) - require.Equal(t, "title-3: ZBSpYuLyYggwexjxusrBqDOTtGTOWeLrQKjLxzIivHSlcxgdXhhuTSkuxKGLwQvuyNhYFmBZHeAerqyNEUzXPFGkqEGqiQWIXnku", msg.GetContent().GetTitle()) - require.Equal(t, "description-3: NJWzHdBNpAXKJPHWQdrGYcAHSctgVlqwqHoLfHsXUdStwfefwzqLuKEhmMyYLdbZrcPgYqjNHxPexsruwEGStAneKbWkQDDIlCWBLSiAASNhZqNFlPtfqPJoxKsgMdzjWqLWdqKQuJqWPMvwPQWZUtVMOTMYKJbfdlZsjdsomuScvDmbDkgRualsxDvRJuCAmPOXitIbcyWsKGSdrEunFAOdmXnsuyFVgJqEjbklvmwrUlsxjRSfKZxGcpayDdgoFcnVSutxjRgOSFzPwidAjubMncNweqpbxhXGchpZUxuFDOtpnhNUycJICRYqsPhPSCjPTWZFLkstHWJxvdPEAyEIxXgLwbNOjrgzmaujiBABBIXvcXpLrbcEWNNQsbjvgJFgJkflpRohHUutvnaUqoopuKjTDaemDeSdqbnOzcfJpcTuAQtZoiLZOoAIlboFDAeGmSNwkvObPRvRWQgWkGkxwtPauYgdkmypLjbqhlHJIQTntgWjXwZdOyYEdQRRLfMSdnxqppqUofqLbLQDUjwKVKfZJUJQPsWIPwIVaSTrmKskoAhvmZyJgeRpkaTfGgrJzAigcxtfshmiDCFkuiluqtMOkidknnTBtumyJYlIsWLnCQclqdVmikUoMOPdPWwYbJxXyqUVicNxFxyqJTenNblyyKSdlCbiXxUiYU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WwNbeH", msg.GetContent().GetDescription()) - require.Equal(t, "gov", msg.Route()) - require.Equal(t, v1beta1.TypeMsgSubmitProposal, msg.Type()) + require.Equal(t, "cosmos1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7u4x9a0", proposal.Proposer) + require.Equal(t, "2686011stake", proposal.InitialDeposit[0].String()) + msgs, err := proposal.GetMsgs() + require.NoError(t, err) + require.Len(t, msgs, 1) + contentMsg, ok := msgs[0].(*types.MsgContent) + require.True(t, ok) + content := keeper.ContentFromMessage(contentMsg) + require.Equal(t, "title-3: ZBSpYuLyYggwexjxusrBqDOTtGTOWeLrQKjLxzIivHSlcxgdXhhuTSkuxKGLwQvuyNhYFmBZHeAerqyNEUzXPFGkqEGqiQWIXnku", content.GetTitle()) + require.Equal(t, "description-3: NJWzHdBNpAXKJPHWQdrGYcAHSctgVlqwqHoLfHsXUdStwfefwzqLuKEhmMyYLdbZrcPgYqjNHxPexsruwEGStAneKbWkQDDIlCWBLSiAASNhZqNFlPtfqPJoxKsgMdzjWqLWdqKQuJqWPMvwPQWZUtVMOTMYKJbfdlZsjdsomuScvDmbDkgRualsxDvRJuCAmPOXitIbcyWsKGSdrEunFAOdmXnsuyFVgJqEjbklvmwrUlsxjRSfKZxGcpayDdgoFcnVSutxjRgOSFzPwidAjubMncNweqpbxhXGchpZUxuFDOtpnhNUycJICRYqsPhPSCjPTWZFLkstHWJxvdPEAyEIxXgLwbNOjrgzmaujiBABBIXvcXpLrbcEWNNQsbjvgJFgJkflpRohHUutvnaUqoopuKjTDaemDeSdqbnOzcfJpcTuAQtZoiLZOoAIlboFDAeGmSNwkvObPRvRWQgWkGkxwtPauYgdkmypLjbqhlHJIQTntgWjXwZdOyYEdQRRLfMSdnxqppqUofqLbLQDUjwKVKfZJUJQPsWIPwIVaSTrmKskoAhvmZyJgeRpkaTfGgrJzAigcxtfshmiDCFkuiluqtMOkidknnTBtumyJYlIsWLnCQclqdVmikUoMOPdPWwYbJxXyqUVicNxFxyqJTenNblyy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MOXcnQfyzeOcbWwNbeH", content.GetDescription()) + require.Equal(t, "gov", proposal.Route()) + require.Equal(t, "gov", contentMsg.Authority) + require.Equal(t, types.TypeMsgSubmitProposal, proposal.Type()) } // TestSimulateMsgDeposit tests the normal scenario of a valid message of type TypeMsgDeposit. @@ -139,11 +148,13 @@ func TestSimulateMsgDeposit(t *testing.T) { // setup a proposal content := v1beta1.NewTextProposal("Test", "description") + contentMsg, err := keeper.NewContentProposal(content, app.GovKeeper.GetGovernanceAccount(ctx).GetAddress().String()) + require.NoError(t, err) submitTime := ctx.BlockHeader().Time depositPeriod := app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod - proposal, err := v1beta1.NewProposal(content, 1, submitTime, submitTime.Add(depositPeriod)) + proposal, err := types.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod)) require.NoError(t, err) app.GovKeeper.SetProposal(ctx, proposal) @@ -156,15 +167,16 @@ func TestSimulateMsgDeposit(t *testing.T) { operationMsg, _, err := op(r, app.BaseApp, ctx, accounts, "") require.NoError(t, err) - var msg v1beta1.MsgDeposit - v1beta1.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + var msg types.MsgDeposit + types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) require.True(t, operationMsg.OK) require.Equal(t, uint64(1), msg.ProposalId) require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Depositor) - require.Equal(t, "560969stake", msg.Amount.String()) + require.Len(t, msg.Amount, 1) + require.Equal(t, "560969stake", msg.Amount[0].String()) require.Equal(t, "gov", msg.Route()) - require.Equal(t, v1beta1.TypeMsgDeposit, msg.Type()) + require.Equal(t, types.TypeMsgDeposit, msg.Type()) } // TestSimulateMsgVote tests the normal scenario of a valid message of type TypeMsgVote. @@ -180,12 +192,14 @@ func TestSimulateMsgVote(t *testing.T) { accounts := getTestingAccounts(t, r, app, ctx, 3) // setup a proposal - content := v1beta1.NewTextProposal("Test", "description") + govAcc := app.GovKeeper.GetGovernanceAccount(ctx).GetAddress().String() + contentMsg, err := keeper.NewContentProposal(v1beta1.NewTextProposal("Test", "description"), govAcc) + require.NoError(t, err) submitTime := ctx.BlockHeader().Time depositPeriod := app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod - proposal, err := v1beta1.NewProposal(content, 1, submitTime, submitTime.Add(depositPeriod)) + proposal, err := types.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod)) require.NoError(t, err) app.GovKeeper.ActivateVotingPeriod(ctx, proposal) @@ -198,15 +212,15 @@ func TestSimulateMsgVote(t *testing.T) { operationMsg, _, err := op(r, app.BaseApp, ctx, accounts, "") require.NoError(t, err) - var msg v1beta1.MsgVote - v1beta1.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + var msg types.MsgVote + types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) require.True(t, operationMsg.OK) require.Equal(t, uint64(1), msg.ProposalId) require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Voter) - require.Equal(t, v1beta1.OptionYes, msg.Option) + require.Equal(t, types.OptionYes, msg.Option) require.Equal(t, "gov", msg.Route()) - require.Equal(t, v1beta1.TypeMsgVote, msg.Type()) + require.Equal(t, types.TypeMsgVote, msg.Type()) } // TestSimulateMsgVoteWeighted tests the normal scenario of a valid message of type TypeMsgVoteWeighted. @@ -222,12 +236,14 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { accounts := getTestingAccounts(t, r, app, ctx, 3) // setup a proposal - content := v1beta1.NewTextProposal("Test", "description") + govAcc := app.GovKeeper.GetGovernanceAccount(ctx).GetAddress().String() + contentMsg, err := keeper.NewContentProposal(v1beta1.NewTextProposal("Test", "description"), govAcc) + require.NoError(t, err) submitTime := ctx.BlockHeader().Time depositPeriod := app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod - proposal, err := v1beta1.NewProposal(content, 1, submitTime, submitTime.Add(depositPeriod)) + proposal, err := types.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod)) require.NoError(t, err) app.GovKeeper.ActivateVotingPeriod(ctx, proposal) @@ -240,15 +256,15 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { operationMsg, _, err := op(r, app.BaseApp, ctx, accounts, "") require.NoError(t, err) - var msg v1beta1.MsgVoteWeighted - v1beta1.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + var msg types.MsgVoteWeighted + types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) require.True(t, operationMsg.OK) require.Equal(t, uint64(1), msg.ProposalId) require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Voter) require.True(t, len(msg.Options) >= 1) require.Equal(t, "gov", msg.Route()) - require.Equal(t, v1beta1.TypeMsgVoteWeighted, msg.Type()) + require.Equal(t, types.TypeMsgVoteWeighted, msg.Type()) } // returns context and an app with updated mint keeper diff --git a/x/gov/types/codec.go b/x/gov/types/codec.go index 62da2c5b227b..330fa32d99f1 100644 --- a/x/gov/types/codec.go +++ b/x/gov/types/codec.go @@ -11,10 +11,11 @@ import ( // RegisterLegacyAminoCodec registers all the necessary types and interfaces for the // governance module. func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgSubmitProposal{}, "cosmos-sdk/MsgSubmitProposal", nil) - cdc.RegisterConcrete(&MsgDeposit{}, "cosmos-sdk/MsgDeposit", nil) - cdc.RegisterConcrete(&MsgVote{}, "cosmos-sdk/MsgVote", nil) - cdc.RegisterConcrete(&MsgVoteWeighted{}, "cosmos-sdk/MsgVoteWeighted", nil) + cdc.RegisterConcrete(&MsgSubmitProposal{}, "cosmos-sdk/v1beta2/MsgSubmitProposal", nil) + cdc.RegisterConcrete(&MsgDeposit{}, "cosmos-sdk/v1beta2/MsgDeposit", nil) + cdc.RegisterConcrete(&MsgVote{}, "cosmos-sdk/v1beta2/MsgVote", nil) + cdc.RegisterConcrete(&MsgVoteWeighted{}, "cosmos-sdk/v1beta2/MsgVoteWeighted", nil) + cdc.RegisterConcrete(&MsgContent{}, "cosmos-sdk/v1beta2/MsgContent", nil) } func RegisterInterfaces(registry types.InterfaceRegistry) { @@ -23,6 +24,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &MsgVote{}, &MsgVoteWeighted{}, &MsgDeposit{}, + &MsgContent{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/gov/types/errors.go b/x/gov/types/errors.go index 386f79ab35d4..0f51ecf6f52b 100644 --- a/x/gov/types/errors.go +++ b/x/gov/types/errors.go @@ -9,7 +9,7 @@ var ( ErrUnknownProposal = sdkerrors.Register(ModuleName, 2, "unknown proposal") ErrInactiveProposal = sdkerrors.Register(ModuleName, 3, "inactive proposal") ErrAlreadyActiveProposal = sdkerrors.Register(ModuleName, 4, "proposal already active") - // Errors 5 & 6 are reserved as legacy errors + // Errors 5, 6 & 7 are reserved as legacy errors // See x/gov/types/v1beta1/errors.go ErrInvalidGenesis = sdkerrors.Register(ModuleName, 8, "invalid genesis state") ErrNoProposalHandlerExists = sdkerrors.Register(ModuleName, 9, "no handler exists for proposal type") diff --git a/x/gov/types/proposal.go b/x/gov/types/proposal.go index e4985a077a81..902f1d014784 100644 --- a/x/gov/types/proposal.go +++ b/x/gov/types/proposal.go @@ -56,7 +56,7 @@ func (p Proposal) UnpackInterfaces(unpacker types.AnyUnpacker) error { } // Proposals is an array of proposal -type Proposals []Proposal +type Proposals []*Proposal var _ types.UnpackInterfacesMessage = Proposals{} diff --git a/x/gov/types/v1beta1/errors.go b/x/gov/types/v1beta1/errors.go index c7ad74a728f0..3dfdf853b2ca 100644 --- a/x/gov/types/v1beta1/errors.go +++ b/x/gov/types/v1beta1/errors.go @@ -5,9 +5,7 @@ import ( ) var ( - // Deprecated ErrInvalidProposalContent = sdkerrors.Register(ModuleName, 5, "invalid proposal content") - // Deprecated ErrInvalidProposalType = sdkerrors.Register(ModuleName, 6, "invalid proposal type") ErrInvalidVote = sdkerrors.Register(ModuleName, 7, "invalid vote option") ) diff --git a/x/gov/types/v1beta1/params.go b/x/gov/types/v1beta1/params.go index f9c90b251357..98f9b0390cbd 100644 --- a/x/gov/types/v1beta1/params.go +++ b/x/gov/types/v1beta1/params.go @@ -7,7 +7,6 @@ import ( "sigs.k8s.io/yaml" sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) // Default period for deposits & voting @@ -23,22 +22,6 @@ var ( DefaultVetoThreshold = sdk.NewDecWithPrec(334, 3) ) -// Parameter store key -var ( - ParamStoreKeyDepositParams = []byte("depositparams") - ParamStoreKeyVotingParams = []byte("votingparams") - ParamStoreKeyTallyParams = []byte("tallyparams") -) - -// ParamKeyTable - Key declaration for parameters -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable( - paramtypes.NewParamSetPair(ParamStoreKeyDepositParams, DepositParams{}, validateDepositParams), - paramtypes.NewParamSetPair(ParamStoreKeyVotingParams, VotingParams{}, validateVotingParams), - paramtypes.NewParamSetPair(ParamStoreKeyTallyParams, TallyParams{}, validateTallyParams), - ) -} - // NewDepositParams creates a new DepositParams object func NewDepositParams(minDeposit sdk.Coins, maxDepositPeriod time.Duration) DepositParams { return DepositParams{ diff --git a/x/params/proposal_handler_test.go b/x/params/proposal_handler_test.go index 572e1adfd86f..7fe9e59b013d 100644 --- a/x/params/proposal_handler_test.go +++ b/x/params/proposal_handler_test.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" + gov "github.com/cosmos/cosmos-sdk/x/gov/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/params" "github.com/cosmos/cosmos-sdk/x/params/types/proposal" @@ -62,8 +63,8 @@ func (suite *HandlerTestSuite) TestProposalHandler() { { "omit empty fields", testProposal(proposal.ParamChange{ - Subspace: govtypes.ModuleName, - Key: string(govtypes.ParamStoreKeyDepositParams), + Subspace: gov.ModuleName, + Key: string(gov.ParamStoreKeyDepositParams), Value: `{"min_deposit": [{"denom": "uatom","amount": "64000000"}]}`, }), func() { From b3b859af2c6d2e0237f28802ed6baf3c1763b26d Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Tue, 4 Jan 2022 12:44:29 +0100 Subject: [PATCH 03/39] go fmt --- x/gov/common_test.go | 2 +- x/gov/keeper/keeper.go | 2 +- x/gov/keeper/proposal.go | 6 +++--- x/gov/types/v1beta1/errors.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/x/gov/common_test.go b/x/gov/common_test.go index efeddc3c004e..b7134cd1859e 100644 --- a/x/gov/common_test.go +++ b/x/gov/common_test.go @@ -14,7 +14,7 @@ import ( var ( valTokens = sdk.TokensFromConsensusPower(42, sdk.DefaultPowerReduction) - TestLegacyProposal = v1beta1.NewTextProposal("Test", "description") + TestLegacyProposal = v1beta1.NewTextProposal("Test", "description") TestDescription = stakingtypes.NewDescription("T", "E", "S", "T", "Z") TestCommissionRates = stakingtypes.NewCommissionRates(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()) ) diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 33b874cef19a..425c560b2f65 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -93,7 +93,7 @@ func (keeper Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", "x/"+types.ModuleName) } -// Router returns the gov keeper's router +// Router returns the gov keeper's router func (keeper Keeper) Router() *middleware.MsgServiceRouter { return keeper.router } diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index b7d9ab4e9669..1f29effcb2c8 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -51,8 +51,8 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg) (types. return types.Proposal{}, sdkerrors.Wrap(v1beta1.ErrInvalidProposalContent, err.Error()) } - // for all other message types use the msg service router to see that there is a valid route for that - // message. NOTE: we do not verify the proposal messages any further. They may fail upon execution + // for all other message types use the msg service router to see that there is a valid route for that + // message. NOTE: we do not verify the proposal messages any further. They may fail upon execution } else if keeper.router.Handler(msg) == nil { return types.Proposal{}, sdkerrors.Wrap(types.ErrUnroutableProposalMsg, sdk.MsgTypeURL(msg)) } @@ -274,4 +274,4 @@ func ContentFromMessage(msg *types.MsgContent) v1beta1.Content { return nil } return content -} \ No newline at end of file +} diff --git a/x/gov/types/v1beta1/errors.go b/x/gov/types/v1beta1/errors.go index 3dfdf853b2ca..a24e10d6b39a 100644 --- a/x/gov/types/v1beta1/errors.go +++ b/x/gov/types/v1beta1/errors.go @@ -6,6 +6,6 @@ import ( var ( ErrInvalidProposalContent = sdkerrors.Register(ModuleName, 5, "invalid proposal content") - ErrInvalidProposalType = sdkerrors.Register(ModuleName, 6, "invalid proposal type") - ErrInvalidVote = sdkerrors.Register(ModuleName, 7, "invalid vote option") + ErrInvalidProposalType = sdkerrors.Register(ModuleName, 6, "invalid proposal type") + ErrInvalidVote = sdkerrors.Register(ModuleName, 7, "invalid vote option") ) From 79c7a64d64171e5aa7ccd655c7c5a76a45fdd48f Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Tue, 4 Jan 2022 14:05:41 +0100 Subject: [PATCH 04/39] add proposal test and nil check --- x/gov/keeper/proposal.go | 3 +++ x/gov/keeper/proposal_test.go | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 1f29effcb2c8..5fc57bcdda0a 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -36,6 +36,9 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg) (types. // check if the message wraps the legacy content type if contentMsg, ok := msg.(*types.MsgContent); ok { content := ContentFromMessage(contentMsg) + if content == nil { + return types.Proposal{}, sdkerrors.Wrap(v1beta1.ErrInvalidProposalContent, "content is nil") + } // if so ensure that the content has a respective handler if !keeper.legacyRouter.HasRoute(content.ProposalRoute()) { diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index ac635b993c18..bd3b45962871 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -4,8 +4,11 @@ import ( "errors" "fmt" "strings" + "testing" "time" + "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -129,3 +132,11 @@ func (suite *KeeperTestSuite) TestGetProposalsFiltered() { }) } } + +func TestMigrateProposalMessages(t *testing.T) { + content := v1beta1.NewTextProposal("Test", "description") + contentMsg, err := keeper.NewContentProposal(content, sdk.AccAddress("test1").String()) + require.NoError(t, err) + content = keeper.ContentFromMessage(contentMsg) + require.NotNil(t, content) +} \ No newline at end of file From 099a3c2917c01d28dda8551d251f9c9c1939d277 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Fri, 7 Jan 2022 14:02:27 +0100 Subject: [PATCH 05/39] resolve merge conflicts --- x/gov/abci.go | 11 +- x/gov/abci_test.go | 23 +-- x/gov/genesis.go | 11 +- x/gov/genesis_test.go | 9 +- x/gov/keeper/deposit.go | 37 ++--- x/gov/keeper/grpc_query.go | 67 ++++---- x/gov/keeper/grpc_query_test.go | 230 ++++++++++++++-------------- x/gov/keeper/hooks_test.go | 3 +- x/gov/keeper/invariants.go | 3 +- x/gov/keeper/keeper.go | 5 +- x/gov/keeper/keeper_test.go | 7 +- x/gov/keeper/msg_server.go | 49 +++--- x/gov/keeper/params.go | 19 ++- x/gov/keeper/proposal.go | 63 ++++---- x/gov/keeper/proposal_test.go | 39 ++--- x/gov/keeper/querier.go | 2 +- x/gov/keeper/querier_test.go | 31 ++-- x/gov/keeper/tally.go | 30 ++-- x/gov/keeper/tally_test.go | 136 ++++++++-------- x/gov/keeper/vote.go | 35 +++-- x/gov/keeper/vote_test.go | 48 +++--- x/gov/module.go | 15 +- x/gov/simulation/operations.go | 79 +++++----- x/gov/simulation/operations_test.go | 13 +- 24 files changed, 491 insertions(+), 474 deletions(-) diff --git a/x/gov/abci.go b/x/gov/abci.go index 85a2326b5e92..62c72d0257e9 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -8,6 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) // EndBlocker called every block, process inflation, update validator set. @@ -17,7 +18,7 @@ func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) { logger := keeper.Logger(ctx) // delete dead proposals from store and burn theirs deposits. A proposal is dead when it's inactive and didn't get enough deposit on time to get into voting phase. - keeper.IterateInactiveProposalsQueue(ctx, ctx.BlockHeader().Time, func(proposal types.Proposal) bool { + keeper.IterateInactiveProposalsQueue(ctx, ctx.BlockHeader().Time, func(proposal v1beta2.Proposal) bool { keeper.DeleteProposal(ctx, proposal.ProposalId) keeper.DeleteAndBurnDeposits(ctx, proposal.ProposalId) @@ -43,7 +44,7 @@ func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) { }) // fetch active proposals whose voting periods have ended (are passed the block time) - keeper.IterateActiveProposalsQueue(ctx, ctx.BlockHeader().Time, func(proposal types.Proposal) bool { + keeper.IterateActiveProposalsQueue(ctx, ctx.BlockHeader().Time, func(proposal v1beta2.Proposal) bool { var tagValue, logMsg string passes, burnDeposits, tallyResults := keeper.Tally(ctx, proposal) @@ -79,7 +80,7 @@ func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) { } if err == nil { - proposal.Status = types.StatusPassed + proposal.Status = v1beta2.StatusPassed tagValue = types.AttributeValueProposalPassed logMsg = "passed" @@ -92,12 +93,12 @@ func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) { // write state to the underlying multi-store writeCache() } else { - proposal.Status = types.StatusFailed + proposal.Status = v1beta2.StatusFailed tagValue = types.AttributeValueProposalFailed logMsg = fmt.Sprintf("passed, but msg %d failed on execution: %s", idx, err) } } else { - proposal.Status = types.StatusRejected + proposal.Status = v1beta2.StatusRejected tagValue = types.AttributeValueProposalRejected logMsg = "rejected" } diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 61060b6d6cf7..adea517eca4f 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -13,6 +13,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -32,7 +33,7 @@ func TestTickExpiredDepositPeriod(t *testing.T) { require.False(t, inactiveQueue.Valid()) inactiveQueue.Close() - newProposalMsg, err := types.NewMsgSubmitProposal( + newProposalMsg, err := v1beta2.NewMsgSubmitProposal( []sdk.Msg{}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0], @@ -84,7 +85,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { require.False(t, inactiveQueue.Valid()) inactiveQueue.Close() - newProposalMsg, err := types.NewMsgSubmitProposal( + newProposalMsg, err := v1beta2.NewMsgSubmitProposal( []sdk.Msg{}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0], @@ -107,7 +108,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { require.False(t, inactiveQueue.Valid()) inactiveQueue.Close() - newProposalMsg2, err := types.NewMsgSubmitProposal( + newProposalMsg2, err := v1beta2.NewMsgSubmitProposal( []sdk.Msg{}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0], @@ -164,7 +165,7 @@ func TestTickPassedDepositPeriod(t *testing.T) { require.False(t, activeQueue.Valid()) activeQueue.Close() - newProposalMsg, err := types.NewMsgSubmitProposal( + newProposalMsg, err := v1beta2.NewMsgSubmitProposal( []sdk.Msg{}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0], @@ -189,7 +190,7 @@ func TestTickPassedDepositPeriod(t *testing.T) { require.False(t, inactiveQueue.Valid()) inactiveQueue.Close() - newDepositMsg := types.NewMsgDeposit(addrs[1], proposalID, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}) + newDepositMsg := v1beta2.NewMsgDeposit(addrs[1], proposalID, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}) res1, err := govMsgSvr.Deposit(sdk.WrapSDKContext(ctx), newDepositMsg) require.NoError(t, err) @@ -220,7 +221,7 @@ func TestTickPassedVotingPeriod(t *testing.T) { activeQueue.Close() proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 5))} - newProposalMsg, err := types.NewMsgSubmitProposal([]sdk.Msg{}, proposalCoins, addrs[0]) + newProposalMsg, err := v1beta2.NewMsgSubmitProposal([]sdk.Msg{}, proposalCoins, addrs[0]) require.NoError(t, err) wrapCtx := sdk.WrapSDKContext(ctx) @@ -235,7 +236,7 @@ func TestTickPassedVotingPeriod(t *testing.T) { newHeader.Time = ctx.BlockHeader().Time.Add(time.Duration(1) * time.Second) ctx = ctx.WithBlockHeader(newHeader) - newDepositMsg := types.NewMsgDeposit(addrs[1], proposalID, proposalCoins) + newDepositMsg := v1beta2.NewMsgDeposit(addrs[1], proposalID, proposalCoins) res1, err := govMsgSvr.Deposit(wrapCtx, newDepositMsg) require.NoError(t, err) @@ -292,7 +293,7 @@ func TestProposalPassedEndblocker(t *testing.T) { require.NoError(t, err) proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 10))} - newDepositMsg := types.NewMsgDeposit(addrs[0], proposal.ProposalId, proposalCoins) + newDepositMsg := v1beta2.NewMsgDeposit(addrs[0], proposal.ProposalId, proposalCoins) res, err := govMsgSvr.Deposit(sdk.WrapSDKContext(ctx), newDepositMsg) require.NoError(t, err) @@ -305,7 +306,7 @@ func TestProposalPassedEndblocker(t *testing.T) { deposits := initialModuleAccCoins.Add(proposal.TotalDeposit...).Add(proposalCoins...) require.True(t, moduleAccCoins.IsEqual(deposits)) - err = app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], types.NewNonSplitVoteOption(types.OptionYes)) + err = app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)) require.NoError(t, err) newHeader := ctx.BlockHeader() @@ -342,14 +343,14 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) { require.NoError(t, err) proposalCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 10))) - newDepositMsg := types.NewMsgDeposit(addrs[0], proposal.ProposalId, proposalCoins) + newDepositMsg := v1beta2.NewMsgDeposit(addrs[0], proposal.ProposalId, proposalCoins) govMsgSvr := keeper.NewMsgServerImpl(app.GovKeeper) res, err := govMsgSvr.Deposit(sdk.WrapSDKContext(ctx), newDepositMsg) require.NoError(t, err) require.NotNil(t, res) - err = app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], types.NewNonSplitVoteOption(types.OptionYes)) + err = app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)) require.NoError(t, err) newHeader := ctx.BlockHeader() diff --git a/x/gov/genesis.go b/x/gov/genesis.go index 8d40949a5514..2d9aa93aaaf7 100644 --- a/x/gov/genesis.go +++ b/x/gov/genesis.go @@ -6,10 +6,11 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) // InitGenesis - store genesis parameters -func InitGenesis(ctx sdk.Context, ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper, data *types.GenesisState) { +func InitGenesis(ctx sdk.Context, ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper, data *v1beta2.GenesisState) { k.SetProposalID(ctx, data.StartingProposalId) k.SetDepositParams(ctx, *data.DepositParams) k.SetVotingParams(ctx, *data.VotingParams) @@ -54,15 +55,15 @@ func InitGenesis(ctx sdk.Context, ak types.AccountKeeper, bk types.BankKeeper, k } // ExportGenesis - output genesis parameters -func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *v1beta2.GenesisState { startingProposalID, _ := k.GetProposalID(ctx) depositParams := k.GetDepositParams(ctx) votingParams := k.GetVotingParams(ctx) tallyParams := k.GetTallyParams(ctx) proposals := k.GetProposals(ctx) - var proposalsDeposits types.Deposits - var proposalsVotes types.Votes + var proposalsDeposits v1beta2.Deposits + var proposalsVotes v1beta2.Votes for _, proposal := range proposals { deposits := k.GetDeposits(ctx, proposal.ProposalId) proposalsDeposits = append(proposalsDeposits, deposits...) @@ -71,7 +72,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { proposalsVotes = append(proposalsVotes, votes...) } - return &types.GenesisState{ + return &v1beta2.GenesisState{ StartingProposalId: startingProposalID, Deposits: proposalsDeposits, Votes: proposalsVotes, diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index 6a12bdf39a41..4dded212054a 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -18,6 +18,7 @@ import ( distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/gov" "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" "github.com/cosmos/cosmos-sdk/x/staking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -51,8 +52,8 @@ func TestImportExportQueues(t *testing.T) { require.True(t, ok) proposal2, ok = app.GovKeeper.GetProposal(ctx, proposalID2) require.True(t, ok) - require.True(t, proposal1.Status == types.StatusDepositPeriod) - require.True(t, proposal2.Status == types.StatusVotingPeriod) + require.True(t, proposal1.Status == v1beta2.StatusDepositPeriod) + require.True(t, proposal2.Status == v1beta2.StatusVotingPeriod) authGenState := auth.ExportGenesis(ctx, app.AccountKeeper) bankGenState := app.BankKeeper.ExportGenesis(ctx) @@ -122,8 +123,8 @@ func TestImportExportQueues_ErrorUnconsistentState(t *testing.T) { app := simapp.Setup(t, false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) require.Panics(t, func() { - gov.InitGenesis(ctx, app.AccountKeeper, app.BankKeeper, app.GovKeeper, &types.GenesisState{ - Deposits: types.Deposits{ + gov.InitGenesis(ctx, app.AccountKeeper, app.BankKeeper, app.GovKeeper, &v1beta2.GenesisState{ + Deposits: v1beta2.Deposits{ { ProposalId: 1234, Depositor: "me", diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index 5d81e91bc098..24238dde2d01 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -6,10 +6,11 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) // GetDeposit gets the deposit of a specific depositor on a specific proposal -func (keeper Keeper) GetDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress) (deposit types.Deposit, found bool) { +func (keeper Keeper) GetDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress) (deposit v1beta2.Deposit, found bool) { store := ctx.KVStore(keeper.storeKey) bz := store.Get(types.DepositKey(proposalID, depositorAddr)) if bz == nil { @@ -22,7 +23,7 @@ func (keeper Keeper) GetDeposit(ctx sdk.Context, proposalID uint64, depositorAdd } // SetDeposit sets a Deposit to the gov store -func (keeper Keeper) SetDeposit(ctx sdk.Context, deposit types.Deposit) { +func (keeper Keeper) SetDeposit(ctx sdk.Context, deposit v1beta2.Deposit) { store := ctx.KVStore(keeper.storeKey) bz := keeper.cdc.MustMarshal(&deposit) depositor, err := sdk.AccAddressFromBech32(deposit.Depositor) @@ -34,8 +35,8 @@ func (keeper Keeper) SetDeposit(ctx sdk.Context, deposit types.Deposit) { } // GetAllDeposits returns all the deposits from the store -func (keeper Keeper) GetAllDeposits(ctx sdk.Context) (deposits types.Deposits) { - keeper.IterateAllDeposits(ctx, func(deposit types.Deposit) bool { +func (keeper Keeper) GetAllDeposits(ctx sdk.Context) (deposits v1beta2.Deposits) { + keeper.IterateAllDeposits(ctx, func(deposit v1beta2.Deposit) bool { deposits = append(deposits, &deposit) return false }) @@ -44,8 +45,8 @@ func (keeper Keeper) GetAllDeposits(ctx sdk.Context) (deposits types.Deposits) { } // GetDeposits returns all the deposits from a proposal -func (keeper Keeper) GetDeposits(ctx sdk.Context, proposalID uint64) (deposits types.Deposits) { - keeper.IterateDeposits(ctx, proposalID, func(deposit types.Deposit) bool { +func (keeper Keeper) GetDeposits(ctx sdk.Context, proposalID uint64) (deposits v1beta2.Deposits) { + keeper.IterateDeposits(ctx, proposalID, func(deposit v1beta2.Deposit) bool { deposits = append(deposits, &deposit) return false }) @@ -57,8 +58,8 @@ func (keeper Keeper) GetDeposits(ctx sdk.Context, proposalID uint64) (deposits t func (keeper Keeper) DeleteAndBurnDeposits(ctx sdk.Context, proposalID uint64) { store := ctx.KVStore(keeper.storeKey) - keeper.IterateDeposits(ctx, proposalID, func(deposit types.Deposit) bool { - err := keeper.bankKeeper.BurnCoins(ctx, types.ModuleName, deposit.Amount) + keeper.IterateDeposits(ctx, proposalID, func(deposit v1beta2.Deposit) bool { + err := keeper.bankKeeper.BurnCoins(ctx, v1beta2.ModuleName, deposit.Amount) if err != nil { panic(err) } @@ -73,14 +74,14 @@ func (keeper Keeper) DeleteAndBurnDeposits(ctx sdk.Context, proposalID uint64) { } // IterateAllDeposits iterates over the all the stored deposits and performs a callback function -func (keeper Keeper) IterateAllDeposits(ctx sdk.Context, cb func(deposit types.Deposit) (stop bool)) { +func (keeper Keeper) IterateAllDeposits(ctx sdk.Context, cb func(deposit v1beta2.Deposit) (stop bool)) { store := ctx.KVStore(keeper.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.DepositsKeyPrefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - var deposit types.Deposit + var deposit v1beta2.Deposit keeper.cdc.MustUnmarshal(iterator.Value(), &deposit) @@ -91,14 +92,14 @@ func (keeper Keeper) IterateAllDeposits(ctx sdk.Context, cb func(deposit types.D } // IterateDeposits iterates over the all the proposals deposits and performs a callback function -func (keeper Keeper) IterateDeposits(ctx sdk.Context, proposalID uint64, cb func(deposit types.Deposit) (stop bool)) { +func (keeper Keeper) IterateDeposits(ctx sdk.Context, proposalID uint64, cb func(deposit v1beta2.Deposit) (stop bool)) { store := ctx.KVStore(keeper.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.DepositsKey(proposalID)) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - var deposit types.Deposit + var deposit v1beta2.Deposit keeper.cdc.MustUnmarshal(iterator.Value(), &deposit) @@ -118,12 +119,12 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd } // Check if proposal is still depositable - if (proposal.Status != types.StatusDepositPeriod) && (proposal.Status != types.StatusVotingPeriod) { + if (proposal.Status != v1beta2.StatusDepositPeriod) && (proposal.Status != v1beta2.StatusVotingPeriod) { return false, sdkerrors.Wrapf(types.ErrInactiveProposal, "%d", proposalID) } // update the governance module's account coins pool - err := keeper.bankKeeper.SendCoinsFromAccountToModule(ctx, depositorAddr, types.ModuleName, depositAmount) + err := keeper.bankKeeper.SendCoinsFromAccountToModule(ctx, depositorAddr, v1beta2.ModuleName, depositAmount) if err != nil { return false, err } @@ -135,7 +136,7 @@ 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 - if proposal.Status == types.StatusDepositPeriod && sdk.NewCoins(proposal.TotalDeposit...).IsAllGTE(keeper.GetDepositParams(ctx).MinDeposit) { + if proposal.Status == v1beta2.StatusDepositPeriod && sdk.NewCoins(proposal.TotalDeposit...).IsAllGTE(keeper.GetDepositParams(ctx).MinDeposit) { keeper.ActivateVotingPeriod(ctx, proposal) activatedVotingPeriod = true @@ -147,7 +148,7 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd if found { deposit.Amount = sdk.NewCoins(deposit.Amount...).Add(depositAmount...) } else { - deposit = types.NewDeposit(proposalID, depositorAddr, depositAmount) + deposit = v1beta2.NewDeposit(proposalID, depositorAddr, depositAmount) } // called when deposit has been added to a proposal, however the proposal may not be active @@ -170,13 +171,13 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd func (keeper Keeper) RefundAndDeleteDeposits(ctx sdk.Context, proposalID uint64) { store := ctx.KVStore(keeper.storeKey) - keeper.IterateDeposits(ctx, proposalID, func(deposit types.Deposit) bool { + keeper.IterateDeposits(ctx, proposalID, func(deposit v1beta2.Deposit) bool { depositor, err := sdk.AccAddressFromBech32(deposit.Depositor) if err != nil { panic(err) } - err = keeper.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositor, deposit.Amount) + err = keeper.bankKeeper.SendCoinsFromModuleToAccount(ctx, v1beta2.ModuleName, depositor, deposit.Amount) if err != nil { panic(err) } diff --git a/x/gov/keeper/grpc_query.go b/x/gov/keeper/grpc_query.go index 719935017603..41f058d7ba1f 100644 --- a/x/gov/keeper/grpc_query.go +++ b/x/gov/keeper/grpc_query.go @@ -10,12 +10,13 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) -var _ types.QueryServer = Keeper{} +var _ v1beta2.QueryServer = Keeper{} // Proposal returns proposal details based on ProposalID -func (q Keeper) Proposal(c context.Context, req *types.QueryProposalRequest) (*types.QueryProposalResponse, error) { +func (q Keeper) Proposal(c context.Context, req *v1beta2.QueryProposalRequest) (*v1beta2.QueryProposalResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -31,19 +32,19 @@ func (q Keeper) Proposal(c context.Context, req *types.QueryProposalRequest) (*t return nil, status.Errorf(codes.NotFound, "proposal %d doesn't exist", req.ProposalId) } - return &types.QueryProposalResponse{Proposal: &proposal}, nil + return &v1beta2.QueryProposalResponse{Proposal: &proposal}, nil } // Proposals implements the Query/Proposals gRPC method -func (q Keeper) Proposals(c context.Context, req *types.QueryProposalsRequest) (*types.QueryProposalsResponse, error) { - var filteredProposals []*types.Proposal +func (q Keeper) Proposals(c context.Context, req *v1beta2.QueryProposalsRequest) (*v1beta2.QueryProposalsResponse, error) { + var filteredProposals []*v1beta2.Proposal ctx := sdk.UnwrapSDKContext(c) store := ctx.KVStore(q.storeKey) proposalStore := prefix.NewStore(store, types.ProposalsKeyPrefix) pageRes, err := query.FilteredPaginate(proposalStore, req.Pagination, func(key []byte, value []byte, accumulate bool) (bool, error) { - var p types.Proposal + var p v1beta2.Proposal if err := q.cdc.Unmarshal(value, &p); err != nil { return false, status.Error(codes.Internal, err.Error()) } @@ -51,7 +52,7 @@ func (q Keeper) Proposals(c context.Context, req *types.QueryProposalsRequest) ( matchVoter, matchDepositor, matchStatus := true, true, true // match status (if supplied/valid) - if types.ValidProposalStatus(req.ProposalStatus) { + if v1beta2.ValidProposalStatus(req.ProposalStatus) { matchStatus = p.Status == req.ProposalStatus } @@ -89,11 +90,11 @@ func (q Keeper) Proposals(c context.Context, req *types.QueryProposalsRequest) ( return nil, status.Error(codes.Internal, err.Error()) } - return &types.QueryProposalsResponse{Proposals: filteredProposals, Pagination: pageRes}, nil + return &v1beta2.QueryProposalsResponse{Proposals: filteredProposals, Pagination: pageRes}, nil } // Vote returns Voted information based on proposalID, voterAddr -func (q Keeper) Vote(c context.Context, req *types.QueryVoteRequest) (*types.QueryVoteResponse, error) { +func (q Keeper) Vote(c context.Context, req *v1beta2.QueryVoteRequest) (*v1beta2.QueryVoteResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -118,11 +119,11 @@ func (q Keeper) Vote(c context.Context, req *types.QueryVoteRequest) (*types.Que "voter: %v not found for proposal: %v", req.Voter, req.ProposalId) } - return &types.QueryVoteResponse{Vote: &vote}, nil + return &v1beta2.QueryVoteResponse{Vote: &vote}, nil } // Votes returns single proposal's votes -func (q Keeper) Votes(c context.Context, req *types.QueryVotesRequest) (*types.QueryVotesResponse, error) { +func (q Keeper) Votes(c context.Context, req *v1beta2.QueryVotesRequest) (*v1beta2.QueryVotesResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -131,14 +132,14 @@ func (q Keeper) Votes(c context.Context, req *types.QueryVotesRequest) (*types.Q return nil, status.Error(codes.InvalidArgument, "proposal id can not be 0") } - var votes types.Votes + var votes v1beta2.Votes ctx := sdk.UnwrapSDKContext(c) store := ctx.KVStore(q.storeKey) votesStore := prefix.NewStore(store, types.VotesKey(req.ProposalId)) pageRes, err := query.Paginate(votesStore, req.Pagination, func(key []byte, value []byte) error { - var vote *types.Vote + var vote *v1beta2.Vote if err := q.cdc.Unmarshal(value, vote); err != nil { return err } @@ -152,11 +153,11 @@ func (q Keeper) Votes(c context.Context, req *types.QueryVotesRequest) (*types.Q return nil, status.Error(codes.Internal, err.Error()) } - return &types.QueryVotesResponse{Votes: votes, Pagination: pageRes}, nil + return &v1beta2.QueryVotesResponse{Votes: votes, Pagination: pageRes}, nil } // Params queries all params -func (q Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { +func (q Keeper) Params(c context.Context, req *v1beta2.QueryParamsRequest) (*v1beta2.QueryParamsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -164,17 +165,17 @@ func (q Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types ctx := sdk.UnwrapSDKContext(c) switch req.ParamsType { - case types.ParamDeposit: + case v1beta2.ParamDeposit: depositParmas := q.GetDepositParams(ctx) - return &types.QueryParamsResponse{DepositParams: &depositParmas}, nil + return &v1beta2.QueryParamsResponse{DepositParams: &depositParmas}, nil - case types.ParamVoting: + case v1beta2.ParamVoting: votingParmas := q.GetVotingParams(ctx) - return &types.QueryParamsResponse{VotingParams: &votingParmas}, nil + return &v1beta2.QueryParamsResponse{VotingParams: &votingParmas}, nil - case types.ParamTallying: + case v1beta2.ParamTallying: tallyParams := q.GetTallyParams(ctx) - return &types.QueryParamsResponse{TallyParams: &tallyParams}, nil + return &v1beta2.QueryParamsResponse{TallyParams: &tallyParams}, nil default: return nil, status.Errorf(codes.InvalidArgument, @@ -183,7 +184,7 @@ func (q Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types } // Deposit queries single deposit information based proposalID, depositAddr -func (q Keeper) Deposit(c context.Context, req *types.QueryDepositRequest) (*types.QueryDepositResponse, error) { +func (q Keeper) Deposit(c context.Context, req *v1beta2.QueryDepositRequest) (*v1beta2.QueryDepositResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -208,11 +209,11 @@ func (q Keeper) Deposit(c context.Context, req *types.QueryDepositRequest) (*typ "depositer: %v not found for proposal: %v", req.Depositor, req.ProposalId) } - return &types.QueryDepositResponse{Deposit: &deposit}, nil + return &v1beta2.QueryDepositResponse{Deposit: &deposit}, nil } // Deposits returns single proposal's all deposits -func (q Keeper) Deposits(c context.Context, req *types.QueryDepositsRequest) (*types.QueryDepositsResponse, error) { +func (q Keeper) Deposits(c context.Context, req *v1beta2.QueryDepositsRequest) (*v1beta2.QueryDepositsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -221,14 +222,14 @@ func (q Keeper) Deposits(c context.Context, req *types.QueryDepositsRequest) (*t return nil, status.Error(codes.InvalidArgument, "proposal id can not be 0") } - var deposits []*types.Deposit + var deposits []*v1beta2.Deposit ctx := sdk.UnwrapSDKContext(c) store := ctx.KVStore(q.storeKey) depositStore := prefix.NewStore(store, types.DepositsKey(req.ProposalId)) pageRes, err := query.Paginate(depositStore, req.Pagination, func(key []byte, value []byte) error { - var deposit *types.Deposit + var deposit *v1beta2.Deposit if err := q.cdc.Unmarshal(value, deposit); err != nil { return err } @@ -241,11 +242,11 @@ func (q Keeper) Deposits(c context.Context, req *types.QueryDepositsRequest) (*t return nil, status.Error(codes.Internal, err.Error()) } - return &types.QueryDepositsResponse{Deposits: deposits, Pagination: pageRes}, nil + return &v1beta2.QueryDepositsResponse{Deposits: deposits, Pagination: pageRes}, nil } // TallyResult queries the tally of a proposal vote -func (q Keeper) TallyResult(c context.Context, req *types.QueryTallyResultRequest) (*types.QueryTallyResultResponse, error) { +func (q Keeper) TallyResult(c context.Context, req *v1beta2.QueryTallyResultRequest) (*v1beta2.QueryTallyResultResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } @@ -261,13 +262,13 @@ func (q Keeper) TallyResult(c context.Context, req *types.QueryTallyResultReques return nil, status.Errorf(codes.NotFound, "proposal %d doesn't exist", req.ProposalId) } - var tallyResult types.TallyResult + var tallyResult v1beta2.TallyResult switch { - case proposal.Status == types.StatusDepositPeriod: - tallyResult = types.EmptyTallyResult() + case proposal.Status == v1beta2.StatusDepositPeriod: + tallyResult = v1beta2.EmptyTallyResult() - case proposal.Status == types.StatusPassed || proposal.Status == types.StatusRejected: + case proposal.Status == v1beta2.StatusPassed || proposal.Status == v1beta2.StatusRejected: tallyResult = *proposal.FinalTallyResult default: @@ -275,5 +276,5 @@ func (q Keeper) TallyResult(c context.Context, req *types.QueryTallyResultReques _, _, tallyResult = q.Tally(ctx, proposal) } - return &types.QueryTallyResultResponse{Tally: &tallyResult}, nil + return &v1beta2.QueryTallyResultResponse{Tally: &tallyResult}, nil } diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 9312622e84e0..e169a09f2f70 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -7,15 +7,15 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) func (suite *KeeperTestSuite) TestGRPCQueryProposal() { app, ctx, queryClient := suite.app, suite.ctx, suite.queryClient var ( - req *types.QueryProposalRequest - expProposal types.Proposal + req *v1beta2.QueryProposalRequest + expProposal v1beta2.Proposal ) testCases := []struct { @@ -26,28 +26,28 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposal() { { "empty request", func() { - req = &types.QueryProposalRequest{} + req = &v1beta2.QueryProposalRequest{} }, false, }, { "non existing proposal request", func() { - req = &types.QueryProposalRequest{ProposalId: 3} + req = &v1beta2.QueryProposalRequest{ProposalId: 3} }, false, }, { "zero proposal id request", func() { - req = &types.QueryProposalRequest{ProposalId: 0} + req = &v1beta2.QueryProposalRequest{ProposalId: 0} }, false, }, { "valid request", func() { - req = &types.QueryProposalRequest{ProposalId: 1} + req = &v1beta2.QueryProposalRequest{ProposalId: 1} submittedProposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{}) suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) @@ -78,11 +78,11 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposal() { func (suite *KeeperTestSuite) TestGRPCQueryProposals() { app, ctx, queryClient, addrs := suite.app, suite.ctx, suite.queryClient, suite.addrs - testProposals := []*types.Proposal{} + testProposals := []*v1beta2.Proposal{} var ( - req *types.QueryProposalsRequest - expRes *types.QueryProposalsResponse + req *v1beta2.QueryProposalsRequest + expRes *v1beta2.QueryProposalsResponse ) testCases := []struct { @@ -93,7 +93,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { { "empty state request", func() { - req = &types.QueryProposalsRequest{} + req = &v1beta2.QueryProposalsRequest{} }, true, }, @@ -104,7 +104,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { for i := 0; i < 5; i++ { govAddress := app.GovKeeper.GetGovernanceAccount(suite.ctx).GetAddress() testProposal := []sdk.Msg{ - types.NewMsgVote(govAddress, uint64(i), types.OptionYes), + v1beta2.NewMsgVote(govAddress, uint64(i), v1beta2.OptionYes), } proposal, err := app.GovKeeper.SubmitProposal(ctx, testProposal) suite.Require().NotEmpty(proposal) @@ -112,11 +112,11 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { testProposals = append(testProposals, &proposal) } - req = &types.QueryProposalsRequest{ + req = &v1beta2.QueryProposalsRequest{ Pagination: &query.PageRequest{Limit: 3}, } - expRes = &types.QueryProposalsResponse{ + expRes = &v1beta2.QueryProposalsResponse{ Proposals: testProposals[:3], } }, @@ -125,11 +125,11 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { { "request 2nd page with limit 4", func() { - req = &types.QueryProposalsRequest{ + req = &v1beta2.QueryProposalsRequest{ Pagination: &query.PageRequest{Offset: 3, Limit: 3}, } - expRes = &types.QueryProposalsResponse{ + expRes = &v1beta2.QueryProposalsResponse{ Proposals: testProposals[3:], } }, @@ -138,11 +138,11 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { { "request with limit 2 and count true", func() { - req = &types.QueryProposalsRequest{ + req = &v1beta2.QueryProposalsRequest{ Pagination: &query.PageRequest{Limit: 2, CountTotal: true}, } - expRes = &types.QueryProposalsResponse{ + expRes = &v1beta2.QueryProposalsResponse{ Proposals: testProposals[:2], } }, @@ -151,11 +151,11 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { { "request with filter of status deposit period", func() { - req = &types.QueryProposalsRequest{ - ProposalStatus: types.StatusDepositPeriod, + req = &v1beta2.QueryProposalsRequest{ + ProposalStatus: v1beta2.StatusDepositPeriod, } - expRes = &types.QueryProposalsResponse{ + expRes = &v1beta2.QueryProposalsResponse{ Proposals: testProposals, } }, @@ -165,14 +165,14 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { "request with filter of deposit address", func() { depositCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 20))) - deposit := types.NewDeposit(testProposals[0].ProposalId, addrs[0], depositCoins) + deposit := v1beta2.NewDeposit(testProposals[0].ProposalId, addrs[0], depositCoins) app.GovKeeper.SetDeposit(ctx, deposit) - req = &types.QueryProposalsRequest{ + req = &v1beta2.QueryProposalsRequest{ Depositor: addrs[0].String(), } - expRes = &types.QueryProposalsResponse{ + expRes = &v1beta2.QueryProposalsResponse{ Proposals: testProposals[:1], } }, @@ -181,15 +181,15 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { { "request with filter of deposit address", func() { - testProposals[1].Status = types.StatusVotingPeriod + testProposals[1].Status = v1beta2.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, *testProposals[1]) - suite.Require().NoError(app.GovKeeper.AddVote(ctx, testProposals[1].ProposalId, addrs[0], types.NewNonSplitVoteOption(types.OptionAbstain))) + suite.Require().NoError(app.GovKeeper.AddVote(ctx, testProposals[1].ProposalId, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain))) - req = &types.QueryProposalsRequest{ + req = &v1beta2.QueryProposalsRequest{ Voter: addrs[0].String(), } - expRes = &types.QueryProposalsResponse{ + expRes = &v1beta2.QueryProposalsResponse{ Proposals: testProposals[1:2], } }, @@ -223,9 +223,9 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { app, ctx, queryClient, addrs := suite.app, suite.ctx, suite.queryClient, suite.addrs var ( - req *types.QueryVoteRequest - expRes *types.QueryVoteResponse - proposal types.Proposal + req *v1beta2.QueryVoteRequest + expRes *v1beta2.QueryVoteResponse + proposal v1beta2.Proposal ) testCases := []struct { @@ -236,14 +236,14 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { { "empty request", func() { - req = &types.QueryVoteRequest{} + req = &v1beta2.QueryVoteRequest{} }, false, }, { "zero proposal id request", func() { - req = &types.QueryVoteRequest{ + req = &v1beta2.QueryVoteRequest{ ProposalId: 0, Voter: addrs[0].String(), } @@ -253,7 +253,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { { "empty voter request", func() { - req = &types.QueryVoteRequest{ + req = &v1beta2.QueryVoteRequest{ ProposalId: 1, Voter: "", } @@ -263,7 +263,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { { "non existed proposal", func() { - req = &types.QueryVoteRequest{ + req = &v1beta2.QueryVoteRequest{ ProposalId: 3, Voter: addrs[0].String(), } @@ -277,40 +277,40 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) suite.Require().NoError(err) - req = &types.QueryVoteRequest{ + req = &v1beta2.QueryVoteRequest{ ProposalId: proposal.ProposalId, Voter: addrs[0].String(), } - expRes = &types.QueryVoteResponse{} + expRes = &v1beta2.QueryVoteResponse{} }, false, }, { "valid request", func() { - proposal.Status = types.StatusVotingPeriod + proposal.Status = v1beta2.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], types.NewNonSplitVoteOption(types.OptionAbstain))) + suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain))) - req = &types.QueryVoteRequest{ + req = &v1beta2.QueryVoteRequest{ ProposalId: proposal.ProposalId, Voter: addrs[0].String(), } - expRes = &types.QueryVoteResponse{Vote: &types.Vote{ProposalId: proposal.ProposalId, Voter: addrs[0].String(), Option: types.OptionAbstain, Options: []*types.WeightedVoteOption{{Option: types.OptionAbstain, Weight: sdk.MustNewDecFromStr("1.0").String()}}}} + expRes = &v1beta2.QueryVoteResponse{Vote: &v1beta2.Vote{ProposalId: proposal.ProposalId, Voter: addrs[0].String(), Option: v1beta2.OptionAbstain, Options: []*v1beta2.WeightedVoteOption{{Option: v1beta2.OptionAbstain, Weight: sdk.MustNewDecFromStr("1.0").String()}}}} }, true, }, { "wrong voter id request", func() { - req = &types.QueryVoteRequest{ + req = &v1beta2.QueryVoteRequest{ ProposalId: proposal.ProposalId, Voter: addrs[1].String(), } - expRes = &types.QueryVoteResponse{} + expRes = &v1beta2.QueryVoteResponse{} }, false, }, @@ -339,10 +339,10 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { addrs := simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.NewInt(30000000)) var ( - req *types.QueryVotesRequest - expRes *types.QueryVotesResponse - proposal types.Proposal - votes types.Votes + req *v1beta2.QueryVotesRequest + expRes *v1beta2.QueryVotesResponse + proposal v1beta2.Proposal + votes v1beta2.Votes ) testCases := []struct { @@ -353,14 +353,14 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { { "empty request", func() { - req = &types.QueryVotesRequest{} + req = &v1beta2.QueryVotesRequest{} }, false, }, { "zero proposal id request", func() { - req = &types.QueryVotesRequest{ + req = &v1beta2.QueryVotesRequest{ ProposalId: 0, } }, @@ -369,7 +369,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { { "non existed proposals", func() { - req = &types.QueryVotesRequest{ + req = &v1beta2.QueryVotesRequest{ ProposalId: 2, } }, @@ -382,7 +382,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) suite.Require().NoError(err) - req = &types.QueryVotesRequest{ + req = &v1beta2.QueryVotesRequest{ ProposalId: proposal.ProposalId, } }, @@ -391,12 +391,12 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { { "request after adding 2 votes", func() { - proposal.Status = types.StatusVotingPeriod + proposal.Status = v1beta2.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - votes = []*types.Vote{ - {ProposalId: proposal.ProposalId, Voter: addrs[0].String(), Option: types.OptionAbstain, Options: types.NewNonSplitVoteOption(types.OptionAbstain)}, - {ProposalId: proposal.ProposalId, Voter: addrs[1].String(), Option: types.OptionYes, Options: types.NewNonSplitVoteOption(types.OptionYes)}, + votes = []*v1beta2.Vote{ + {ProposalId: proposal.ProposalId, Voter: addrs[0].String(), Option: v1beta2.OptionAbstain, Options: v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain)}, + {ProposalId: proposal.ProposalId, Voter: addrs[1].String(), Option: v1beta2.OptionYes, Options: v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)}, } accAddr1, err1 := sdk.AccAddressFromBech32(votes[0].Voter) accAddr2, err2 := sdk.AccAddressFromBech32(votes[1].Voter) @@ -405,11 +405,11 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, accAddr1, votes[0].Options)) suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, accAddr2, votes[1].Options)) - req = &types.QueryVotesRequest{ + req = &v1beta2.QueryVotesRequest{ ProposalId: proposal.ProposalId, } - expRes = &types.QueryVotesResponse{ + expRes = &v1beta2.QueryVotesResponse{ Votes: votes, } }, @@ -438,8 +438,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { queryClient := suite.queryClient var ( - req *types.QueryParamsRequest - expRes *types.QueryParamsResponse + req *v1beta2.QueryParamsRequest + expRes *v1beta2.QueryParamsResponse ) testCases := []struct { @@ -450,17 +450,17 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { { "empty request", func() { - req = &types.QueryParamsRequest{} + req = &v1beta2.QueryParamsRequest{} }, false, }, { "deposit params request", func() { - req = &types.QueryParamsRequest{ParamsType: types.ParamDeposit} - depositParams := types.DefaultDepositParams() - tallyParams := types.NewTallyParams(sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0)) - expRes = &types.QueryParamsResponse{ + req = &v1beta2.QueryParamsRequest{ParamsType: v1beta2.ParamDeposit} + depositParams := v1beta2.DefaultDepositParams() + tallyParams := v1beta2.NewTallyParams(sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0)) + expRes = &v1beta2.QueryParamsResponse{ DepositParams: &depositParams, TallyParams: &tallyParams, } @@ -470,10 +470,10 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { { "voting params request", func() { - req = &types.QueryParamsRequest{ParamsType: types.ParamVoting} - votingParams := types.DefaultVotingParams() - tallyParams := types.NewTallyParams(sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0)) - expRes = &types.QueryParamsResponse{ + req = &v1beta2.QueryParamsRequest{ParamsType: v1beta2.ParamVoting} + votingParams := v1beta2.DefaultVotingParams() + tallyParams := v1beta2.NewTallyParams(sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0)) + expRes = &v1beta2.QueryParamsResponse{ VotingParams: &votingParams, TallyParams: &tallyParams, } @@ -483,9 +483,9 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { { "tally params request", func() { - req = &types.QueryParamsRequest{ParamsType: types.ParamTallying} - tallyParams := types.DefaultTallyParams() - expRes = &types.QueryParamsResponse{ + req = &v1beta2.QueryParamsRequest{ParamsType: v1beta2.ParamTallying} + tallyParams := v1beta2.DefaultTallyParams() + expRes = &v1beta2.QueryParamsResponse{ TallyParams: &tallyParams, } }, @@ -494,8 +494,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { { "invalid request", func() { - req = &types.QueryParamsRequest{ParamsType: "wrongPath"} - expRes = &types.QueryParamsResponse{} + req = &v1beta2.QueryParamsRequest{ParamsType: "wrongPath"} + expRes = &v1beta2.QueryParamsResponse{} }, false, }, @@ -524,9 +524,9 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { app, ctx, queryClient, addrs := suite.app, suite.ctx, suite.queryClient, suite.addrs var ( - req *types.QueryDepositRequest - expRes *types.QueryDepositResponse - proposal types.Proposal + req *v1beta2.QueryDepositRequest + expRes *v1beta2.QueryDepositResponse + proposal v1beta2.Proposal ) testCases := []struct { @@ -537,14 +537,14 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { { "empty request", func() { - req = &types.QueryDepositRequest{} + req = &v1beta2.QueryDepositRequest{} }, false, }, { "zero proposal id request", func() { - req = &types.QueryDepositRequest{ + req = &v1beta2.QueryDepositRequest{ ProposalId: 0, Depositor: addrs[0].String(), } @@ -554,7 +554,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { { "empty deposit address request", func() { - req = &types.QueryDepositRequest{ + req = &v1beta2.QueryDepositRequest{ ProposalId: 1, Depositor: "", } @@ -564,7 +564,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { { "non existed proposal", func() { - req = &types.QueryDepositRequest{ + req = &v1beta2.QueryDepositRequest{ ProposalId: 2, Depositor: addrs[0].String(), } @@ -579,7 +579,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { suite.Require().NoError(err) suite.Require().NotNil(proposal) - req = &types.QueryDepositRequest{ + req = &v1beta2.QueryDepositRequest{ ProposalId: proposal.ProposalId, Depositor: addrs[0].String(), } @@ -590,15 +590,15 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { "valid request", func() { depositCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 20))) - deposit := types.NewDeposit(proposal.ProposalId, addrs[0], depositCoins) + deposit := v1beta2.NewDeposit(proposal.ProposalId, addrs[0], depositCoins) app.GovKeeper.SetDeposit(ctx, deposit) - req = &types.QueryDepositRequest{ + req = &v1beta2.QueryDepositRequest{ ProposalId: proposal.ProposalId, Depositor: addrs[0].String(), } - expRes = &types.QueryDepositResponse{Deposit: &deposit} + expRes = &v1beta2.QueryDepositResponse{Deposit: &deposit} }, true, }, @@ -625,9 +625,9 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { app, ctx, queryClient, addrs := suite.app, suite.ctx, suite.queryClient, suite.addrs var ( - req *types.QueryDepositsRequest - expRes *types.QueryDepositsResponse - proposal types.Proposal + req *v1beta2.QueryDepositsRequest + expRes *v1beta2.QueryDepositsResponse + proposal v1beta2.Proposal ) testCases := []struct { @@ -638,14 +638,14 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { { "empty request", func() { - req = &types.QueryDepositsRequest{} + req = &v1beta2.QueryDepositsRequest{} }, false, }, { "zero proposal id request", func() { - req = &types.QueryDepositsRequest{ + req = &v1beta2.QueryDepositsRequest{ ProposalId: 0, } }, @@ -654,7 +654,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { { "non existed proposal", func() { - req = &types.QueryDepositsRequest{ + req = &v1beta2.QueryDepositsRequest{ ProposalId: 2, } }, @@ -667,7 +667,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) suite.Require().NoError(err) - req = &types.QueryDepositsRequest{ + req = &v1beta2.QueryDepositsRequest{ ProposalId: proposal.ProposalId, } }, @@ -677,20 +677,20 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { "get deposits with default limit", func() { depositAmount1 := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 20))) - deposit1 := types.NewDeposit(proposal.ProposalId, addrs[0], depositAmount1) + deposit1 := v1beta2.NewDeposit(proposal.ProposalId, addrs[0], depositAmount1) app.GovKeeper.SetDeposit(ctx, deposit1) depositAmount2 := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 30))) - deposit2 := types.NewDeposit(proposal.ProposalId, addrs[1], depositAmount2) + deposit2 := v1beta2.NewDeposit(proposal.ProposalId, addrs[1], depositAmount2) app.GovKeeper.SetDeposit(ctx, deposit2) - deposits := types.Deposits{&deposit1, &deposit2} + deposits := v1beta2.Deposits{&deposit1, &deposit2} - req = &types.QueryDepositsRequest{ + req = &v1beta2.QueryDepositsRequest{ ProposalId: proposal.ProposalId, } - expRes = &types.QueryDepositsResponse{ + expRes = &v1beta2.QueryDepositsResponse{ Deposits: deposits, } }, @@ -721,9 +721,9 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() { addrs, _ := createValidators(suite.T(), ctx, app, []int64{5, 5, 5}) var ( - req *types.QueryTallyResultRequest - expRes *types.QueryTallyResultResponse - proposal types.Proposal + req *v1beta2.QueryTallyResultRequest + expRes *v1beta2.QueryTallyResultResponse + proposal v1beta2.Proposal ) testCases := []struct { @@ -734,21 +734,21 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() { { "empty request", func() { - req = &types.QueryTallyResultRequest{} + req = &v1beta2.QueryTallyResultRequest{} }, false, }, { "zero proposal id request", func() { - req = &types.QueryTallyResultRequest{ProposalId: 0} + req = &v1beta2.QueryTallyResultRequest{ProposalId: 0} }, false, }, { "query non existed proposal", func() { - req = &types.QueryTallyResultRequest{ProposalId: 1} + req = &v1beta2.QueryTallyResultRequest{ProposalId: 1} }, false, }, @@ -760,10 +760,10 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() { suite.Require().NoError(err) suite.Require().NotNil(proposal) - req = &types.QueryTallyResultRequest{ProposalId: proposal.ProposalId} + req = &v1beta2.QueryTallyResultRequest{ProposalId: proposal.ProposalId} - tallyResult := types.EmptyTallyResult() - expRes = &types.QueryTallyResultResponse{ + tallyResult := v1beta2.EmptyTallyResult() + expRes = &v1beta2.QueryTallyResultResponse{ Tally: &tallyResult, } }, @@ -772,17 +772,17 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() { { "request tally after few votes", func() { - proposal.Status = types.StatusVotingPeriod + proposal.Status = v1beta2.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], types.NewNonSplitVoteOption(types.OptionYes))) - suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[1], types.NewNonSplitVoteOption(types.OptionYes))) - suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[2], types.NewNonSplitVoteOption(types.OptionYes))) + suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) + suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) + suite.Require().NoError(app.GovKeeper.AddVote(ctx, proposal.ProposalId, addrs[2], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) - req = &types.QueryTallyResultRequest{ProposalId: proposal.ProposalId} + req = &v1beta2.QueryTallyResultRequest{ProposalId: proposal.ProposalId} - expRes = &types.QueryTallyResultResponse{ - Tally: &types.TallyResult{ + expRes = &v1beta2.QueryTallyResultResponse{ + Tally: &v1beta2.TallyResult{ Yes: sdk.NewInt(3 * 5 * 1000000).String(), }, } @@ -792,13 +792,13 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() { { "request final tally after status changed", func() { - proposal.Status = types.StatusPassed + proposal.Status = v1beta2.StatusPassed app.GovKeeper.SetProposal(ctx, proposal) proposal, _ = app.GovKeeper.GetProposal(ctx, proposal.ProposalId) - req = &types.QueryTallyResultRequest{ProposalId: proposal.ProposalId} + req = &v1beta2.QueryTallyResultRequest{ProposalId: proposal.ProposalId} - expRes = &types.QueryTallyResultResponse{ + expRes = &v1beta2.QueryTallyResultResponse{ Tally: proposal.FinalTallyResult, } }, diff --git a/x/gov/keeper/hooks_test.go b/x/gov/keeper/hooks_test.go index 81550bcb056c..b8b056a47732 100644 --- a/x/gov/keeper/hooks_test.go +++ b/x/gov/keeper/hooks_test.go @@ -12,6 +12,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) var _ types.GovHooks = &MockGovHooksReceiver{} @@ -82,7 +83,7 @@ func TestHooks(t *testing.T) { require.NoError(t, err) require.True(t, govHooksReceiver.AfterProposalDepositValid) - err = app.GovKeeper.AddVote(ctx, p2.ProposalId, addrs[0], types.NewNonSplitVoteOption(types.OptionYes)) + err = app.GovKeeper.AddVote(ctx, p2.ProposalId, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)) require.NoError(t, err) require.True(t, govHooksReceiver.AfterProposalVoteValid) diff --git a/x/gov/keeper/invariants.go b/x/gov/keeper/invariants.go index d0ec4dbfacc8..9a3be1ec856c 100644 --- a/x/gov/keeper/invariants.go +++ b/x/gov/keeper/invariants.go @@ -7,6 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) // RegisterInvariants registers all governance invariants @@ -27,7 +28,7 @@ func ModuleAccountInvariant(keeper Keeper, bk types.BankKeeper) sdk.Invariant { return func(ctx sdk.Context) (string, bool) { var expectedDeposits sdk.Coins - keeper.IterateAllDeposits(ctx, func(deposit types.Deposit) bool { + keeper.IterateAllDeposits(ctx, func(deposit v1beta2.Deposit) bool { expectedDeposits = expectedDeposits.Add(deposit.Amount...) return false }) diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 425c560b2f65..895df2070ac0 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -13,6 +13,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) // Keeper defines the governance module Keeper @@ -140,7 +141,7 @@ func (keeper Keeper) RemoveFromInactiveProposalQueue(ctx sdk.Context, proposalID // IterateActiveProposalsQueue iterates over the proposals in the active proposal queue // and performs a callback function -func (keeper Keeper) IterateActiveProposalsQueue(ctx sdk.Context, endTime time.Time, cb func(proposal types.Proposal) (stop bool)) { +func (keeper Keeper) IterateActiveProposalsQueue(ctx sdk.Context, endTime time.Time, cb func(proposal v1beta2.Proposal) (stop bool)) { iterator := keeper.ActiveProposalQueueIterator(ctx, endTime) defer iterator.Close() @@ -159,7 +160,7 @@ func (keeper Keeper) IterateActiveProposalsQueue(ctx sdk.Context, endTime time.T // IterateInactiveProposalsQueue iterates over the proposals in the inactive proposal queue // and performs a callback function -func (keeper Keeper) IterateInactiveProposalsQueue(ctx sdk.Context, endTime time.Time, cb func(proposal types.Proposal) (stop bool)) { +func (keeper Keeper) IterateInactiveProposalsQueue(ctx sdk.Context, endTime time.Time, cb func(proposal v1beta2.Proposal) (stop bool)) { iterator := keeper.InactiveProposalQueueIterator(ctx, endTime) defer iterator.Close() diff --git a/x/gov/keeper/keeper_test.go b/x/gov/keeper/keeper_test.go index ed38f05ca551..b775beb8d26c 100644 --- a/x/gov/keeper/keeper_test.go +++ b/x/gov/keeper/keeper_test.go @@ -11,6 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) type KeeperTestSuite struct { @@ -18,7 +19,7 @@ type KeeperTestSuite struct { app *simapp.SimApp ctx sdk.Context - queryClient types.QueryClient + queryClient v1beta2.QueryClient addrs []sdk.AccAddress } @@ -27,8 +28,8 @@ func (suite *KeeperTestSuite) SetupTest() { ctx := app.BaseApp.NewContext(false, tmproto.Header{}) queryHelper := baseapp.NewQueryServerTestHelper(ctx, app.InterfaceRegistry()) - types.RegisterQueryServer(queryHelper, app.GovKeeper) - queryClient := types.NewQueryClient(queryHelper) + v1beta2.RegisterQueryServer(queryHelper, app.GovKeeper) + queryClient := v1beta2.NewQueryClient(queryHelper) suite.app = app suite.ctx = ctx diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index fbde19b287ad..9fd7613c4382 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -12,6 +12,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) type msgServer struct { @@ -20,13 +21,13 @@ type msgServer struct { // NewMsgServerImpl returns an implementation of the gov MsgServer interface // for the provided Keeper. -func NewMsgServerImpl(keeper Keeper) types.MsgServer { +func NewMsgServerImpl(keeper Keeper) v1beta2.MsgServer { return &msgServer{Keeper: keeper} } -var _ types.MsgServer = msgServer{} +var _ v1beta2.MsgServer = msgServer{} -func (k msgServer) SubmitProposal(goCtx context.Context, msg *types.MsgSubmitProposal) (*types.MsgSubmitProposalResponse, error) { +func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1beta2.MsgSubmitProposal) (*v1beta2.MsgSubmitProposalResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) proposalMsgs, err := msg.GetMsgs() @@ -50,7 +51,7 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *types.MsgSubmitPro "submit proposal", ) - defer telemetry.IncrCounter(1, types.ModuleName, "proposal") + defer telemetry.IncrCounter(1, v1beta2.ModuleName, "proposal") proposer, _ := sdk.AccAddressFromBech32(msg.GetProposer()) votingStarted, err := k.Keeper.AddDeposit(ctx, proposal.ProposalId, proposer, msg.GetInitialDeposit()) @@ -74,24 +75,24 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *types.MsgSubmitPro } ctx.EventManager().EmitEvent(submitEvent) - return &types.MsgSubmitProposalResponse{ + return &v1beta2.MsgSubmitProposalResponse{ ProposalId: proposal.ProposalId, }, nil } -func (k msgServer) Vote(goCtx context.Context, msg *types.MsgVote) (*types.MsgVoteResponse, error) { +func (k msgServer) Vote(goCtx context.Context, msg *v1beta2.MsgVote) (*v1beta2.MsgVoteResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) accAddr, accErr := sdk.AccAddressFromBech32(msg.Voter) if accErr != nil { return nil, accErr } - err := k.Keeper.AddVote(ctx, msg.ProposalId, accAddr, types.NewNonSplitVoteOption(msg.Option)) + err := k.Keeper.AddVote(ctx, msg.ProposalId, accAddr, v1beta2.NewNonSplitVoteOption(msg.Option)) if err != nil { return nil, err } defer telemetry.IncrCounterWithLabels( - []string{types.ModuleName, "vote"}, + []string{v1beta2.ModuleName, "vote"}, 1, []metrics.Label{ telemetry.NewLabel("proposal_id", strconv.Itoa(int(msg.ProposalId))), @@ -106,10 +107,10 @@ func (k msgServer) Vote(goCtx context.Context, msg *types.MsgVote) (*types.MsgVo ), ) - return &types.MsgVoteResponse{}, nil + return &v1beta2.MsgVoteResponse{}, nil } -func (k msgServer) VoteWeighted(goCtx context.Context, msg *types.MsgVoteWeighted) (*types.MsgVoteWeightedResponse, error) { +func (k msgServer) VoteWeighted(goCtx context.Context, msg *v1beta2.MsgVoteWeighted) (*v1beta2.MsgVoteWeightedResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) accAddr, accErr := sdk.AccAddressFromBech32(msg.Voter) if accErr != nil { @@ -121,7 +122,7 @@ func (k msgServer) VoteWeighted(goCtx context.Context, msg *types.MsgVoteWeighte } defer telemetry.IncrCounterWithLabels( - []string{types.ModuleName, "vote"}, + []string{v1beta2.ModuleName, "vote"}, 1, []metrics.Label{ telemetry.NewLabel("proposal_id", strconv.Itoa(int(msg.ProposalId))), @@ -136,10 +137,10 @@ func (k msgServer) VoteWeighted(goCtx context.Context, msg *types.MsgVoteWeighte ), ) - return &types.MsgVoteWeightedResponse{}, nil + return &v1beta2.MsgVoteWeightedResponse{}, nil } -func (k msgServer) Deposit(goCtx context.Context, msg *types.MsgDeposit) (*types.MsgDepositResponse, error) { +func (k msgServer) Deposit(goCtx context.Context, msg *v1beta2.MsgDeposit) (*v1beta2.MsgDepositResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) accAddr, err := sdk.AccAddressFromBech32(msg.Depositor) if err != nil { @@ -151,7 +152,7 @@ func (k msgServer) Deposit(goCtx context.Context, msg *types.MsgDeposit) (*types } defer telemetry.IncrCounterWithLabels( - []string{types.ModuleName, "deposit"}, + []string{v1beta2.ModuleName, "deposit"}, 1, []metrics.Label{ telemetry.NewLabel("proposal_id", strconv.Itoa(int(msg.ProposalId))), @@ -175,11 +176,11 @@ func (k msgServer) Deposit(goCtx context.Context, msg *types.MsgDeposit) (*types ) } - return &types.MsgDepositResponse{}, nil + return &v1beta2.MsgDepositResponse{}, nil } type legacyMsgServer struct { - Server types.MsgServer + Server v1beta2.MsgServer } // NewLegacyMsgServerImpl returns an implementation of the v1beta1 legacy MsgServer interface. It wraps around @@ -196,7 +197,7 @@ func (k legacyMsgServer) SubmitProposal(goCtx context.Context, msg *v1beta1.MsgS return nil, fmt.Errorf("error converting legacy content into proposal message: %w", err) } - proposal, err := types.NewMsgSubmitProposal( + proposal, err := v1beta2.NewMsgSubmitProposal( []sdk.Msg{contentMsg}, msg.InitialDeposit, sdk.AccAddress(msg.Proposer), @@ -214,10 +215,10 @@ func (k legacyMsgServer) SubmitProposal(goCtx context.Context, msg *v1beta1.MsgS } func (k legacyMsgServer) Vote(goCtx context.Context, msg *v1beta1.MsgVote) (*v1beta1.MsgVoteResponse, error) { - _, err := k.Server.Vote(goCtx, &types.MsgVote{ + _, err := k.Server.Vote(goCtx, &v1beta2.MsgVote{ ProposalId: msg.ProposalId, Voter: msg.Voter, - Option: types.VoteOption(msg.Option), + Option: v1beta2.VoteOption(msg.Option), }) if err != nil { return nil, err @@ -226,15 +227,15 @@ func (k legacyMsgServer) Vote(goCtx context.Context, msg *v1beta1.MsgVote) (*v1b } func (k legacyMsgServer) VoteWeighted(goCtx context.Context, msg *v1beta1.MsgVoteWeighted) (*v1beta1.MsgVoteWeightedResponse, error) { - opts := make([]*types.WeightedVoteOption, len(msg.Options)) + opts := make([]*v1beta2.WeightedVoteOption, len(msg.Options)) for idx, opt := range msg.Options { - opts[idx] = &types.WeightedVoteOption{ - Option: types.VoteOption(opt.Option), + opts[idx] = &v1beta2.WeightedVoteOption{ + Option: v1beta2.VoteOption(opt.Option), Weight: opt.Weight.String(), } } - _, err := k.Server.VoteWeighted(goCtx, &types.MsgVoteWeighted{ + _, err := k.Server.VoteWeighted(goCtx, &v1beta2.MsgVoteWeighted{ ProposalId: msg.ProposalId, Voter: msg.Voter, Options: opts, @@ -246,7 +247,7 @@ func (k legacyMsgServer) VoteWeighted(goCtx context.Context, msg *v1beta1.MsgVot } func (k legacyMsgServer) Deposit(goCtx context.Context, msg *v1beta1.MsgDeposit) (*v1beta1.MsgDepositResponse, error) { - _, err := k.Server.Deposit(goCtx, &types.MsgDeposit{ + _, err := k.Server.Deposit(goCtx, &v1beta2.MsgDeposit{ ProposalId: msg.ProposalId, Depositor: msg.Depositor, Amount: msg.Amount, diff --git a/x/gov/keeper/params.go b/x/gov/keeper/params.go index 19200b8d80e0..acaeda07dc98 100644 --- a/x/gov/keeper/params.go +++ b/x/gov/keeper/params.go @@ -2,42 +2,41 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) // GetDepositParams returns the current DepositParams from the global param store -func (keeper Keeper) GetDepositParams(ctx sdk.Context) v1beta1.DepositParams { - var depositParams v1beta1.DepositParams +func (keeper Keeper) GetDepositParams(ctx sdk.Context) v1beta2.DepositParams { + var depositParams v1beta2.DepositParams keeper.paramSpace.Get(ctx, v1beta2.ParamStoreKeyDepositParams, &depositParams) return depositParams } // GetVotingParams returns the current VotingParams from the global param store -func (keeper Keeper) GetVotingParams(ctx sdk.Context) v1beta1.VotingParams { - var votingParams v1beta1.VotingParams +func (keeper Keeper) GetVotingParams(ctx sdk.Context) v1beta2.VotingParams { + var votingParams v1beta2.VotingParams keeper.paramSpace.Get(ctx, v1beta2.ParamStoreKeyVotingParams, &votingParams) return votingParams } // GetTallyParams returns the current TallyParam from the global param store -func (keeper Keeper) GetTallyParams(ctx sdk.Context) v1beta1.TallyParams { - var tallyParams v1beta1.TallyParams +func (keeper Keeper) GetTallyParams(ctx sdk.Context) v1beta2.TallyParams { + var tallyParams v1beta2.TallyParams keeper.paramSpace.Get(ctx, v1beta2.ParamStoreKeyTallyParams, &tallyParams) return tallyParams } // SetDepositParams sets DepositParams to the global param store -func (keeper Keeper) SetDepositParams(ctx sdk.Context, depositParams v1beta1.DepositParams) { +func (keeper Keeper) SetDepositParams(ctx sdk.Context, depositParams v1beta2.DepositParams) { keeper.paramSpace.Set(ctx, v1beta2.ParamStoreKeyDepositParams, &depositParams) } // SetVotingParams sets VotingParams to the global param store -func (keeper Keeper) SetVotingParams(ctx sdk.Context, votingParams v1beta1.VotingParams) { +func (keeper Keeper) SetVotingParams(ctx sdk.Context, votingParams v1beta2.VotingParams) { keeper.paramSpace.Set(ctx, v1beta2.ParamStoreKeyVotingParams, &votingParams) } // SetTallyParams sets TallyParams to the global param store -func (keeper Keeper) SetTallyParams(ctx sdk.Context, tallyParams v1beta1.TallyParams) { +func (keeper Keeper) SetTallyParams(ctx sdk.Context, tallyParams v1beta2.TallyParams) { keeper.paramSpace.Set(ctx, v1beta2.ParamStoreKeyTallyParams, &tallyParams) } diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 5fc57bcdda0a..03314d4c40df 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -11,38 +11,39 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) // SubmitProposal create new proposal given an array of messages -func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg) (types.Proposal, error) { +func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg) (v1beta2.Proposal, error) { // Loop through all messages and confirm that each has a handler and the gov module account // as the only signer for _, msg := range messages { // perform a basic validation of the message if err := msg.ValidateBasic(); err != nil { - return types.Proposal{}, sdkerrors.Wrap(types.ErrInvalidProposalMsg, err.Error()) + return v1beta2.Proposal{}, sdkerrors.Wrap(types.ErrInvalidProposalMsg, err.Error()) } signers := msg.GetSigners() if len(signers) != 1 { - return types.Proposal{}, types.ErrInvalidSigner + return v1beta2.Proposal{}, types.ErrInvalidSigner } // assert that the governance module account is the only signer of the messages if !signers[0].Equals(keeper.GetGovernanceAccount(ctx).GetAddress()) { - return types.Proposal{}, sdkerrors.Wrap(types.ErrInvalidSigner, signers[0].String()) + return v1beta2.Proposal{}, sdkerrors.Wrap(types.ErrInvalidSigner, signers[0].String()) } // check if the message wraps the legacy content type - if contentMsg, ok := msg.(*types.MsgContent); ok { + if contentMsg, ok := msg.(*v1beta2.MsgContent); ok { content := ContentFromMessage(contentMsg) if content == nil { - return types.Proposal{}, sdkerrors.Wrap(v1beta1.ErrInvalidProposalContent, "content is nil") + return v1beta2.Proposal{}, sdkerrors.Wrap(v1beta1.ErrInvalidProposalContent, "content is nil") } // if so ensure that the content has a respective handler if !keeper.legacyRouter.HasRoute(content.ProposalRoute()) { - return types.Proposal{}, sdkerrors.Wrap(types.ErrNoProposalHandlerExists, content.ProposalRoute()) + return v1beta2.Proposal{}, sdkerrors.Wrap(types.ErrNoProposalHandlerExists, content.ProposalRoute()) } // Execute the proposal content in a new context branch (with branched store) @@ -51,27 +52,27 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg) (types. cacheCtx, _ := ctx.CacheContext() handler := keeper.legacyRouter.GetRoute(content.ProposalRoute()) if err := handler(cacheCtx, content); err != nil { - return types.Proposal{}, sdkerrors.Wrap(v1beta1.ErrInvalidProposalContent, err.Error()) + return v1beta2.Proposal{}, sdkerrors.Wrap(v1beta1.ErrInvalidProposalContent, err.Error()) } // for all other message types use the msg service router to see that there is a valid route for that // message. NOTE: we do not verify the proposal messages any further. They may fail upon execution } else if keeper.router.Handler(msg) == nil { - return types.Proposal{}, sdkerrors.Wrap(types.ErrUnroutableProposalMsg, sdk.MsgTypeURL(msg)) + return v1beta2.Proposal{}, sdkerrors.Wrap(types.ErrUnroutableProposalMsg, sdk.MsgTypeURL(msg)) } } proposalID, err := keeper.GetProposalID(ctx) if err != nil { - return types.Proposal{}, err + return v1beta2.Proposal{}, err } submitTime := ctx.BlockHeader().Time depositPeriod := keeper.GetDepositParams(ctx).MaxDepositPeriod - proposal, err := types.NewProposal(messages, proposalID, submitTime, submitTime.Add(*depositPeriod)) + proposal, err := v1beta2.NewProposal(messages, proposalID, submitTime, submitTime.Add(*depositPeriod)) if err != nil { - return types.Proposal{}, err + return v1beta2.Proposal{}, err } keeper.SetProposal(ctx, proposal) @@ -93,15 +94,15 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg) (types. // GetProposal get proposal from store by ProposalID. // Panics if can't unmarshal the proposal. -func (keeper Keeper) GetProposal(ctx sdk.Context, proposalID uint64) (types.Proposal, bool) { +func (keeper Keeper) GetProposal(ctx sdk.Context, proposalID uint64) (v1beta2.Proposal, bool) { store := ctx.KVStore(keeper.storeKey) bz := store.Get(types.ProposalKey(proposalID)) if bz == nil { - return types.Proposal{}, false + return v1beta2.Proposal{}, false } - var proposal types.Proposal + var proposal v1beta2.Proposal if err := keeper.UnmarshalProposal(bz, &proposal); err != nil { panic(err) } @@ -111,7 +112,7 @@ func (keeper Keeper) GetProposal(ctx sdk.Context, proposalID uint64) (types.Prop // SetProposal set a proposal to store. // Panics if can't marshal the proposal. -func (keeper Keeper) SetProposal(ctx sdk.Context, proposal types.Proposal) { +func (keeper Keeper) SetProposal(ctx sdk.Context, proposal v1beta2.Proposal) { bz, err := keeper.MarshalProposal(proposal) if err != nil { panic(err) @@ -136,14 +137,14 @@ func (keeper Keeper) DeleteProposal(ctx sdk.Context, proposalID uint64) { // IterateProposals iterates over the all the proposals and performs a callback function. // Panics when the iterator encounters a proposal which can't be unmarshaled. -func (keeper Keeper) IterateProposals(ctx sdk.Context, cb func(proposal types.Proposal) (stop bool)) { +func (keeper Keeper) IterateProposals(ctx sdk.Context, cb func(proposal v1beta2.Proposal) (stop bool)) { store := ctx.KVStore(keeper.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.ProposalsKeyPrefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - var proposal types.Proposal + var proposal v1beta2.Proposal err := keeper.UnmarshalProposal(iterator.Value(), &proposal) if err != nil { panic(err) @@ -156,8 +157,8 @@ func (keeper Keeper) IterateProposals(ctx sdk.Context, cb func(proposal types.Pr } // GetProposals returns all the proposals from store -func (keeper Keeper) GetProposals(ctx sdk.Context) (proposals types.Proposals) { - keeper.IterateProposals(ctx, func(proposal types.Proposal) bool { +func (keeper Keeper) GetProposals(ctx sdk.Context) (proposals v1beta2.Proposals) { + keeper.IterateProposals(ctx, func(proposal v1beta2.Proposal) bool { proposals = append(proposals, &proposal) return false }) @@ -173,15 +174,15 @@ func (keeper Keeper) GetProposals(ctx sdk.Context) (proposals types.Proposals) { // // NOTE: If no filters are provided, all proposals will be returned in paginated // form. -func (keeper Keeper) GetProposalsFiltered(ctx sdk.Context, params types.QueryProposalsParams) types.Proposals { +func (keeper Keeper) GetProposalsFiltered(ctx sdk.Context, params v1beta2.QueryProposalsParams) v1beta2.Proposals { proposals := keeper.GetProposals(ctx) - filteredProposals := make([]*types.Proposal, 0, len(proposals)) + filteredProposals := make([]*v1beta2.Proposal, 0, len(proposals)) for _, p := range proposals { matchVoter, matchDepositor, matchStatus := true, true, true // match status (if supplied/valid) - if types.ValidProposalStatus(params.ProposalStatus) { + if v1beta2.ValidProposalStatus(params.ProposalStatus) { matchStatus = p.Status == params.ProposalStatus } @@ -202,7 +203,7 @@ func (keeper Keeper) GetProposalsFiltered(ctx sdk.Context, params types.QueryPro start, end := client.Paginate(len(filteredProposals), params.Page, params.Limit, 100) if start < 0 || end < 0 { - filteredProposals = []*types.Proposal{} + filteredProposals = []*v1beta2.Proposal{} } else { filteredProposals = filteredProposals[start:end] } @@ -228,20 +229,20 @@ func (keeper Keeper) SetProposalID(ctx sdk.Context, proposalID uint64) { store.Set(types.ProposalIDKey, types.GetProposalIDBytes(proposalID)) } -func (keeper Keeper) ActivateVotingPeriod(ctx sdk.Context, proposal types.Proposal) { +func (keeper Keeper) ActivateVotingPeriod(ctx sdk.Context, proposal v1beta2.Proposal) { startTime := ctx.BlockHeader().Time proposal.VotingStartTime = &startTime votingPeriod := keeper.GetVotingParams(ctx).VotingPeriod endTime := proposal.VotingStartTime.Add(*votingPeriod) proposal.VotingEndTime = &endTime - proposal.Status = types.StatusVotingPeriod + proposal.Status = v1beta2.StatusVotingPeriod keeper.SetProposal(ctx, proposal) keeper.RemoveFromInactiveProposalQueue(ctx, proposal.ProposalId, *proposal.DepositEndTime) keeper.InsertActiveProposalQueue(ctx, proposal.ProposalId, *proposal.VotingEndTime) } -func (keeper Keeper) MarshalProposal(proposal types.Proposal) ([]byte, error) { +func (keeper Keeper) MarshalProposal(proposal v1beta2.Proposal) ([]byte, error) { bz, err := keeper.cdc.Marshal(&proposal) if err != nil { return nil, err @@ -249,7 +250,7 @@ func (keeper Keeper) MarshalProposal(proposal types.Proposal) ([]byte, error) { return bz, nil } -func (keeper Keeper) UnmarshalProposal(bz []byte, proposal *types.Proposal) error { +func (keeper Keeper) UnmarshalProposal(bz []byte, proposal *v1beta2.Proposal) error { err := keeper.cdc.Unmarshal(bz, proposal) if err != nil { return err @@ -258,7 +259,7 @@ func (keeper Keeper) UnmarshalProposal(bz []byte, proposal *types.Proposal) erro } // TODO: move both these functions to the migration package -func NewContentProposal(content v1beta1.Content, authority string) (*types.MsgContent, error) { +func NewContentProposal(content v1beta1.Content, authority string) (*v1beta2.MsgContent, error) { msg, ok := content.(proto.Message) if !ok { return nil, fmt.Errorf("%T does not implement proto.Message", content) @@ -268,10 +269,10 @@ func NewContentProposal(content v1beta1.Content, authority string) (*types.MsgCo if err != nil { return nil, err } - return types.NewMsgContent(any, authority), nil + return v1beta2.NewMsgContent(any, authority), nil } -func ContentFromMessage(msg *types.MsgContent) v1beta1.Content { +func ContentFromMessage(msg *v1beta2.MsgContent) v1beta1.Content { content, ok := msg.Content.GetCachedValue().(v1beta1.Content) if !ok { return nil diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index bd3b45962871..9b4ebb7927fc 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -13,6 +13,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) func (suite *KeeperTestSuite) TestGetSetProposal() { @@ -78,20 +79,20 @@ func (suite *KeeperTestSuite) TestSubmitProposal() { func (suite *KeeperTestSuite) TestGetProposalsFiltered() { proposalID := uint64(1) - status := []types.ProposalStatus{types.StatusDepositPeriod, types.StatusVotingPeriod} + status := []v1beta2.ProposalStatus{v1beta2.StatusDepositPeriod, v1beta2.StatusVotingPeriod} addr1 := sdk.AccAddress("foo_________________") for _, s := range status { for i := 0; i < 50; i++ { - p, err := types.NewProposal(TestProposal, proposalID, time.Now(), time.Now()) + p, err := v1beta2.NewProposal(TestProposal, proposalID, time.Now(), time.Now()) suite.Require().NoError(err) p.Status = s if i%2 == 0 { - d := types.NewDeposit(proposalID, addr1, nil) - v := types.NewVote(proposalID, addr1, types.NewNonSplitVoteOption(types.OptionYes)) + d := v1beta2.NewDeposit(proposalID, addr1, nil) + v := v1beta2.NewVote(proposalID, addr1, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)) suite.app.GovKeeper.SetDeposit(suite.ctx, d) suite.app.GovKeeper.SetVote(suite.ctx, v) } @@ -102,21 +103,21 @@ func (suite *KeeperTestSuite) TestGetProposalsFiltered() { } testCases := []struct { - params types.QueryProposalsParams + params v1beta2.QueryProposalsParams expectedNumResults int }{ - {types.NewQueryProposalsParams(1, 50, types.StatusNil, nil, nil), 50}, - {types.NewQueryProposalsParams(1, 50, types.StatusDepositPeriod, nil, nil), 50}, - {types.NewQueryProposalsParams(1, 50, types.StatusVotingPeriod, nil, nil), 50}, - {types.NewQueryProposalsParams(1, 25, types.StatusNil, nil, nil), 25}, - {types.NewQueryProposalsParams(2, 25, types.StatusNil, nil, nil), 25}, - {types.NewQueryProposalsParams(1, 50, types.StatusRejected, nil, nil), 0}, - {types.NewQueryProposalsParams(1, 50, types.StatusNil, addr1, nil), 50}, - {types.NewQueryProposalsParams(1, 50, types.StatusNil, nil, addr1), 50}, - {types.NewQueryProposalsParams(1, 50, types.StatusNil, addr1, addr1), 50}, - {types.NewQueryProposalsParams(1, 50, types.StatusDepositPeriod, addr1, addr1), 25}, - {types.NewQueryProposalsParams(1, 50, types.StatusDepositPeriod, nil, nil), 50}, - {types.NewQueryProposalsParams(1, 50, types.StatusVotingPeriod, nil, nil), 50}, + {v1beta2.NewQueryProposalsParams(1, 50, v1beta2.StatusNil, nil, nil), 50}, + {v1beta2.NewQueryProposalsParams(1, 50, v1beta2.StatusDepositPeriod, nil, nil), 50}, + {v1beta2.NewQueryProposalsParams(1, 50, v1beta2.StatusVotingPeriod, nil, nil), 50}, + {v1beta2.NewQueryProposalsParams(1, 25, v1beta2.StatusNil, nil, nil), 25}, + {v1beta2.NewQueryProposalsParams(2, 25, v1beta2.StatusNil, nil, nil), 25}, + {v1beta2.NewQueryProposalsParams(1, 50, v1beta2.StatusRejected, nil, nil), 0}, + {v1beta2.NewQueryProposalsParams(1, 50, v1beta2.StatusNil, addr1, nil), 50}, + {v1beta2.NewQueryProposalsParams(1, 50, v1beta2.StatusNil, nil, addr1), 50}, + {v1beta2.NewQueryProposalsParams(1, 50, v1beta2.StatusNil, addr1, addr1), 50}, + {v1beta2.NewQueryProposalsParams(1, 50, v1beta2.StatusDepositPeriod, addr1, addr1), 25}, + {v1beta2.NewQueryProposalsParams(1, 50, v1beta2.StatusDepositPeriod, nil, nil), 50}, + {v1beta2.NewQueryProposalsParams(1, 50, v1beta2.StatusVotingPeriod, nil, nil), 50}, } for i, tc := range testCases { @@ -125,7 +126,7 @@ func (suite *KeeperTestSuite) TestGetProposalsFiltered() { suite.Require().Len(proposals, tc.expectedNumResults) for _, p := range proposals { - if types.ValidProposalStatus(tc.params.ProposalStatus) { + if v1beta2.ValidProposalStatus(tc.params.ProposalStatus) { suite.Require().Equal(tc.params.ProposalStatus, p.Status) } } @@ -139,4 +140,4 @@ func TestMigrateProposalMessages(t *testing.T) { require.NoError(t, err) content = keeper.ContentFromMessage(contentMsg) require.NotNil(t, content) -} \ No newline at end of file +} diff --git a/x/gov/keeper/querier.go b/x/gov/keeper/querier.go index 9c936b4f7e76..389d0c078357 100644 --- a/x/gov/keeper/querier.go +++ b/x/gov/keeper/querier.go @@ -223,7 +223,7 @@ func queryProposals(ctx sdk.Context, _ []string, req abci.RequestQuery, keeper K proposals := keeper.GetProposalsFiltered(ctx, params) if proposals == nil { - proposals = types.Proposals{} + proposals = v1beta2.Proposals{} } bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, proposals) diff --git a/x/gov/keeper/querier_test.go b/x/gov/keeper/querier_test.go index 61c57dc220e9..eb42486bd400 100644 --- a/x/gov/keeper/querier_test.go +++ b/x/gov/keeper/querier_test.go @@ -15,7 +15,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) @@ -23,7 +22,7 @@ const custom = "custom" func getQueriedParams(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier) (v1beta2.DepositParams, v1beta2.VotingParams, v1beta2.TallyParams) { query := abci.RequestQuery{ - Path: strings.Join([]string{custom, v1beta2.QuerierRoute, v1beta2.QueryParams, v1beta2.ParamDeposit}, "/"), + Path: strings.Join([]string{custom, types.QuerierRoute, v1beta2.QueryParams, v1beta2.ParamDeposit}, "/"), Data: []byte{}, } @@ -35,7 +34,7 @@ func getQueriedParams(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, que require.NoError(t, cdc.UnmarshalJSON(bz, &depositParams)) query = abci.RequestQuery{ - Path: strings.Join([]string{custom, v1beta2.QuerierRoute, v1beta2.QueryParams, v1beta2.ParamVoting}, "/"), + Path: strings.Join([]string{custom, types.QuerierRoute, v1beta2.QueryParams, v1beta2.ParamVoting}, "/"), Data: []byte{}, } @@ -47,7 +46,7 @@ func getQueriedParams(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, que require.NoError(t, cdc.UnmarshalJSON(bz, &votingParams)) query = abci.RequestQuery{ - Path: strings.Join([]string{custom, v1beta2.QuerierRoute, v1beta2.QueryParams, v1beta2.ParamTallying}, "/"), + Path: strings.Join([]string{custom, types.QuerierRoute, v1beta2.QueryParams, v1beta2.ParamTallying}, "/"), Data: []byte{}, } @@ -67,7 +66,7 @@ func getQueriedProposals( ) []*v1beta2.Proposal { query := abci.RequestQuery{ - Path: strings.Join([]string{custom, v1beta2.QuerierRoute, v1beta2.QueryProposals}, "/"), + Path: strings.Join([]string{custom, types.QuerierRoute, v1beta2.QueryProposals}, "/"), Data: cdc.MustMarshalJSON(v1beta2.NewQueryProposalsParams(page, limit, status, voter, depositor)), } @@ -83,7 +82,7 @@ func getQueriedProposals( func getQueriedDeposit(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier, proposalID uint64, depositor sdk.AccAddress) v1beta2.Deposit { query := abci.RequestQuery{ - Path: strings.Join([]string{custom, v1beta2.QuerierRoute, v1beta2.QueryDeposit}, "/"), + Path: strings.Join([]string{custom, types.QuerierRoute, v1beta2.QueryDeposit}, "/"), Data: cdc.MustMarshalJSON(v1beta2.NewQueryDepositParams(proposalID, depositor)), } @@ -99,7 +98,7 @@ func getQueriedDeposit(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, qu func getQueriedDeposits(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier, proposalID uint64) []v1beta2.Deposit { query := abci.RequestQuery{ - Path: strings.Join([]string{custom, v1beta2.QuerierRoute, v1beta2.QueryDeposits}, "/"), + Path: strings.Join([]string{custom, types.QuerierRoute, v1beta2.QueryDeposits}, "/"), Data: cdc.MustMarshalJSON(v1beta2.NewQueryProposalParams(proposalID)), } @@ -115,7 +114,7 @@ func getQueriedDeposits(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, q func getQueriedVote(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier, proposalID uint64, voter sdk.AccAddress) v1beta2.Vote { query := abci.RequestQuery{ - Path: strings.Join([]string{custom, v1beta2.QuerierRoute, v1beta2.QueryVote}, "/"), + Path: strings.Join([]string{custom, types.QuerierRoute, v1beta2.QueryVote}, "/"), Data: cdc.MustMarshalJSON(v1beta2.NewQueryVoteParams(proposalID, voter)), } @@ -132,7 +131,7 @@ func getQueriedVote(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, queri func getQueriedVotes(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier, proposalID uint64, page, limit int) []v1beta2.Vote { query := abci.RequestQuery{ - Path: strings.Join([]string{custom, v1beta2.QuerierRoute, v1beta2.QueryVote}, "/"), + Path: strings.Join([]string{custom, types.QuerierRoute, v1beta2.QueryVote}, "/"), Data: cdc.MustMarshalJSON(v1beta2.NewQueryProposalVotesParams(proposalID, page, limit)), } @@ -201,9 +200,10 @@ func TestQueries(t *testing.T) { _, err = app.GovKeeper.AddDeposit(ctx, deposit4.ProposalId, depositer4, deposit4.Amount) require.NoError(t, err) - proposal2.TotalDeposit = proposal2.TotalDeposit.Add(deposit4.Amount...) - proposal2.Status = v1beta1.StatusVotingPeriod - proposal2.VotingEndTime = proposal2.VotingEndTime.Add(v1beta2.DefaultPeriod) + proposal2.TotalDeposit = sdk.NewCoins(proposal2.TotalDeposit...).Add(deposit4.Amount...) + proposal2.Status = v1beta2.StatusVotingPeriod + votingEndTime := proposal2.VotingEndTime.Add(v1beta2.DefaultPeriod) + proposal2.VotingEndTime = &votingEndTime deposit5 := v1beta2.NewDeposit(proposal3.ProposalId, TestAddrs[1], depositParams.MinDeposit) depositer5, err := sdk.AccAddressFromBech32(deposit5.Depositor) @@ -211,9 +211,10 @@ func TestQueries(t *testing.T) { _, err = app.GovKeeper.AddDeposit(ctx, deposit5.ProposalId, depositer5, deposit5.Amount) require.NoError(t, err) - proposal3.TotalDeposit = proposal3.TotalDeposit.Add(deposit5.Amount...) - proposal3.Status = v1beta1.StatusVotingPeriod - proposal3.VotingEndTime = proposal3.VotingEndTime.Add(v1beta2.DefaultPeriod) + proposal3.TotalDeposit = sdk.NewCoins(proposal3.TotalDeposit...).Add(deposit5.Amount...) + proposal3.Status = v1beta2.StatusVotingPeriod + votingEndTime = proposal3.VotingEndTime.Add(v1beta2.DefaultPeriod) + proposal3.VotingEndTime = &votingEndTime // total deposit of TestAddrs[1] on proposal #3 is worth the proposal deposit + individual deposit deposit5.Amount = sdk.NewCoins(deposit5.Amount...).Add(deposit3.Amount...) diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index d3b5dd70300d..2cabec0cf5bc 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -10,30 +10,30 @@ import ( // Tally iterates over the votes and updates the tally of a proposal based on the voting power of the // voters -func (keeper Keeper) Tally(ctx sdk.Context, proposal types.Proposal) (passes bool, burnDeposits bool, tallyResults types.TallyResult) { - results := make(map[types.VoteOption]sdk.Dec) - results[types.OptionYes] = sdk.ZeroDec() - results[types.OptionAbstain] = sdk.ZeroDec() - results[types.OptionNo] = sdk.ZeroDec() - results[types.OptionNoWithVeto] = sdk.ZeroDec() +func (keeper Keeper) Tally(ctx sdk.Context, proposal v1beta2.Proposal) (passes bool, burnDeposits bool, tallyResults v1beta2.TallyResult) { + results := make(map[v1beta2.VoteOption]sdk.Dec) + results[v1beta2.OptionYes] = sdk.ZeroDec() + results[v1beta2.OptionAbstain] = sdk.ZeroDec() + results[v1beta2.OptionNo] = sdk.ZeroDec() + results[v1beta2.OptionNoWithVeto] = sdk.ZeroDec() totalVotingPower := sdk.ZeroDec() - currValidators := make(map[string]types.ValidatorGovInfo) + currValidators := make(map[string]v1beta2.ValidatorGovInfo) // fetch all the bonded validators, insert them into currValidators keeper.sk.IterateBondedValidatorsByPower(ctx, func(index int64, validator stakingtypes.ValidatorI) (stop bool) { - currValidators[validator.GetOperator().String()] = types.NewValidatorGovInfo( + currValidators[validator.GetOperator().String()] = v1beta2.NewValidatorGovInfo( validator.GetOperator(), validator.GetBondedTokens(), validator.GetDelegatorShares(), sdk.ZeroDec(), - types.WeightedVoteOptions{}, + v1beta2.WeightedVoteOptions{}, ) return false }) - keeper.IterateVotes(ctx, proposal.ProposalId, func(vote types.Vote) bool { + keeper.IterateVotes(ctx, proposal.ProposalId, func(vote v1beta2.Vote) bool { // if validator, just record it in the map voter, err := sdk.AccAddressFromBech32(vote.Voter) @@ -93,7 +93,7 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal types.Proposal) (passes boo } tallyParams := keeper.GetTallyParams(ctx) - tallyResults = types.NewTallyResultFromMap(results) + tallyResults = v1beta2.NewTallyResultFromMap(results) // TODO: Upgrade the spec to cover all of these cases & remove pseudocode. // If there is no staked coins, the proposal fails @@ -109,19 +109,19 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal types.Proposal) (passes boo } // If no one votes (everyone abstains), proposal fails - if totalVotingPower.Sub(results[types.OptionAbstain]).Equal(sdk.ZeroDec()) { + if totalVotingPower.Sub(results[v1beta2.OptionAbstain]).Equal(sdk.ZeroDec()) { return false, false, tallyResults } // If more than 1/3 of voters veto, proposal fails vetoThreshold, _ := sdk.NewDecFromStr(tallyParams.VetoThreshold) - if results[types.OptionNoWithVeto].Quo(totalVotingPower).GT(vetoThreshold) { + if results[v1beta2.OptionNoWithVeto].Quo(totalVotingPower).GT(vetoThreshold) { return false, true, tallyResults } // If more than 1/2 of non-abstaining voters vote Yes, proposal passes threshold, _ := sdk.NewDecFromStr(tallyParams.Threshold) - if results[types.OptionYes].Quo(totalVotingPower.Sub(results[types.OptionAbstain])).GT(threshold) { + if results[v1beta2.OptionYes].Quo(totalVotingPower.Sub(results[v1beta2.OptionAbstain])).GT(threshold) { return true, false, tallyResults } diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index 3ddec4613d37..b98dd7e1376c 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" "github.com/cosmos/cosmos-sdk/x/staking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -23,7 +23,7 @@ func TestTallyNoOneVotes(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = types.StatusVotingPeriod + proposal.Status = v1beta2.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) @@ -32,7 +32,7 @@ func TestTallyNoOneVotes(t *testing.T) { require.False(t, passes) require.True(t, burnDeposits) - require.True(t, tallyResults.Equals(types.EmptyTallyResult())) + require.True(t, tallyResults.Equals(v1beta2.EmptyTallyResult())) } func TestTallyNoQuorum(t *testing.T) { @@ -47,10 +47,10 @@ func TestTallyNoQuorum(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = types.StatusVotingPeriod + proposal.Status = v1beta2.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - err = app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionYes)) + err = app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)) require.Nil(t, err) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) @@ -70,12 +70,12 @@ func TestTallyOnlyValidatorsAllYes(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = types.StatusVotingPeriod + proposal.Status = v1beta2.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], types.NewNonSplitVoteOption(types.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -83,7 +83,7 @@ func TestTallyOnlyValidatorsAllYes(t *testing.T) { require.True(t, passes) require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(types.EmptyTallyResult())) + require.False(t, tallyResults.Equals(v1beta2.EmptyTallyResult())) } func TestTallyOnlyValidators51No(t *testing.T) { @@ -96,11 +96,11 @@ func TestTallyOnlyValidators51No(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = types.StatusVotingPeriod + proposal.Status = v1beta2.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[0], types.NewNonSplitVoteOption(types.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[1], types.NewNonSplitVoteOption(types.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionNo))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -120,11 +120,11 @@ func TestTallyOnlyValidators51Yes(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = types.StatusVotingPeriod + proposal.Status = v1beta2.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[0], types.NewNonSplitVoteOption(types.OptionNo))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[1], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -132,7 +132,7 @@ func TestTallyOnlyValidators51Yes(t *testing.T) { require.True(t, passes) require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(types.EmptyTallyResult())) + require.False(t, tallyResults.Equals(v1beta2.EmptyTallyResult())) } func TestTallyOnlyValidatorsVetoed(t *testing.T) { @@ -145,12 +145,12 @@ func TestTallyOnlyValidatorsVetoed(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = types.StatusVotingPeriod + proposal.Status = v1beta2.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[0], types.NewNonSplitVoteOption(types.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[1], types.NewNonSplitVoteOption(types.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[2], types.NewNonSplitVoteOption(types.OptionNoWithVeto))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[2], v1beta2.NewNonSplitVoteOption(v1beta2.OptionNoWithVeto))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -158,7 +158,7 @@ func TestTallyOnlyValidatorsVetoed(t *testing.T) { require.False(t, passes) require.True(t, burnDeposits) - require.False(t, tallyResults.Equals(types.EmptyTallyResult())) + require.False(t, tallyResults.Equals(v1beta2.EmptyTallyResult())) } func TestTallyOnlyValidatorsAbstainPasses(t *testing.T) { @@ -171,12 +171,12 @@ func TestTallyOnlyValidatorsAbstainPasses(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = types.StatusVotingPeriod + proposal.Status = v1beta2.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[0], types.NewNonSplitVoteOption(types.OptionAbstain))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[1], types.NewNonSplitVoteOption(types.OptionNo))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[2], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[2], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -184,7 +184,7 @@ func TestTallyOnlyValidatorsAbstainPasses(t *testing.T) { require.True(t, passes) require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(types.EmptyTallyResult())) + require.False(t, tallyResults.Equals(v1beta2.EmptyTallyResult())) } func TestTallyOnlyValidatorsAbstainFails(t *testing.T) { @@ -197,12 +197,12 @@ func TestTallyOnlyValidatorsAbstainFails(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = types.StatusVotingPeriod + proposal.Status = v1beta2.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[0], types.NewNonSplitVoteOption(types.OptionAbstain))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[1], types.NewNonSplitVoteOption(types.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[2], types.NewNonSplitVoteOption(types.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddrs[2], v1beta2.NewNonSplitVoteOption(v1beta2.OptionNo))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -210,7 +210,7 @@ func TestTallyOnlyValidatorsAbstainFails(t *testing.T) { require.False(t, passes) require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(types.EmptyTallyResult())) + require.False(t, tallyResults.Equals(v1beta2.EmptyTallyResult())) } func TestTallyOnlyValidatorsNonVoter(t *testing.T) { @@ -224,11 +224,11 @@ func TestTallyOnlyValidatorsNonVoter(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = types.StatusVotingPeriod + proposal.Status = v1beta2.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddr1, types.NewNonSplitVoteOption(types.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddr2, types.NewNonSplitVoteOption(types.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddr1, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, valAccAddr2, v1beta2.NewNonSplitVoteOption(v1beta2.OptionNo))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -236,7 +236,7 @@ func TestTallyOnlyValidatorsNonVoter(t *testing.T) { require.False(t, passes) require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(types.EmptyTallyResult())) + require.False(t, tallyResults.Equals(v1beta2.EmptyTallyResult())) } func TestTallyDelgatorOverride(t *testing.T) { @@ -258,13 +258,13 @@ func TestTallyDelgatorOverride(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = types.StatusVotingPeriod + proposal.Status = v1beta2.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], types.NewNonSplitVoteOption(types.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], types.NewNonSplitVoteOption(types.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[3], types.NewNonSplitVoteOption(types.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[4], types.NewNonSplitVoteOption(types.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[3], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[4], v1beta2.NewNonSplitVoteOption(v1beta2.OptionNo))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -272,7 +272,7 @@ func TestTallyDelgatorOverride(t *testing.T) { require.False(t, passes) require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(types.EmptyTallyResult())) + require.False(t, tallyResults.Equals(v1beta2.EmptyTallyResult())) } func TestTallyDelgatorInherit(t *testing.T) { @@ -294,12 +294,12 @@ func TestTallyDelgatorInherit(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = types.StatusVotingPeriod + proposal.Status = v1beta2.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionNo))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], types.NewNonSplitVoteOption(types.OptionNo))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -307,7 +307,7 @@ func TestTallyDelgatorInherit(t *testing.T) { require.True(t, passes) require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(types.EmptyTallyResult())) + require.False(t, tallyResults.Equals(v1beta2.EmptyTallyResult())) } func TestTallyDelgatorMultipleOverride(t *testing.T) { @@ -333,13 +333,13 @@ func TestTallyDelgatorMultipleOverride(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = types.StatusVotingPeriod + proposal.Status = v1beta2.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], types.NewNonSplitVoteOption(types.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], types.NewNonSplitVoteOption(types.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[3], types.NewNonSplitVoteOption(types.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[3], v1beta2.NewNonSplitVoteOption(v1beta2.OptionNo))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -347,7 +347,7 @@ func TestTallyDelgatorMultipleOverride(t *testing.T) { require.False(t, passes) require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(types.EmptyTallyResult())) + require.False(t, tallyResults.Equals(v1beta2.EmptyTallyResult())) } func TestTallyDelgatorMultipleInherit(t *testing.T) { @@ -375,12 +375,12 @@ func TestTallyDelgatorMultipleInherit(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = types.StatusVotingPeriod + proposal.Status = v1beta2.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], types.NewNonSplitVoteOption(types.OptionNo))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], types.NewNonSplitVoteOption(types.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], v1beta2.NewNonSplitVoteOption(v1beta2.OptionNo))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -388,7 +388,7 @@ func TestTallyDelgatorMultipleInherit(t *testing.T) { require.False(t, passes) require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(types.EmptyTallyResult())) + require.False(t, tallyResults.Equals(v1beta2.EmptyTallyResult())) } func TestTallyJailedValidator(t *testing.T) { @@ -418,12 +418,12 @@ func TestTallyJailedValidator(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = types.StatusVotingPeriod + proposal.Status = v1beta2.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], types.NewNonSplitVoteOption(types.OptionNo))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], types.NewNonSplitVoteOption(types.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], v1beta2.NewNonSplitVoteOption(v1beta2.OptionNo))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -431,7 +431,7 @@ func TestTallyJailedValidator(t *testing.T) { require.True(t, passes) require.False(t, burnDeposits) - require.False(t, tallyResults.Equals(types.EmptyTallyResult())) + require.False(t, tallyResults.Equals(v1beta2.EmptyTallyResult())) } func TestTallyValidatorMultipleDelegations(t *testing.T) { @@ -451,12 +451,12 @@ func TestTallyValidatorMultipleDelegations(t *testing.T) { proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId - proposal.Status = types.StatusVotingPeriod + proposal.Status = v1beta2.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionYes))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], types.NewNonSplitVoteOption(types.OptionNo))) - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], v1beta2.NewNonSplitVoteOption(v1beta2.OptionNo))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[2], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) @@ -469,7 +469,7 @@ func TestTallyValidatorMultipleDelegations(t *testing.T) { expectedAbstain := app.StakingKeeper.TokensFromConsensusPower(ctx, 0) expectedNo := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) expectedNoWithVeto := app.StakingKeeper.TokensFromConsensusPower(ctx, 0) - expectedTallyResult := types.NewTallyResult(expectedYes, expectedAbstain, expectedNo, expectedNoWithVeto) + expectedTallyResult := v1beta2.NewTallyResult(expectedYes, expectedAbstain, expectedNo, expectedNoWithVeto) require.True(t, tallyResults.Equals(expectedTallyResult)) } diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index 5af762e72b72..aada8a1bdd43 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -6,25 +6,26 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) // AddVote adds a vote on a specific proposal -func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress, options types.WeightedVoteOptions) error { +func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress, options v1beta2.WeightedVoteOptions) error { proposal, ok := keeper.GetProposal(ctx, proposalID) if !ok { return sdkerrors.Wrapf(types.ErrUnknownProposal, "%d", proposalID) } - if proposal.Status != types.StatusVotingPeriod { + if proposal.Status != v1beta2.StatusVotingPeriod { return sdkerrors.Wrapf(types.ErrInactiveProposal, "%d", proposalID) } for _, option := range options { - if !types.ValidWeightedVoteOption(*option) { + if !v1beta2.ValidWeightedVoteOption(*option) { return sdkerrors.Wrap(types.ErrInvalidVote, option.String()) } } - vote := types.NewVote(proposalID, voterAddr, options) + vote := v1beta2.NewVote(proposalID, voterAddr, options) keeper.SetVote(ctx, vote) // called after a vote on a proposal is cast @@ -42,8 +43,8 @@ func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A } // GetAllVotes returns all the votes from the store -func (keeper Keeper) GetAllVotes(ctx sdk.Context) (votes types.Votes) { - keeper.IterateAllVotes(ctx, func(vote types.Vote) bool { +func (keeper Keeper) GetAllVotes(ctx sdk.Context) (votes v1beta2.Votes) { + keeper.IterateAllVotes(ctx, func(vote v1beta2.Vote) bool { populateLegacyOption(&vote) votes = append(votes, &vote) return false @@ -52,8 +53,8 @@ func (keeper Keeper) GetAllVotes(ctx sdk.Context) (votes types.Votes) { } // GetVotes returns all the votes from a proposal -func (keeper Keeper) GetVotes(ctx sdk.Context, proposalID uint64) (votes types.Votes) { - keeper.IterateVotes(ctx, proposalID, func(vote types.Vote) bool { +func (keeper Keeper) GetVotes(ctx sdk.Context, proposalID uint64) (votes v1beta2.Votes) { + keeper.IterateVotes(ctx, proposalID, func(vote v1beta2.Vote) bool { populateLegacyOption(&vote) votes = append(votes, &vote) return false @@ -62,7 +63,7 @@ func (keeper Keeper) GetVotes(ctx sdk.Context, proposalID uint64) (votes types.V } // GetVote gets the vote from an address on a specific proposal -func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress) (vote types.Vote, found bool) { +func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress) (vote v1beta2.Vote, found bool) { store := ctx.KVStore(keeper.storeKey) bz := store.Get(types.VoteKey(proposalID, voterAddr)) if bz == nil { @@ -76,10 +77,10 @@ func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A } // SetVote sets a Vote to the gov store -func (keeper Keeper) SetVote(ctx sdk.Context, vote types.Vote) { +func (keeper Keeper) SetVote(ctx sdk.Context, vote v1beta2.Vote) { // vote.Option is a deprecated field, we don't set it in state - if vote.Option != types.OptionEmpty { // nolint - vote.Option = types.OptionEmpty // nolint + if vote.Option != v1beta2.OptionEmpty { // nolint + vote.Option = v1beta2.OptionEmpty // nolint } store := ctx.KVStore(keeper.storeKey) @@ -92,13 +93,13 @@ func (keeper Keeper) SetVote(ctx sdk.Context, vote types.Vote) { } // IterateAllVotes iterates over the all the stored votes and performs a callback function -func (keeper Keeper) IterateAllVotes(ctx sdk.Context, cb func(vote types.Vote) (stop bool)) { +func (keeper Keeper) IterateAllVotes(ctx sdk.Context, cb func(vote v1beta2.Vote) (stop bool)) { store := ctx.KVStore(keeper.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.VotesKeyPrefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - var vote types.Vote + var vote v1beta2.Vote keeper.cdc.MustUnmarshal(iterator.Value(), &vote) populateLegacyOption(&vote) @@ -109,13 +110,13 @@ func (keeper Keeper) IterateAllVotes(ctx sdk.Context, cb func(vote types.Vote) ( } // IterateVotes iterates over the all the proposals votes and performs a callback function -func (keeper Keeper) IterateVotes(ctx sdk.Context, proposalID uint64, cb func(vote types.Vote) (stop bool)) { +func (keeper Keeper) IterateVotes(ctx sdk.Context, proposalID uint64, cb func(vote v1beta2.Vote) (stop bool)) { store := ctx.KVStore(keeper.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.VotesKey(proposalID)) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - var vote types.Vote + var vote v1beta2.Vote keeper.cdc.MustUnmarshal(iterator.Value(), &vote) populateLegacyOption(&vote) @@ -133,7 +134,7 @@ func (keeper Keeper) deleteVote(ctx sdk.Context, proposalID uint64, voterAddr sd // populateLegacyOption adds graceful fallback of deprecated `Option` field, in case // there's only 1 VoteOption. -func populateLegacyOption(vote *types.Vote) { +func populateLegacyOption(vote *v1beta2.Vote) { if len(vote.Options) == 1 && vote.Options[0].Weight == "1.0" { vote.Option = vote.Options[0].Option // nolint } diff --git a/x/gov/keeper/vote_test.go b/x/gov/keeper/vote_test.go index 1e9c5a851674..b4d17fd93198 100644 --- a/x/gov/keeper/vote_test.go +++ b/x/gov/keeper/vote_test.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) func TestVotes(t *testing.T) { @@ -22,57 +22,57 @@ func TestVotes(t *testing.T) { require.NoError(t, err) proposalID := proposal.ProposalId - var invalidOption types.VoteOption = 0x10 + var invalidOption v1beta2.VoteOption = 0x10 - require.Error(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionYes)), "proposal not on voting period") - require.Error(t, app.GovKeeper.AddVote(ctx, 10, addrs[0], types.NewNonSplitVoteOption(types.OptionYes)), "invalid proposal ID") + require.Error(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)), "proposal not on voting period") + require.Error(t, app.GovKeeper.AddVote(ctx, 10, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)), "invalid proposal ID") - proposal.Status = types.StatusVotingPeriod + proposal.Status = v1beta2.StatusVotingPeriod app.GovKeeper.SetProposal(ctx, proposal) - require.Error(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(invalidOption)), "invalid option") + require.Error(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta2.NewNonSplitVoteOption(invalidOption)), "invalid option") // Test first vote - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionAbstain))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain))) vote, found := app.GovKeeper.GetVote(ctx, proposalID, addrs[0]) require.True(t, found) require.Equal(t, addrs[0].String(), vote.Voter) require.Equal(t, proposalID, vote.ProposalId) require.True(t, len(vote.Options) == 1) - require.Equal(t, types.OptionAbstain, vote.Options[0].Option) - require.Equal(t, types.OptionAbstain, vote.Option) + require.Equal(t, v1beta2.OptionAbstain, vote.Options[0].Option) + require.Equal(t, v1beta2.OptionAbstain, vote.Option) // Test change of vote - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionYes))) + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))) vote, found = app.GovKeeper.GetVote(ctx, proposalID, addrs[0]) require.True(t, found) require.Equal(t, addrs[0].String(), vote.Voter) require.Equal(t, proposalID, vote.ProposalId) require.True(t, len(vote.Options) == 1) - require.Equal(t, types.OptionYes, vote.Options[0].Option) - require.Equal(t, types.OptionYes, vote.Option) + require.Equal(t, v1beta2.OptionYes, vote.Options[0].Option) + require.Equal(t, v1beta2.OptionYes, vote.Option) // Test second vote - require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], types.WeightedVoteOptions{ - types.NewWeightedVoteOption(types.OptionYes, sdk.NewDecWithPrec(60, 2)), - types.NewWeightedVoteOption(types.OptionNo, sdk.NewDecWithPrec(30, 2)), - types.NewWeightedVoteOption(types.OptionAbstain, sdk.NewDecWithPrec(5, 2)), - types.NewWeightedVoteOption(types.OptionNoWithVeto, sdk.NewDecWithPrec(5, 2)), + require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], v1beta2.WeightedVoteOptions{ + v1beta2.NewWeightedVoteOption(v1beta2.OptionYes, sdk.NewDecWithPrec(60, 2)), + v1beta2.NewWeightedVoteOption(v1beta2.OptionNo, sdk.NewDecWithPrec(30, 2)), + v1beta2.NewWeightedVoteOption(v1beta2.OptionAbstain, sdk.NewDecWithPrec(5, 2)), + v1beta2.NewWeightedVoteOption(v1beta2.OptionNoWithVeto, sdk.NewDecWithPrec(5, 2)), })) vote, found = app.GovKeeper.GetVote(ctx, proposalID, addrs[1]) require.True(t, found) require.Equal(t, addrs[1].String(), vote.Voter) require.Equal(t, proposalID, vote.ProposalId) require.True(t, len(vote.Options) == 4) - require.Equal(t, types.OptionYes, vote.Options[0].Option) - require.Equal(t, types.OptionNo, vote.Options[1].Option) - require.Equal(t, types.OptionAbstain, vote.Options[2].Option) - require.Equal(t, types.OptionNoWithVeto, vote.Options[3].Option) + require.Equal(t, v1beta2.OptionYes, vote.Options[0].Option) + require.Equal(t, v1beta2.OptionNo, vote.Options[1].Option) + require.Equal(t, v1beta2.OptionAbstain, vote.Options[2].Option) + require.Equal(t, v1beta2.OptionNoWithVeto, vote.Options[3].Option) require.Equal(t, vote.Options[0].Weight, sdk.NewDecWithPrec(60, 2).String()) require.Equal(t, vote.Options[1].Weight, sdk.NewDecWithPrec(30, 2).String()) require.Equal(t, vote.Options[2].Weight, sdk.NewDecWithPrec(5, 2).String()) require.Equal(t, vote.Options[3].Weight, sdk.NewDecWithPrec(5, 2).String()) - require.Equal(t, types.OptionEmpty, vote.Option) + require.Equal(t, v1beta2.OptionEmpty, vote.Option) // Test vote iterator // NOTE order of deposits is determined by the addresses @@ -82,7 +82,7 @@ func TestVotes(t *testing.T) { require.Equal(t, addrs[0].String(), votes[0].Voter) require.Equal(t, proposalID, votes[0].ProposalId) require.True(t, len(votes[0].Options) == 1) - require.Equal(t, types.OptionYes, votes[0].Options[0].Option) + require.Equal(t, v1beta2.OptionYes, votes[0].Options[0].Option) require.Equal(t, addrs[1].String(), votes[1].Voter) require.Equal(t, proposalID, votes[1].ProposalId) require.True(t, len(votes[1].Options) == 4) @@ -90,5 +90,5 @@ func TestVotes(t *testing.T) { require.Equal(t, votes[1].Options[1].Weight, sdk.NewDecWithPrec(30, 2).String()) require.Equal(t, votes[1].Options[2].Weight, sdk.NewDecWithPrec(5, 2).String()) require.Equal(t, votes[1].Options[3].Weight, sdk.NewDecWithPrec(5, 2).String()) - require.Equal(t, types.OptionEmpty, vote.Option) + require.Equal(t, v1beta2.OptionEmpty, vote.Option) } diff --git a/x/gov/module.go b/x/gov/module.go index ba7c425185e1..52993ba930fa 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -25,6 +25,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov/simulation" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) var ( @@ -54,7 +55,7 @@ func (AppModuleBasic) Name() string { // RegisterLegacyAminoCodec registers the gov module's types for the given codec. func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { v1beta1.RegisterLegacyAminoCodec(cdc) - types.RegisterLegacyAminoCodec(cdc) + v1beta2.RegisterLegacyAminoCodec(cdc) } // DefaultGenesis returns default genesis state as raw bytes for the gov @@ -65,12 +66,12 @@ func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { // ValidateGenesis performs genesis state validation for the gov module. func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { - var data types.GenesisState + var data v1beta2.GenesisState if err := cdc.UnmarshalJSON(bz, &data); err != nil { return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) } - return types.ValidateGenesis(&data) + return v1beta2.ValidateGenesis(&data) } // RegisterRESTRoutes registers the REST routes for the gov module. @@ -80,7 +81,7 @@ func (a AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Ro // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the gov module. func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + if err := v1beta2.RegisterQueryHandlerClient(context.Background(), mux, v1beta2.NewQueryClient(clientCtx)); err != nil { panic(err) } if err := v1beta1.RegisterQueryHandlerClient(context.Background(), mux, v1beta1.NewQueryClient(clientCtx)); err != nil { @@ -155,8 +156,8 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) - types.RegisterQueryServer(cfg.QueryServer(), am.keeper) + v1beta2.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + v1beta2.RegisterQueryServer(cfg.QueryServer(), am.keeper) m := keeper.NewMigrator(am.keeper) err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2) @@ -168,7 +169,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // InitGenesis performs genesis initialization for the gov module. It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { - var genesisState types.GenesisState + var genesisState v1beta2.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) InitGenesis(ctx, am.accountKeeper, am.bankKeeper, am.keeper, &genesisState) return []abci.ValidatorUpdate{} diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index c4ebc1b4a1b6..1d5b7d967227 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -13,6 +13,7 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" "github.com/cosmos/cosmos-sdk/x/simulation" ) @@ -125,26 +126,26 @@ func SimulateMsgSubmitProposal( // 1) submit proposal now content := contentSim(r, ctx, accs) if content == nil { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSubmitProposal, "content is nil"), nil, nil + return simtypes.NoOpMsg(v1beta2.ModuleName, v1beta2.TypeMsgSubmitProposal, "content is nil"), nil, nil } simAccount, _ := simtypes.RandomAcc(r, accs) deposit, skip, err := randomDeposit(r, ctx, ak, bk, k, simAccount.Address) switch { case skip: - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSubmitProposal, "skip deposit"), nil, nil + return simtypes.NoOpMsg(v1beta2.ModuleName, v1beta2.TypeMsgSubmitProposal, "skip deposit"), nil, nil case err != nil: - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSubmitProposal, "unable to generate deposit"), nil, err + return simtypes.NoOpMsg(v1beta2.ModuleName, v1beta2.TypeMsgSubmitProposal, "unable to generate deposit"), nil, err } contentMsg, err := keeper.NewContentProposal(content, k.GetGovernanceAccount(ctx).GetAddress().String()) if err != nil { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSubmitProposal, "unable to create a content proposal message"), nil, err + return simtypes.NoOpMsg(v1beta2.ModuleName, v1beta2.TypeMsgSubmitProposal, "unable to create a content proposal message"), nil, err } - msg, err := types.NewMsgSubmitProposal([]sdk.Msg{contentMsg}, deposit, simAccount.Address) + msg, err := v1beta2.NewMsgSubmitProposal([]sdk.Msg{contentMsg}, deposit, simAccount.Address) if err != nil { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgSubmitProposal, "unable to generate a submit proposal msg"), nil, err + return simtypes.NoOpMsg(v1beta2.ModuleName, v1beta2.TypeMsgSubmitProposal, "unable to generate a submit proposal msg"), nil, err } account := ak.GetAccount(ctx, simAccount.Address) @@ -155,7 +156,7 @@ func SimulateMsgSubmitProposal( if !hasNeg { fees, err = simtypes.RandomFees(r, ctx, coins) if err != nil { - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate fees"), nil, err + return simtypes.NoOpMsg(v1beta2.ModuleName, msg.Type(), "unable to generate fees"), nil, err } } @@ -171,12 +172,12 @@ func SimulateMsgSubmitProposal( simAccount.PrivKey, ) if err != nil { - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate mock tx"), nil, err + return simtypes.NoOpMsg(v1beta2.ModuleName, msg.Type(), "unable to generate mock tx"), nil, err } _, _, err = app.SimDeliver(txGen.TxEncoder(), tx) if err != nil { - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to deliver tx"), nil, err + return simtypes.NoOpMsg(v1beta2.ModuleName, msg.Type(), "unable to deliver tx"), nil, err } opMsg := simtypes.NewOperationMsg(msg, true, "", nil) @@ -184,7 +185,7 @@ func SimulateMsgSubmitProposal( // get the submitted proposal ID proposalID, err := k.GetProposalID(ctx) if err != nil { - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate proposalID"), nil, err + return simtypes.NoOpMsg(v1beta2.ModuleName, msg.Type(), "unable to generate proposalID"), nil, err } // 2) Schedule operations for votes @@ -219,20 +220,20 @@ func SimulateMsgDeposit(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Ke accs []simtypes.Account, chainID string, ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { simAccount, _ := simtypes.RandomAcc(r, accs) - proposalID, ok := randomProposalID(r, k, ctx, types.StatusDepositPeriod) + proposalID, ok := randomProposalID(r, k, ctx, v1beta2.StatusDepositPeriod) if !ok { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgDeposit, "unable to generate proposalID"), nil, nil + return simtypes.NoOpMsg(v1beta2.ModuleName, v1beta2.TypeMsgDeposit, "unable to generate proposalID"), nil, nil } deposit, skip, err := randomDeposit(r, ctx, ak, bk, k, simAccount.Address) switch { case skip: - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgDeposit, "skip deposit"), nil, nil + return simtypes.NoOpMsg(v1beta2.ModuleName, v1beta2.TypeMsgDeposit, "skip deposit"), nil, nil case err != nil: - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgDeposit, "unable to generate deposit"), nil, err + return simtypes.NoOpMsg(v1beta2.ModuleName, v1beta2.TypeMsgDeposit, "unable to generate deposit"), nil, err } - msg := types.NewMsgDeposit(simAccount.Address, proposalID, deposit) + msg := v1beta2.NewMsgDeposit(simAccount.Address, proposalID, deposit) account := ak.GetAccount(ctx, simAccount.Address) spendable := bk.SpendableCoins(ctx, account.GetAddress()) @@ -242,7 +243,7 @@ func SimulateMsgDeposit(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Ke if !hasNeg { fees, err = simtypes.RandomFees(r, ctx, coins) if err != nil { - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate fees"), nil, err + return simtypes.NoOpMsg(v1beta2.ModuleName, msg.Type(), "unable to generate fees"), nil, err } } @@ -255,7 +256,7 @@ func SimulateMsgDeposit(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Ke Context: ctx, SimAccount: simAccount, AccountKeeper: ak, - ModuleName: types.ModuleName, + ModuleName: v1beta2.ModuleName, } return simulation.GenAndDeliverTx(txCtx, fees) @@ -282,16 +283,16 @@ func operationSimulateMsgVote(ak types.AccountKeeper, bk types.BankKeeper, k kee switch { case proposalIDInt < 0: var ok bool - proposalID, ok = randomProposalID(r, k, ctx, types.StatusVotingPeriod) + proposalID, ok = randomProposalID(r, k, ctx, v1beta2.StatusVotingPeriod) if !ok { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgVote, "unable to generate proposalID"), nil, nil + return simtypes.NoOpMsg(v1beta2.ModuleName, v1beta2.TypeMsgVote, "unable to generate proposalID"), nil, nil } default: proposalID = uint64(proposalIDInt) } option := randomVotingOption(r) - msg := types.NewMsgVote(simAccount.Address, proposalID, option) + msg := v1beta2.NewMsgVote(simAccount.Address, proposalID, option) account := ak.GetAccount(ctx, simAccount.Address) spendable := bk.SpendableCoins(ctx, account.GetAddress()) @@ -335,16 +336,16 @@ func operationSimulateMsgVoteWeighted(ak types.AccountKeeper, bk types.BankKeepe switch { case proposalIDInt < 0: var ok bool - proposalID, ok = randomProposalID(r, k, ctx, types.StatusVotingPeriod) + proposalID, ok = randomProposalID(r, k, ctx, v1beta2.StatusVotingPeriod) if !ok { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgVoteWeighted, "unable to generate proposalID"), nil, nil + return simtypes.NoOpMsg(v1beta2.ModuleName, v1beta2.TypeMsgVoteWeighted, "unable to generate proposalID"), nil, nil } default: proposalID = uint64(proposalIDInt) } options := randomWeightedVotingOptions(r) - msg := types.NewMsgVoteWeighted(simAccount.Address, proposalID, options) + msg := v1beta2.NewMsgVoteWeighted(simAccount.Address, proposalID, options) account := ak.GetAccount(ctx, simAccount.Address) spendable := bk.SpendableCoins(ctx, account.GetAddress()) @@ -409,7 +410,7 @@ func randomDeposit(r *rand.Rand, ctx sdk.Context, // that matches a given Status. // It does not provide a default ID. func randomProposalID(r *rand.Rand, k keeper.Keeper, - ctx sdk.Context, status types.ProposalStatus) (proposalID uint64, found bool) { + ctx sdk.Context, status v1beta2.ProposalStatus) (proposalID uint64, found bool) { proposalID, _ = k.GetProposalID(ctx) switch { @@ -432,49 +433,49 @@ func randomProposalID(r *rand.Rand, k keeper.Keeper, } // Pick a random voting option -func randomVotingOption(r *rand.Rand) types.VoteOption { +func randomVotingOption(r *rand.Rand) v1beta2.VoteOption { switch r.Intn(4) { case 0: - return types.OptionYes + return v1beta2.OptionYes case 1: - return types.OptionAbstain + return v1beta2.OptionAbstain case 2: - return types.OptionNo + return v1beta2.OptionNo case 3: - return types.OptionNoWithVeto + return v1beta2.OptionNoWithVeto default: panic("invalid vote option") } } // Pick a random weighted voting options -func randomWeightedVotingOptions(r *rand.Rand) types.WeightedVoteOptions { +func randomWeightedVotingOptions(r *rand.Rand) v1beta2.WeightedVoteOptions { w1 := r.Intn(100 + 1) w2 := r.Intn(100 - w1 + 1) w3 := r.Intn(100 - w1 - w2 + 1) w4 := 100 - w1 - w2 - w3 - weightedVoteOptions := types.WeightedVoteOptions{} + weightedVoteOptions := v1beta2.WeightedVoteOptions{} if w1 > 0 { - weightedVoteOptions = append(weightedVoteOptions, &types.WeightedVoteOption{ - Option: types.OptionYes, + weightedVoteOptions = append(weightedVoteOptions, &v1beta2.WeightedVoteOption{ + Option: v1beta2.OptionYes, Weight: sdk.NewDecWithPrec(int64(w1), 2).String(), }) } if w2 > 0 { - weightedVoteOptions = append(weightedVoteOptions, &types.WeightedVoteOption{ - Option: types.OptionAbstain, + weightedVoteOptions = append(weightedVoteOptions, &v1beta2.WeightedVoteOption{ + Option: v1beta2.OptionAbstain, Weight: sdk.NewDecWithPrec(int64(w2), 2).String(), }) } if w3 > 0 { - weightedVoteOptions = append(weightedVoteOptions, &types.WeightedVoteOption{ - Option: types.OptionNo, + weightedVoteOptions = append(weightedVoteOptions, &v1beta2.WeightedVoteOption{ + Option: v1beta2.OptionNo, Weight: sdk.NewDecWithPrec(int64(w3), 2).String(), }) } if w4 > 0 { - weightedVoteOptions = append(weightedVoteOptions, &types.WeightedVoteOption{ - Option: types.OptionNoWithVeto, + weightedVoteOptions = append(weightedVoteOptions, &v1beta2.WeightedVoteOption{ + Option: v1beta2.OptionNoWithVeto, Weight: sdk.NewDecWithPrec(int64(w4), 2).String(), }) } diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index a40ffde10e05..702c981bbb1d 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -19,6 +19,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov/simulation" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) @@ -115,7 +116,7 @@ func TestSimulateMsgSubmitProposal(t *testing.T) { operationMsg, _, err := op(r, app.BaseApp, ctx, accounts, "") require.NoError(t, err) - var proposal types.MsgSubmitProposal + var proposal v1beta2.MsgSubmitProposal types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &proposal) require.True(t, operationMsg.OK) @@ -124,7 +125,7 @@ func TestSimulateMsgSubmitProposal(t *testing.T) { msgs, err := proposal.GetMsgs() require.NoError(t, err) require.Len(t, msgs, 1) - contentMsg, ok := msgs[0].(*types.MsgContent) + contentMsg, ok := msgs[0].(*v1beta2.MsgContent) require.True(t, ok) content := keeper.ContentFromMessage(contentMsg) require.Equal(t, "title-3: ZBSpYuLyYggwexjxusrBqDOTtGTOWeLrQKjLxzIivHSlcxgdXhhuTSkuxKGLwQvuyNhYFmBZHeAerqyNEUzXPFGkqEGqiQWIXnku", content.GetTitle()) @@ -167,7 +168,7 @@ func TestSimulateMsgDeposit(t *testing.T) { operationMsg, _, err := op(r, app.BaseApp, ctx, accounts, "") require.NoError(t, err) - var msg types.MsgDeposit + var msg v1beta2.MsgDeposit types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) require.True(t, operationMsg.OK) @@ -212,13 +213,13 @@ func TestSimulateMsgVote(t *testing.T) { operationMsg, _, err := op(r, app.BaseApp, ctx, accounts, "") require.NoError(t, err) - var msg types.MsgVote + var msg v1beta2.MsgVote types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) require.True(t, operationMsg.OK) require.Equal(t, uint64(1), msg.ProposalId) require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Voter) - require.Equal(t, types.OptionYes, msg.Option) + require.Equal(t, v1beta2.OptionYes, msg.Option) require.Equal(t, "gov", msg.Route()) require.Equal(t, types.TypeMsgVote, msg.Type()) } @@ -256,7 +257,7 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { operationMsg, _, err := op(r, app.BaseApp, ctx, accounts, "") require.NoError(t, err) - var msg types.MsgVoteWeighted + var msg v1beta2.MsgVoteWeighted types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) require.True(t, operationMsg.OK) From 7871f98d3b56ec93ba1d0219c7c7ef7a8052ef92 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Fri, 7 Jan 2022 14:09:44 +0100 Subject: [PATCH 06/39] fix auth --- x/auth/middleware/tips_test.go | 2 +- x/gov/simulation/operations_test.go | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/x/auth/middleware/tips_test.go b/x/auth/middleware/tips_test.go index 1edfd00d52c5..136c393de93c 100644 --- a/x/auth/middleware/tips_test.go +++ b/x/auth/middleware/tips_test.go @@ -13,7 +13,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index 702c981bbb1d..a51a218063d7 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -82,9 +82,9 @@ func TestWeightedOperations(t *testing.T) { {0, types.ModuleName, "submit_proposal"}, {1, types.ModuleName, "submit_proposal"}, {2, types.ModuleName, "submit_proposal"}, - {simappparams.DefaultWeightMsgDeposit, types.ModuleName, types.TypeMsgDeposit}, - {simappparams.DefaultWeightMsgVote, types.ModuleName, types.TypeMsgVote}, - {simappparams.DefaultWeightMsgVoteWeighted, types.ModuleName, types.TypeMsgVoteWeighted}, + {simappparams.DefaultWeightMsgDeposit, types.ModuleName, v1beta2.TypeMsgDeposit}, + {simappparams.DefaultWeightMsgVote, types.ModuleName, v1beta2.TypeMsgVote}, + {simappparams.DefaultWeightMsgVoteWeighted, types.ModuleName, v1beta2.TypeMsgVoteWeighted}, } for i, w := range weightesOps { @@ -132,7 +132,7 @@ func TestSimulateMsgSubmitProposal(t *testing.T) { require.Equal(t, "description-3: NJWzHdBNpAXKJPHWQdrGYcAHSctgVlqwqHoLfHsXUdStwfefwzqLuKEhmMyYLdbZrcPgYqjNHxPexsruwEGStAneKbWkQDDIlCWBLSiAASNhZqNFlPtfqPJoxKsgMdzjWqLWdqKQuJqWPMvwPQWZUtVMOTMYKJbfdlZsjdsomuScvDmbDkgRualsxDvRJuCAmPOXitIbcyWsKGSdrEunFAOdmXnsuyFVgJqEjbklvmwrUlsxjRSfKZxGcpayDdgoFcnVSutxjRgOSFzPwidAjubMncNweqpbxhXGchpZUxuFDOtpnhNUycJICRYqsPhPSCjPTWZFLkstHWJxvdPEAyEIxXgLwbNOjrgzmaujiBABBIX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GWnwQMUgFFSKtPDMEoEQCTKVREqrXZSGLqwTMcxHfWotDllNkIJPMbXzjDVjPOOjCFuIvTyhXKLyhUScOXvYthRXpPfKwMhptXaxIxgqBoUqzrWbaoLTVpQoottZyPFfNOoMioXHRuFwMRYUiKvcWPkrayyTLOCFJlAyslDameIuqVAuxErqFPEWIScKpBORIuZqoXlZuTvAjEdlEWDODFRregDTqGNoFBIHxvimmIZwLfFyKUfEWAnNBdtdzDmTPXtpHRGdIbuucfTjOygZsTxPjfweXhSUkMhPjMaxKlMIJMOXcnQfyzeOcbWwNbeH", content.GetDescription()) require.Equal(t, "gov", proposal.Route()) require.Equal(t, "gov", contentMsg.Authority) - require.Equal(t, types.TypeMsgSubmitProposal, proposal.Type()) + require.Equal(t, v1beta2.TypeMsgSubmitProposal, proposal.Type()) } // TestSimulateMsgDeposit tests the normal scenario of a valid message of type TypeMsgDeposit. @@ -177,7 +177,7 @@ func TestSimulateMsgDeposit(t *testing.T) { require.Len(t, msg.Amount, 1) require.Equal(t, "560969stake", msg.Amount[0].String()) require.Equal(t, "gov", msg.Route()) - require.Equal(t, types.TypeMsgDeposit, msg.Type()) + require.Equal(t, v1beta2.TypeMsgDeposit, msg.Type()) } // TestSimulateMsgVote tests the normal scenario of a valid message of type TypeMsgVote. @@ -221,7 +221,7 @@ func TestSimulateMsgVote(t *testing.T) { require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Voter) require.Equal(t, v1beta2.OptionYes, msg.Option) require.Equal(t, "gov", msg.Route()) - require.Equal(t, types.TypeMsgVote, msg.Type()) + require.Equal(t, v1beta2.TypeMsgVote, msg.Type()) } // TestSimulateMsgVoteWeighted tests the normal scenario of a valid message of type TypeMsgVoteWeighted. @@ -265,7 +265,7 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Voter) require.True(t, len(msg.Options) >= 1) require.Equal(t, "gov", msg.Route()) - require.Equal(t, types.TypeMsgVoteWeighted, msg.Type()) + require.Equal(t, v1beta2.TypeMsgVoteWeighted, msg.Type()) } // returns context and an app with updated mint keeper From dbbb0c966cd14a9efb6d867ecd9eb5c25e69712b Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Fri, 7 Jan 2022 14:19:22 +0100 Subject: [PATCH 07/39] fix missed compile errors --- simapp/app.go | 3 ++- x/gov/abci_test.go | 2 +- x/gov/genesis.go | 4 ++-- x/gov/genesis_test.go | 6 +++--- x/gov/module.go | 2 +- x/params/proposal_handler_test.go | 16 +++++++++------- 6 files changed, 18 insertions(+), 15 deletions(-) diff --git a/simapp/app.go b/simapp/app.go index ab342cc838bd..a5502c0a0302 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -66,6 +66,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govv1beta2 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" oldgovtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/group" groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper" @@ -619,7 +620,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(minttypes.ModuleName) paramsKeeper.Subspace(distrtypes.ModuleName) paramsKeeper.Subspace(slashingtypes.ModuleName) - paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable()) + paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1beta2.ParamKeyTable()) paramsKeeper.Subspace(crisistypes.ModuleName) return paramsKeeper diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index adea517eca4f..eab34ec0439e 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -256,7 +256,7 @@ func TestTickPassedVotingPeriod(t *testing.T) { activeProposalID := types.GetProposalIDFromBytes(activeQueue.Value()) proposal, ok := app.GovKeeper.GetProposal(ctx, activeProposalID) require.True(t, ok) - require.Equal(t, types.StatusVotingPeriod, proposal.Status) + require.Equal(t, v1beta2.StatusVotingPeriod, proposal.Status) activeQueue.Close() diff --git a/x/gov/genesis.go b/x/gov/genesis.go index 2d9aa93aaaf7..edef3b160838 100644 --- a/x/gov/genesis.go +++ b/x/gov/genesis.go @@ -34,9 +34,9 @@ func InitGenesis(ctx sdk.Context, ak types.AccountKeeper, bk types.BankKeeper, k for _, proposal := range data.Proposals { switch proposal.Status { - case types.StatusDepositPeriod: + case v1beta2.StatusDepositPeriod: k.InsertInactiveProposalQueue(ctx, proposal.ProposalId, *proposal.DepositEndTime) - case types.StatusVotingPeriod: + case v1beta2.StatusVotingPeriod: k.InsertActiveProposalQueue(ctx, proposal.ProposalId, *proposal.VotingEndTime) } k.SetProposal(ctx, *proposal) diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index 4dded212054a..992dd90cfd2b 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -102,8 +102,8 @@ func TestImportExportQueues(t *testing.T) { require.True(t, ok) proposal2, ok = app2.GovKeeper.GetProposal(ctx2, proposalID2) require.True(t, ok) - require.True(t, proposal1.Status == types.StatusDepositPeriod) - require.True(t, proposal2.Status == types.StatusVotingPeriod) + require.True(t, proposal1.Status == v1beta2.StatusDepositPeriod) + require.True(t, proposal2.Status == v1beta2.StatusVotingPeriod) macc := app2.GovKeeper.GetGovernanceAccount(ctx2) require.Equal(t, app2.GovKeeper.GetDepositParams(ctx2).MinDeposit, app2.BankKeeper.GetAllBalances(ctx2, macc.GetAddress())) @@ -116,7 +116,7 @@ func TestImportExportQueues(t *testing.T) { proposal2, ok = app2.GovKeeper.GetProposal(ctx2, proposalID2) require.True(t, ok) - require.True(t, proposal2.Status == types.StatusRejected) + require.True(t, proposal2.Status == v1beta2.StatusRejected) } func TestImportExportQueues_ErrorUnconsistentState(t *testing.T) { diff --git a/x/gov/module.go b/x/gov/module.go index 52993ba930fa..6aa7990840ef 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -106,7 +106,7 @@ func (AppModuleBasic) GetQueryCmd() *cobra.Command { // RegisterInterfaces implements InterfaceModule.RegisterInterfaces func (a AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { - types.RegisterInterfaces(registry) + v1beta2.RegisterInterfaces(registry) v1beta1.RegisterInterfaces(registry) } diff --git a/x/params/proposal_handler_test.go b/x/params/proposal_handler_test.go index 7fe9e59b013d..f27390e974ae 100644 --- a/x/params/proposal_handler_test.go +++ b/x/params/proposal_handler_test.go @@ -9,8 +9,9 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" - gov "github.com/cosmos/cosmos-sdk/x/gov/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + govv1beta2 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" "github.com/cosmos/cosmos-sdk/x/params" "github.com/cosmos/cosmos-sdk/x/params/types/proposal" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -21,7 +22,7 @@ type HandlerTestSuite struct { app *simapp.SimApp ctx sdk.Context - govHandler govtypes.Handler + govHandler govv1beta1.Handler } func (suite *HandlerTestSuite) SetupTest() { @@ -63,15 +64,16 @@ func (suite *HandlerTestSuite) TestProposalHandler() { { "omit empty fields", testProposal(proposal.ParamChange{ - Subspace: gov.ModuleName, - Key: string(gov.ParamStoreKeyDepositParams), + Subspace: govtypes.ModuleName, + Key: string(govv1beta2.ParamStoreKeyDepositParams), Value: `{"min_deposit": [{"denom": "uatom","amount": "64000000"}]}`, }), func() { depositParams := suite.app.GovKeeper.GetDepositParams(suite.ctx) - suite.Require().Equal(govtypes.DepositParams{ + defaultPeriod := govv1beta2.DefaultPeriod + suite.Require().Equal(govv1beta2.DepositParams{ MinDeposit: sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(64000000))), - MaxDepositPeriod: govtypes.DefaultPeriod, + MaxDepositPeriod: &defaultPeriod, }, depositParams) }, false, From 673e9723c4120304af1b6553ad4dee5016ca19a0 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Fri, 7 Jan 2022 17:25:31 +0100 Subject: [PATCH 08/39] fix a few tests --- x/gov/keeper/deposit_test.go | 21 ++++++++++----------- x/gov/keeper/querier.go | 4 ++-- x/gov/simulation/operations_test.go | 14 +++++++------- x/gov/types/v1beta1/msgs_test.go | 4 ++-- x/gov/types/v1beta2/msgs_test.go | 4 ++-- 5 files changed, 23 insertions(+), 24 deletions(-) diff --git a/x/gov/keeper/deposit_test.go b/x/gov/keeper/deposit_test.go index 4ce38dbc4a07..5b35f2a24141 100644 --- a/x/gov/keeper/deposit_test.go +++ b/x/gov/keeper/deposit_test.go @@ -2,7 +2,6 @@ package keeper_test import ( "testing" - "time" "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -35,7 +34,7 @@ func TestDeposits(t *testing.T) { require.False(t, found) proposal, ok := app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) - require.True(t, proposal.VotingStartTime.Equal(time.Time{})) + require.Nil(t, proposal.VotingStartTime) // Check first deposit votingStarted, err := app.GovKeeper.AddDeposit(ctx, proposalID, TestAddrs[0], fourStake) @@ -43,11 +42,11 @@ func TestDeposits(t *testing.T) { require.False(t, votingStarted) deposit, found = app.GovKeeper.GetDeposit(ctx, proposalID, TestAddrs[0]) require.True(t, found) - require.Equal(t, fourStake, deposit.Amount) + require.Equal(t, fourStake, sdk.NewCoins(deposit.Amount...)) require.Equal(t, TestAddrs[0].String(), deposit.Depositor) proposal, ok = app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) - require.Equal(t, fourStake, proposal.TotalDeposit) + require.Equal(t, fourStake, sdk.NewCoins(proposal.TotalDeposit...)) require.Equal(t, addr0Initial.Sub(fourStake), app.BankKeeper.GetAllBalances(ctx, TestAddrs[0])) // Check a second deposit from same address @@ -56,11 +55,11 @@ func TestDeposits(t *testing.T) { require.False(t, votingStarted) deposit, found = app.GovKeeper.GetDeposit(ctx, proposalID, TestAddrs[0]) require.True(t, found) - require.Equal(t, fourStake.Add(fiveStake...), deposit.Amount) + require.Equal(t, fourStake.Add(fiveStake...), sdk.NewCoins(deposit.Amount...)) require.Equal(t, TestAddrs[0].String(), deposit.Depositor) proposal, ok = app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) - require.Equal(t, fourStake.Add(fiveStake...), proposal.TotalDeposit) + require.Equal(t, fourStake.Add(fiveStake...), sdk.NewCoins(proposal.TotalDeposit...)) require.Equal(t, addr0Initial.Sub(fourStake).Sub(fiveStake), app.BankKeeper.GetAllBalances(ctx, TestAddrs[0])) // Check third deposit from a new address @@ -70,10 +69,10 @@ func TestDeposits(t *testing.T) { deposit, found = app.GovKeeper.GetDeposit(ctx, proposalID, TestAddrs[1]) require.True(t, found) require.Equal(t, TestAddrs[1].String(), deposit.Depositor) - require.Equal(t, fourStake, deposit.Amount) + require.Equal(t, fourStake, sdk.NewCoins(deposit.Amount...)) proposal, ok = app.GovKeeper.GetProposal(ctx, proposalID) require.True(t, ok) - require.Equal(t, fourStake.Add(fiveStake...).Add(fourStake...), proposal.TotalDeposit) + require.Equal(t, fourStake.Add(fiveStake...).Add(fourStake...), sdk.NewCoins(proposal.TotalDeposit...)) require.Equal(t, addr1Initial.Sub(fourStake), app.BankKeeper.GetAllBalances(ctx, TestAddrs[1])) // Check that proposal moved to voting period @@ -87,14 +86,14 @@ func TestDeposits(t *testing.T) { require.Len(t, deposits, 2) require.Equal(t, deposits, app.GovKeeper.GetDeposits(ctx, proposalID)) require.Equal(t, TestAddrs[0].String(), deposits[0].Depositor) - require.Equal(t, fourStake.Add(fiveStake...), deposits[0].Amount) + require.Equal(t, fourStake.Add(fiveStake...), sdk.NewCoins(deposits[0].Amount...)) require.Equal(t, TestAddrs[1].String(), deposits[1].Depositor) - require.Equal(t, fourStake, deposits[1].Amount) + require.Equal(t, fourStake, sdk.NewCoins(deposits[1].Amount...)) // Test Refund Deposits deposit, found = app.GovKeeper.GetDeposit(ctx, proposalID, TestAddrs[1]) require.True(t, found) - require.Equal(t, fourStake, deposit.Amount) + require.Equal(t, fourStake, sdk.NewCoins(deposit.Amount...)) app.GovKeeper.RefundAndDeleteDeposits(ctx, proposalID) deposit, found = app.GovKeeper.GetDeposit(ctx, proposalID, TestAddrs[1]) require.False(t, found) diff --git a/x/gov/keeper/querier.go b/x/gov/keeper/querier.go index 389d0c078357..592360dc32ca 100644 --- a/x/gov/keeper/querier.go +++ b/x/gov/keeper/querier.go @@ -167,10 +167,10 @@ func queryTally(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Ke var tallyResult v1beta2.TallyResult switch { - case proposal.Status == types.StatusDepositPeriod: + case proposal.Status == v1beta2.StatusDepositPeriod: tallyResult = v1beta2.EmptyTallyResult() - case proposal.Status == types.StatusPassed || proposal.Status == types.StatusRejected: + case proposal.Status == v1beta2.StatusPassed || proposal.Status == v1beta2.StatusRejected: tallyResult = *proposal.FinalTallyResult default: diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index a51a218063d7..fb99228c4dd8 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -117,7 +117,7 @@ func TestSimulateMsgSubmitProposal(t *testing.T) { require.NoError(t, err) var proposal v1beta2.MsgSubmitProposal - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &proposal) + v1beta2.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &proposal) require.True(t, operationMsg.OK) require.Equal(t, "cosmos1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7u4x9a0", proposal.Proposer) @@ -155,7 +155,7 @@ func TestSimulateMsgDeposit(t *testing.T) { submitTime := ctx.BlockHeader().Time depositPeriod := app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod - proposal, err := types.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod)) + proposal, err := v1beta2.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod)) require.NoError(t, err) app.GovKeeper.SetProposal(ctx, proposal) @@ -169,7 +169,7 @@ func TestSimulateMsgDeposit(t *testing.T) { require.NoError(t, err) var msg v1beta2.MsgDeposit - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + v1beta2.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) require.True(t, operationMsg.OK) require.Equal(t, uint64(1), msg.ProposalId) @@ -200,7 +200,7 @@ func TestSimulateMsgVote(t *testing.T) { submitTime := ctx.BlockHeader().Time depositPeriod := app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod - proposal, err := types.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod)) + proposal, err := v1beta2.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod)) require.NoError(t, err) app.GovKeeper.ActivateVotingPeriod(ctx, proposal) @@ -214,7 +214,7 @@ func TestSimulateMsgVote(t *testing.T) { require.NoError(t, err) var msg v1beta2.MsgVote - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + v1beta2.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) require.True(t, operationMsg.OK) require.Equal(t, uint64(1), msg.ProposalId) @@ -244,7 +244,7 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { submitTime := ctx.BlockHeader().Time depositPeriod := app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod - proposal, err := types.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod)) + proposal, err := v1beta2.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod)) require.NoError(t, err) app.GovKeeper.ActivateVotingPeriod(ctx, proposal) @@ -258,7 +258,7 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { require.NoError(t, err) var msg v1beta2.MsgVoteWeighted - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + v1beta2.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) require.True(t, operationMsg.OK) require.Equal(t, uint64(1), msg.ProposalId) diff --git a/x/gov/types/v1beta1/msgs_test.go b/x/gov/types/v1beta1/msgs_test.go index 3d571a6559fc..3d3a606889d0 100644 --- a/x/gov/types/v1beta1/msgs_test.go +++ b/x/gov/types/v1beta1/msgs_test.go @@ -61,10 +61,10 @@ func TestMsgSubmitProposal(t *testing.T) { func TestMsgDepositGetSignBytes(t *testing.T) { addr := sdk.AccAddress("addr1") - msg := NewMsgDeposit(addr, 0, coinsPos) + msg := NewMsgDeposit(addr, 1, coinsPos) res := msg.GetSignBytes() - expected := `{"type":"cosmos-sdk/MsgDeposit","value":{"amount":[{"amount":"1000","denom":"stake"}],"depositor":"cosmos1v9jxgu33kfsgr5","proposal_id":"0"}}` + expected := `{"type":"cosmos-sdk/MsgDeposit","value":{"amount":[{"amount":"1000","denom":"stake"}],"depositor":"cosmos1v9jxgu33kfsgr5","proposal_id":"1"}}` require.Equal(t, expected, string(res)) } diff --git a/x/gov/types/v1beta2/msgs_test.go b/x/gov/types/v1beta2/msgs_test.go index 1977ba990b9f..98b9e1a4715d 100644 --- a/x/gov/types/v1beta2/msgs_test.go +++ b/x/gov/types/v1beta2/msgs_test.go @@ -28,7 +28,7 @@ func TestMsgDepositGetSignBytes(t *testing.T) { msg := v1beta2.NewMsgDeposit(addr, 0, coinsPos) res := msg.GetSignBytes() - expected := `{"type":"cosmos-sdk/MsgDeposit","value":{"amount":[{"amount":"1000","denom":"stake"}],"depositor":"cosmos1v9jxgu33kfsgr5"}}` + expected := `{"type":"cosmos-sdk/v1beta2/MsgDeposit","value":{"amount":[{"amount":"1000","denom":"stake"}],"depositor":"cosmos1v9jxgu33kfsgr5"}}` require.Equal(t, expected, string(res)) } @@ -135,6 +135,6 @@ func TestMsgSubmitProposal_GetSignBytes(t *testing.T) { require.NotPanics(t, func() { bz = msg.GetSignBytes() }) - require.Equal(t, "{\"type\":\"cosmos-sdk/MsgSubmitProposal\",\"value\":{\"initial_deposit\":[],\"messages\":[{\"type\":\"cosmos-sdk/MsgVote\",\"value\":{\"option\":1,\"proposal_id\":\"1\",\"voter\":\"cosmos1w3jhxap3gempvr\"}}]}}", + require.Equal(t, "{\"type\":\"cosmos-sdk/v1beta2/MsgSubmitProposal\",\"value\":{\"initial_deposit\":[],\"messages\":[{\"type\":\"cosmos-sdk/v1beta2/MsgVote\",\"value\":{\"option\":1,\"proposal_id\":\"1\",\"voter\":\"cosmos1w3jhxap3gempvr\"}}]}}", string(bz)) } From 3af7d0705bf5d56b663b81dd2ed87c23022ffc29 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Fri, 7 Jan 2022 17:31:57 +0100 Subject: [PATCH 09/39] fix more tests --- x/gov/keeper/grpc_query.go | 6 +++--- x/gov/keeper/proposal.go | 10 ++++++++-- x/gov/keeper/proposal_test.go | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/x/gov/keeper/grpc_query.go b/x/gov/keeper/grpc_query.go index 41f058d7ba1f..02812a6a0c8c 100644 --- a/x/gov/keeper/grpc_query.go +++ b/x/gov/keeper/grpc_query.go @@ -229,12 +229,12 @@ func (q Keeper) Deposits(c context.Context, req *v1beta2.QueryDepositsRequest) ( depositStore := prefix.NewStore(store, types.DepositsKey(req.ProposalId)) pageRes, err := query.Paginate(depositStore, req.Pagination, func(key []byte, value []byte) error { - var deposit *v1beta2.Deposit - if err := q.cdc.Unmarshal(value, deposit); err != nil { + var deposit v1beta2.Deposit + if err := q.cdc.Unmarshal(value, &deposit); err != nil { return err } - deposits = append(deposits, deposit) + deposits = append(deposits, &deposit) return nil }) diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 03314d4c40df..c80bc1c02e52 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -130,8 +130,14 @@ func (keeper Keeper) DeleteProposal(ctx sdk.Context, proposalID uint64) { if !ok { panic(fmt.Sprintf("couldn't find proposal with id#%d", proposalID)) } - keeper.RemoveFromInactiveProposalQueue(ctx, proposalID, *proposal.DepositEndTime) - keeper.RemoveFromActiveProposalQueue(ctx, proposalID, *proposal.VotingEndTime) + + if proposal.DepositEndTime != nil { + keeper.RemoveFromInactiveProposalQueue(ctx, proposalID, *proposal.DepositEndTime) + } + if proposal.VotingEndTime != nil { + keeper.RemoveFromActiveProposalQueue(ctx, proposalID, *proposal.VotingEndTime) + } + store.Delete(types.ProposalKey(proposalID)) } diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index 9b4ebb7927fc..4022a5e0deb4 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -33,7 +33,7 @@ func (suite *KeeperTestSuite) TestActivateVotingPeriod() { proposal, err := suite.app.GovKeeper.SubmitProposal(suite.ctx, tp) suite.Require().NoError(err) - suite.Require().True(proposal.VotingStartTime.Equal(time.Time{})) + suite.Require().Nil(proposal.VotingStartTime) suite.app.GovKeeper.ActivateVotingPeriod(suite.ctx, proposal) From 833db47258ce95d3865570509139618b1cb18b7c Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Tue, 11 Jan 2022 17:55:13 +0100 Subject: [PATCH 10/39] Fix some tests --- simapp/app.go | 6 +++--- x/auth/client/testutil/suite.go | 6 +++--- x/authz/client/cli/tx.go | 2 +- x/authz/client/testutil/tx.go | 15 ++++++++------- x/distribution/client/cli/tx.go | 4 ++-- x/distribution/types/codec.go | 4 ++-- x/feegrant/client/testutil/suite.go | 9 +++++---- x/feegrant/filtered_fee_test.go | 4 ++-- x/feegrant/simulation/genesis.go | 2 +- 9 files changed, 27 insertions(+), 25 deletions(-) diff --git a/simapp/app.go b/simapp/app.go index a5502c0a0302..8e3747285d77 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -66,8 +66,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" govv1beta2 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" - oldgovtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/group" groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper" groupmodule "github.com/cosmos/cosmos-sdk/x/group/module" @@ -297,8 +297,8 @@ func NewSimApp( app.GroupKeeper = groupkeeper.NewKeeper(keys[group.StoreKey], appCodec, app.msgSvcRouter, app.AccountKeeper) // register the proposal types - govRouter := oldgovtypes.NewRouter() - govRouter.AddRoute(govtypes.RouterKey, oldgovtypes.ProposalHandler). + govRouter := govv1beta1.NewRouter() + govRouter.AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)) diff --git a/x/auth/client/testutil/suite.go b/x/auth/client/testutil/suite.go index 9120e21a5539..b1c0a1f0b3a1 100644 --- a/x/auth/client/testutil/suite.go +++ b/x/auth/client/testutil/suite.go @@ -35,7 +35,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" govtestutil "github.com/cosmos/cosmos-sdk/x/gov/client/testutil" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + v1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) type IntegrationTestSuite struct { @@ -1508,7 +1508,7 @@ func (s *IntegrationTestSuite) TestAuxSigner() { val.Address.String(), "test", "test desc", - govtypes.ProposalTypeText, + v1beta1.ProposalTypeText, tc.args..., ) if tc.expectErr { @@ -1752,7 +1752,7 @@ func (s *IntegrationTestSuite) TestAuxToFee() { tipper.String(), "test", "test desc", - govtypes.ProposalTypeText, + v1beta1.ProposalTypeText, tc.tipperArgs..., ) diff --git a/x/authz/client/cli/tx.go b/x/authz/client/cli/tx.go index c3157684d24c..18531486cc15 100644 --- a/x/authz/client/cli/tx.go +++ b/x/authz/client/cli/tx.go @@ -60,7 +60,7 @@ func NewCmdGrantAuthorization() *cobra.Command { Examples: $ %s tx %s grant cosmos1skjw.. send %s --spend-limit=1000stake --from=cosmos1skl.. - $ %s tx %s grant cosmos1skjw.. generic --msg-type=/cosmos.gov.v1beta1.MsgVote --from=cosmos1sk.. + $ %s tx %s grant cosmos1skjw.. generic --msg-type=/cosmos.gov.v1beta2.MsgVote --from=cosmos1sk.. `, version.AppName, authz.ModuleName, bank.SendAuthorization{}.MsgTypeURL(), version.AppName, authz.ModuleName), ), Args: cobra.ExactArgs(2), diff --git a/x/authz/client/testutil/tx.go b/x/authz/client/testutil/tx.go index f3f245e1f52c..e883aa6fe848 100644 --- a/x/authz/client/testutil/tx.go +++ b/x/authz/client/testutil/tx.go @@ -19,7 +19,8 @@ import ( bank "github.com/cosmos/cosmos-sdk/x/bank/types" govcli "github.com/cosmos/cosmos-sdk/x/gov/client/cli" govtestutil "github.com/cosmos/cosmos-sdk/x/gov/client/testutil" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + govv1beta2 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" stakingcli "github.com/cosmos/cosmos-sdk/x/staking/client/cli" ) @@ -54,8 +55,8 @@ func (s *IntegrationTestSuite) SetupSuite() { // create a proposal with deposit _, err = govtestutil.MsgSubmitProposal(val.ClientCtx, val.Address.String(), - "Text Proposal 1", "Where is the title!?", govtypes.ProposalTypeText, - fmt.Sprintf("--%s=%s", govcli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, govtypes.DefaultMinDepositTokens).String())) + "Text Proposal 1", "Where is the title!?", govv1beta1.ProposalTypeText, + fmt.Sprintf("--%s=%s", govcli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, govv1beta2.DefaultMinDepositTokens).String())) s.Require().NoError(err) // Create new account in the keyring. @@ -139,8 +140,8 @@ func (s *IntegrationTestSuite) TearDownSuite() { } var typeMsgSend = bank.SendAuthorization{}.MsgTypeURL() -var typeMsgVote = sdk.MsgTypeURL(&govtypes.MsgVote{}) -var typeMsgSubmitProposal = sdk.MsgTypeURL(&govtypes.MsgSubmitProposal{}) +var typeMsgVote = sdk.MsgTypeURL(&govv1beta2.MsgVote{}) +var typeMsgSubmitProposal = sdk.MsgTypeURL(&govv1beta2.MsgSubmitProposal{}) func (s *IntegrationTestSuite) TestCLITxGrantAuthorization() { val := s.network.Validators[0] @@ -531,7 +532,7 @@ func (s *IntegrationTestSuite) TestExecAuthorizationWithExpiration() { ) s.Require().NoError(err) // msg vote - voteTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.gov.v1beta1.MsgVote","proposal_id":"1","voter":"%s","option":"VOTE_OPTION_YES"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String()) + voteTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.gov.v1beta2.MsgVote","proposal_id":"1","voter":"%s","option":"VOTE_OPTION_YES"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String()) execMsg := testutil.WriteToNewTempFile(s.T(), voteTx) // waiting for authorization to expires @@ -572,7 +573,7 @@ func (s *IntegrationTestSuite) TestNewExecGenericAuthorized() { s.Require().NoError(err) // msg vote - voteTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.gov.v1beta1.MsgVote","proposal_id":"1","voter":"%s","option":"VOTE_OPTION_YES"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String()) + voteTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.gov.v1beta2.MsgVote","proposal_id":"1","voter":"%s","option":"VOTE_OPTION_YES"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}`, val.Address.String()) execMsg := testutil.WriteToNewTempFile(s.T(), voteTx) testCases := []struct { diff --git a/x/distribution/client/cli/tx.go b/x/distribution/client/cli/tx.go index d9ec9feeebbc..37db59cfc908 100644 --- a/x/distribution/client/cli/tx.go +++ b/x/distribution/client/cli/tx.go @@ -13,7 +13,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/distribution/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // Transaction flags for the x/distribution module @@ -312,7 +312,7 @@ Where proposal.json contains: } content := types.NewCommunityPoolSpendProposal(proposal.Title, proposal.Description, recpAddr, amount) - msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + msg, err := govv1beta1.NewMsgSubmitProposal(content, deposit, from) if err != nil { return err } diff --git a/x/distribution/types/codec.go b/x/distribution/types/codec.go index 0e1d1df42be3..19a3fac27408 100644 --- a/x/distribution/types/codec.go +++ b/x/distribution/types/codec.go @@ -6,7 +6,7 @@ import ( cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // RegisterLegacyAminoCodec registers the necessary x/distribution interfaces and concrete types @@ -28,7 +28,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &MsgFundCommunityPool{}, ) registry.RegisterImplementations( - (*govtypes.Content)(nil), + (*govv1beta1.Content)(nil), &CommunityPoolSpendProposal{}, ) diff --git a/x/feegrant/client/testutil/suite.go b/x/feegrant/client/testutil/suite.go index f30dc2a40e36..9a0bcde9f6c2 100644 --- a/x/feegrant/client/testutil/suite.go +++ b/x/feegrant/client/testutil/suite.go @@ -21,7 +21,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/feegrant" "github.com/cosmos/cosmos-sdk/x/feegrant/client/cli" govtestutil "github.com/cosmos/cosmos-sdk/x/gov/client/testutil" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + govv1beta2 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) const ( @@ -696,7 +697,7 @@ func (s *IntegrationTestSuite) TestTxWithFeeGrant() { // granted fee allowance for an account which is not in state and creating // any tx with it by using --fee-account shouldn't fail out, err := govtestutil.MsgSubmitProposal(val.ClientCtx, grantee.String(), - "Text Proposal", "No desc", govtypes.ProposalTypeText, + "Text Proposal", "No desc", govv1beta1.ProposalTypeText, fmt.Sprintf("--%s=%s", flags.FlagFeeGranter, granter.String()), ) @@ -725,7 +726,7 @@ func (s *IntegrationTestSuite) TestFilteredFeeAllowance() { } spendLimit := sdk.NewCoin("stake", sdk.NewInt(1000)) - allowMsgs := strings.Join([]string{sdk.MsgTypeURL(&govtypes.MsgSubmitProposal{}), sdk.MsgTypeURL(&govtypes.MsgVoteWeighted{})}, ",") + allowMsgs := strings.Join([]string{sdk.MsgTypeURL(&govv1beta2.MsgSubmitProposal{}), sdk.MsgTypeURL(&govv1beta2.MsgVoteWeighted{})}, ",") testCases := []struct { name string @@ -836,7 +837,7 @@ func (s *IntegrationTestSuite) TestFilteredFeeAllowance() { "valid proposal tx", func() (testutil.BufferWriter, error) { return govtestutil.MsgSubmitProposal(val.ClientCtx, grantee.String(), - "Text Proposal", "No desc", govtypes.ProposalTypeText, + "Text Proposal", "No desc", govv1beta1.ProposalTypeText, fmt.Sprintf("--%s=%s", flags.FlagFeeGranter, granter.String()), ) }, diff --git a/x/feegrant/filtered_fee_test.go b/x/feegrant/filtered_fee_test.go index 6da02a800a4d..f754d88bd871 100644 --- a/x/feegrant/filtered_fee_test.go +++ b/x/feegrant/filtered_fee_test.go @@ -5,9 +5,9 @@ import ( "time" "github.com/cosmos/cosmos-sdk/x/feegrant" - ocproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + ocproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" @@ -47,7 +47,7 @@ func TestFilteredFeeValidAllow(t *testing.T) { }, "msg not contained": { allowance: &feegrant.BasicAllowance{}, - msgs: []string{"/cosmos.gov.v1beta1.MsgVote"}, + msgs: []string{"/cosmos.gov.v1beta2.MsgVote"}, accept: false, }, "small fee without expire": { diff --git a/x/feegrant/simulation/genesis.go b/x/feegrant/simulation/genesis.go index d01e42b2b663..78bc579cca79 100644 --- a/x/feegrant/simulation/genesis.go +++ b/x/feegrant/simulation/genesis.go @@ -48,7 +48,7 @@ func generateRandomAllowances(granter, grantee sdk.AccAddress, r *rand.Rand) fee filteredAllowance, err := feegrant.NewGrant(granter, grantee, &feegrant.AllowedMsgAllowance{ Allowance: basicAllowance.GetAllowance(), - AllowedMessages: []string{"/cosmos.gov.v1beta1.MsgSubmitProposal"}, + AllowedMessages: []string{"/cosmos.gov.v1beta2.MsgSubmitProposal"}, }) if err != nil { panic(err) From 1f465812677c070522f102f5bb4a0d46f8608a28 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Tue, 11 Jan 2022 18:56:38 +0100 Subject: [PATCH 11/39] Fix some more tests --- x/gov/client/cli/query.go | 76 ++++++++++++------------- x/gov/client/utils/query.go | 96 ++++++++++++++++---------------- x/gov/client/utils/query_test.go | 36 ++++++------ x/gov/genesis_test.go | 2 +- x/gov/keeper/proposal.go | 2 +- x/gov/types/v1beta2/genesis.go | 8 +-- x/gov/types/v1beta2/params.go | 26 ++++----- x/params/client/cli/tx.go | 10 +++- 8 files changed, 131 insertions(+), 125 deletions(-) diff --git a/x/gov/client/cli/query.go b/x/gov/client/cli/query.go index ffd31d816415..2b4deee300cf 100644 --- a/x/gov/client/cli/query.go +++ b/x/gov/client/cli/query.go @@ -13,7 +13,7 @@ import ( "github.com/cosmos/cosmos-sdk/version" gcutils "github.com/cosmos/cosmos-sdk/x/gov/client/utils" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) // GetQueryCmd returns the cli query commands for this module @@ -64,7 +64,7 @@ $ %s query gov proposal 1 if err != nil { return err } - queryClient := v1beta1.NewQueryClient(clientCtx) + queryClient := v1beta2.NewQueryClient(clientCtx) // validate that the proposal id is a uint proposalID, err := strconv.ParseUint(args[0], 10, 64) @@ -75,13 +75,13 @@ $ %s query gov proposal 1 // Query the proposal res, err := queryClient.Proposal( cmd.Context(), - &v1beta1.QueryProposalRequest{ProposalId: proposalID}, + &v1beta2.QueryProposalRequest{ProposalId: proposalID}, ) if err != nil { return err } - return clientCtx.PrintProto(&res.Proposal) + return clientCtx.PrintProto(res.Proposal) }, } @@ -113,7 +113,7 @@ $ %s query gov proposals --page=2 --limit=100 bechVoterAddr, _ := cmd.Flags().GetString(flagVoter) strProposalStatus, _ := cmd.Flags().GetString(flagStatus) - var proposalStatus v1beta1.ProposalStatus + var proposalStatus v1beta2.ProposalStatus if len(bechDepositorAddr) != 0 { _, err := sdk.AccAddressFromBech32(bechDepositorAddr) @@ -130,7 +130,7 @@ $ %s query gov proposals --page=2 --limit=100 } if len(strProposalStatus) != 0 { - proposalStatus1, err := v1beta1.ProposalStatusFromString(gcutils.NormalizeProposalStatus(strProposalStatus)) + proposalStatus1, err := v1beta2.ProposalStatusFromString(gcutils.NormalizeProposalStatus(strProposalStatus)) proposalStatus = proposalStatus1 if err != nil { return err @@ -141,7 +141,7 @@ $ %s query gov proposals --page=2 --limit=100 if err != nil { return err } - queryClient := v1beta1.NewQueryClient(clientCtx) + queryClient := v1beta2.NewQueryClient(clientCtx) pageReq, err := client.ReadPageRequest(cmd.Flags()) if err != nil { @@ -150,7 +150,7 @@ $ %s query gov proposals --page=2 --limit=100 res, err := queryClient.Proposals( cmd.Context(), - &v1beta1.QueryProposalsRequest{ + &v1beta2.QueryProposalsRequest{ ProposalStatus: proposalStatus, Voter: bechVoterAddr, Depositor: bechDepositorAddr, @@ -199,7 +199,7 @@ $ %s query gov vote 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk if err != nil { return err } - queryClient := v1beta1.NewQueryClient(clientCtx) + queryClient := v1beta2.NewQueryClient(clientCtx) // validate that the proposal id is a uint proposalID, err := strconv.ParseUint(args[0], 10, 64) @@ -211,7 +211,7 @@ $ %s query gov vote 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk ctx := cmd.Context() _, err = queryClient.Proposal( ctx, - &v1beta1.QueryProposalRequest{ProposalId: proposalID}, + &v1beta2.QueryProposalRequest{ProposalId: proposalID}, ) if err != nil { return fmt.Errorf("failed to fetch proposal-id %d: %s", proposalID, err) @@ -224,7 +224,7 @@ $ %s query gov vote 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk res, err := queryClient.Vote( ctx, - &v1beta1.QueryVoteRequest{ProposalId: proposalID, Voter: args[1]}, + &v1beta2.QueryVoteRequest{ProposalId: proposalID, Voter: args[1]}, ) if err != nil { return err @@ -232,19 +232,19 @@ $ %s query gov vote 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk vote := res.GetVote() if vote.Empty() { - params := v1beta1.NewQueryVoteParams(proposalID, voterAddr) + params := v1beta2.NewQueryVoteParams(proposalID, voterAddr) resByTxQuery, err := gcutils.QueryVoteByTxQuery(clientCtx, params) if err != nil { return err } - if err := clientCtx.Codec.UnmarshalJSON(resByTxQuery, &vote); err != nil { + if err := clientCtx.Codec.UnmarshalJSON(resByTxQuery, vote); err != nil { return err } } - return clientCtx.PrintProto(&res.Vote) + return clientCtx.PrintProto(res.Vote) }, } @@ -274,7 +274,7 @@ $ %[1]s query gov votes 1 --page=2 --limit=100 if err != nil { return err } - queryClient := v1beta1.NewQueryClient(clientCtx) + queryClient := v1beta2.NewQueryClient(clientCtx) // validate that the proposal id is a uint proposalID, err := strconv.ParseUint(args[0], 10, 64) @@ -286,24 +286,24 @@ $ %[1]s query gov votes 1 --page=2 --limit=100 ctx := cmd.Context() proposalRes, err := queryClient.Proposal( ctx, - &v1beta1.QueryProposalRequest{ProposalId: proposalID}, + &v1beta2.QueryProposalRequest{ProposalId: proposalID}, ) if err != nil { return fmt.Errorf("failed to fetch proposal-id %d: %s", proposalID, err) } propStatus := proposalRes.GetProposal().Status - if !(propStatus == v1beta1.StatusVotingPeriod || propStatus == v1beta1.StatusDepositPeriod) { + if !(propStatus == v1beta2.StatusVotingPeriod || propStatus == v1beta2.StatusDepositPeriod) { page, _ := cmd.Flags().GetInt(flags.FlagPage) limit, _ := cmd.Flags().GetInt(flags.FlagLimit) - params := v1beta1.NewQueryProposalVotesParams(proposalID, page, limit) + params := v1beta2.NewQueryProposalVotesParams(proposalID, page, limit) resByTxQuery, err := gcutils.QueryVotesByTxQuery(clientCtx, params) if err != nil { return err } - var votes v1beta1.Votes + var votes v1beta2.Votes // TODO migrate to use JSONCodec (implement MarshalJSONArray // or wrap lists of proto.Message in some other message) clientCtx.LegacyAmino.MustUnmarshalJSON(resByTxQuery, &votes) @@ -318,7 +318,7 @@ $ %[1]s query gov votes 1 --page=2 --limit=100 res, err := queryClient.Votes( ctx, - &v1beta1.QueryVotesRequest{ProposalId: proposalID, Pagination: pageReq}, + &v1beta2.QueryVotesRequest{ProposalId: proposalID, Pagination: pageReq}, ) if err != nil { @@ -357,7 +357,7 @@ $ %s query gov deposit 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk if err != nil { return err } - queryClient := v1beta1.NewQueryClient(clientCtx) + queryClient := v1beta2.NewQueryClient(clientCtx) // validate that the proposal id is a uint proposalID, err := strconv.ParseUint(args[0], 10, 64) @@ -369,7 +369,7 @@ $ %s query gov deposit 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk ctx := cmd.Context() _, err = queryClient.Proposal( ctx, - &v1beta1.QueryProposalRequest{ProposalId: proposalID}, + &v1beta2.QueryProposalRequest{ProposalId: proposalID}, ) if err != nil { return fmt.Errorf("failed to fetch proposal-id %d: %s", proposalID, err) @@ -377,13 +377,13 @@ $ %s query gov deposit 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk res, err := queryClient.Deposit( ctx, - &v1beta1.QueryDepositRequest{ProposalId: proposalID, Depositor: args[1]}, + &v1beta2.QueryDepositRequest{ProposalId: proposalID, Depositor: args[1]}, ) if err != nil { return err } - return clientCtx.PrintProto(&res.Deposit) + return clientCtx.PrintProto(res.Deposit) }, } @@ -413,7 +413,7 @@ $ %s query gov deposits 1 if err != nil { return err } - queryClient := v1beta1.NewQueryClient(clientCtx) + queryClient := v1beta2.NewQueryClient(clientCtx) // validate that the proposal id is a uint proposalID, err := strconv.ParseUint(args[0], 10, 64) @@ -425,7 +425,7 @@ $ %s query gov deposits 1 ctx := cmd.Context() _, err = queryClient.Proposal( ctx, - &v1beta1.QueryProposalRequest{ProposalId: proposalID}, + &v1beta2.QueryProposalRequest{ProposalId: proposalID}, ) if err != nil { return fmt.Errorf("failed to fetch proposal-id %d: %s", proposalID, err) @@ -438,7 +438,7 @@ $ %s query gov deposits 1 res, err := queryClient.Deposits( ctx, - &v1beta1.QueryDepositsRequest{ProposalId: proposalID, Pagination: pageReq}, + &v1beta2.QueryDepositsRequest{ProposalId: proposalID, Pagination: pageReq}, ) if err != nil { @@ -476,7 +476,7 @@ $ %s query gov tally 1 if err != nil { return err } - queryClient := v1beta1.NewQueryClient(clientCtx) + queryClient := v1beta2.NewQueryClient(clientCtx) // validate that the proposal id is a uint proposalID, err := strconv.ParseUint(args[0], 10, 64) @@ -488,7 +488,7 @@ $ %s query gov tally 1 ctx := cmd.Context() _, err = queryClient.Proposal( ctx, - &v1beta1.QueryProposalRequest{ProposalId: proposalID}, + &v1beta2.QueryProposalRequest{ProposalId: proposalID}, ) if err != nil { return fmt.Errorf("failed to fetch proposal-id %d: %s", proposalID, err) @@ -497,13 +497,13 @@ $ %s query gov tally 1 // Query store res, err := queryClient.TallyResult( ctx, - &v1beta1.QueryTallyResultRequest{ProposalId: proposalID}, + &v1beta2.QueryTallyResultRequest{ProposalId: proposalID}, ) if err != nil { return err } - return clientCtx.PrintProto(&res.Tally) + return clientCtx.PrintProto(res.Tally) }, } @@ -532,13 +532,13 @@ $ %s query gov params if err != nil { return err } - queryClient := v1beta1.NewQueryClient(clientCtx) + queryClient := v1beta2.NewQueryClient(clientCtx) // Query store for all 3 params ctx := cmd.Context() votingRes, err := queryClient.Params( ctx, - &v1beta1.QueryParamsRequest{ParamsType: "voting"}, + &v1beta2.QueryParamsRequest{ParamsType: "voting"}, ) if err != nil { return err @@ -546,7 +546,7 @@ $ %s query gov params tallyRes, err := queryClient.Params( ctx, - &v1beta1.QueryParamsRequest{ParamsType: "tallying"}, + &v1beta2.QueryParamsRequest{ParamsType: "tallying"}, ) if err != nil { return err @@ -554,13 +554,13 @@ $ %s query gov params depositRes, err := queryClient.Params( ctx, - &v1beta1.QueryParamsRequest{ParamsType: "deposit"}, + &v1beta2.QueryParamsRequest{ParamsType: "deposit"}, ) if err != nil { return err } - params := v1beta1.NewParams( + params := v1beta2.NewParams( votingRes.GetVotingParams(), tallyRes.GetTallyParams(), depositRes.GetDepositParams(), @@ -597,12 +597,12 @@ $ %s query gov param deposit if err != nil { return err } - queryClient := v1beta1.NewQueryClient(clientCtx) + queryClient := v1beta2.NewQueryClient(clientCtx) // Query store res, err := queryClient.Params( cmd.Context(), - &v1beta1.QueryParamsRequest{ParamsType: args[0]}, + &v1beta2.QueryParamsRequest{ParamsType: args[0]}, ) if err != nil { return err diff --git a/x/gov/client/utils/query.go b/x/gov/client/utils/query.go index c5f7a8b28f64..426f4b7d31d5 100644 --- a/x/gov/client/utils/query.go +++ b/x/gov/client/utils/query.go @@ -8,7 +8,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) const ( @@ -38,8 +38,8 @@ func (p Proposer) String() string { // // NOTE: SearchTxs is used to facilitate the txs query which does not currently // support configurable pagination. -func QueryDepositsByTxQuery(clientCtx client.Context, params v1beta1.QueryProposalParams) ([]byte, error) { - var deposits []v1beta1.Deposit +func QueryDepositsByTxQuery(clientCtx client.Context, params v1beta2.QueryProposalParams) ([]byte, error) { + var deposits []v1beta2.Deposit // initial deposit was submitted with proposal, so must be queried separately initialDeposit, err := queryInitialDepositByTxQuery(clientCtx, params.ProposalID) @@ -47,7 +47,7 @@ func QueryDepositsByTxQuery(clientCtx client.Context, params v1beta1.QueryPropos return nil, err } - if !initialDeposit.Amount.IsZero() { + if !sdk.Coins(initialDeposit.Amount).IsZero() { deposits = append(deposits, initialDeposit) } @@ -55,12 +55,12 @@ func QueryDepositsByTxQuery(clientCtx client.Context, params v1beta1.QueryPropos clientCtx, defaultPage, // Query legacy Msgs event action []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta1.TypeMsgDeposit), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgDeposit), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalDeposit, types.AttributeKeyProposalID, params.ProposalID), }, // Query proto Msgs event action []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta1.MsgDeposit{})), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta2.MsgDeposit{})), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalDeposit, types.AttributeKeyProposalID, params.ProposalID), }, ) @@ -70,8 +70,8 @@ func QueryDepositsByTxQuery(clientCtx client.Context, params v1beta1.QueryPropos for _, info := range searchResult.Txs { for _, msg := range info.GetTx().GetMsgs() { - if depMsg, ok := msg.(*v1beta1.MsgDeposit); ok { - deposits = append(deposits, v1beta1.Deposit{ + if depMsg, ok := msg.(*v1beta2.MsgDeposit); ok { + deposits = append(deposits, v1beta2.Deposit{ Depositor: depMsg.Depositor, ProposalId: params.ProposalID, Amount: depMsg.Amount, @@ -91,9 +91,9 @@ func QueryDepositsByTxQuery(clientCtx client.Context, params v1beta1.QueryPropos // QueryVotesByTxQuery will query for votes via a direct txs tags query. It // will fetch and build votes directly from the returned txs and return a JSON // marshalled result or any error that occurred. -func QueryVotesByTxQuery(clientCtx client.Context, params v1beta1.QueryProposalVotesParams) ([]byte, error) { +func QueryVotesByTxQuery(clientCtx client.Context, params v1beta2.QueryProposalVotesParams) ([]byte, error) { var ( - votes []v1beta1.Vote + votes []v1beta2.Vote nextTxPage = defaultPage totalLimit = params.Limit * params.Page ) @@ -105,22 +105,22 @@ func QueryVotesByTxQuery(clientCtx client.Context, params v1beta1.QueryProposalV clientCtx, nextTxPage, // Query legacy Vote Msgs []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta1.TypeMsgVote), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgVote), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), }, // Query Vote proto Msgs []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta1.MsgVote{})), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta2.MsgVote{})), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), }, // Query legacy VoteWeighted Msgs []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta1.TypeMsgVoteWeighted), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgVoteWeighted), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), }, // Query VoteWeighted proto Msgs []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta1.MsgVoteWeighted{})), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta2.MsgVoteWeighted{})), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), }, ) @@ -130,16 +130,16 @@ func QueryVotesByTxQuery(clientCtx client.Context, params v1beta1.QueryProposalV for _, info := range searchResult.Txs { for _, msg := range info.GetTx().GetMsgs() { - if voteMsg, ok := msg.(*v1beta1.MsgVote); ok { - votes = append(votes, v1beta1.Vote{ + if voteMsg, ok := msg.(*v1beta2.MsgVote); ok { + votes = append(votes, v1beta2.Vote{ Voter: voteMsg.Voter, ProposalId: params.ProposalID, - Options: v1beta1.NewNonSplitVoteOption(voteMsg.Option), + Options: v1beta2.NewNonSplitVoteOption(voteMsg.Option), }) } - if voteWeightedMsg, ok := msg.(*v1beta1.MsgVoteWeighted); ok { - votes = append(votes, v1beta1.Vote{ + if voteWeightedMsg, ok := msg.(*v1beta2.MsgVoteWeighted); ok { + votes = append(votes, v1beta2.Vote{ Voter: voteWeightedMsg.Voter, ProposalId: params.ProposalID, Options: voteWeightedMsg.Options, @@ -155,7 +155,7 @@ func QueryVotesByTxQuery(clientCtx client.Context, params v1beta1.QueryProposalV } start, end := client.Paginate(len(votes), params.Page, params.Limit, 100) if start < 0 || end < 0 { - votes = []v1beta1.Vote{} + votes = []v1beta2.Vote{} } else { votes = votes[start:end] } @@ -169,30 +169,30 @@ func QueryVotesByTxQuery(clientCtx client.Context, params v1beta1.QueryProposalV } // QueryVoteByTxQuery will query for a single vote via a direct txs tags query. -func QueryVoteByTxQuery(clientCtx client.Context, params v1beta1.QueryVoteParams) ([]byte, error) { +func QueryVoteByTxQuery(clientCtx client.Context, params v1beta2.QueryVoteParams) ([]byte, error) { searchResult, err := combineEvents( clientCtx, defaultPage, // Query legacy Vote Msgs []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta1.TypeMsgVote), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgVote), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeySender, params.Voter), }, // Query Vote proto Msgs []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta1.MsgVote{})), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta2.MsgVote{})), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeySender, params.Voter.String()), }, // Query legacy VoteWeighted Msgs []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta1.TypeMsgVoteWeighted), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgVoteWeighted), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeySender, params.Voter.String()), }, // Query VoteWeighted proto Msgs []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta1.MsgVoteWeighted{})), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta2.MsgVoteWeighted{})), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeySender, params.Voter), }, @@ -204,17 +204,17 @@ func QueryVoteByTxQuery(clientCtx client.Context, params v1beta1.QueryVoteParams for _, info := range searchResult.Txs { for _, msg := range info.GetTx().GetMsgs() { // there should only be a single vote under the given conditions - var vote *v1beta1.Vote - if voteMsg, ok := msg.(*v1beta1.MsgVote); ok { - vote = &v1beta1.Vote{ + var vote *v1beta2.Vote + if voteMsg, ok := msg.(*v1beta2.MsgVote); ok { + vote = &v1beta2.Vote{ Voter: voteMsg.Voter, ProposalId: params.ProposalID, - Options: v1beta1.NewNonSplitVoteOption(voteMsg.Option), + Options: v1beta2.NewNonSplitVoteOption(voteMsg.Option), } } - if voteWeightedMsg, ok := msg.(*v1beta1.MsgVoteWeighted); ok { - vote = &v1beta1.Vote{ + if voteWeightedMsg, ok := msg.(*v1beta2.MsgVoteWeighted); ok { + vote = &v1beta2.Vote{ Voter: voteWeightedMsg.Voter, ProposalId: params.ProposalID, Options: voteWeightedMsg.Options, @@ -237,7 +237,7 @@ func QueryVoteByTxQuery(clientCtx client.Context, params v1beta1.QueryVoteParams // QueryDepositByTxQuery will query for a single deposit via a direct txs tags // query. -func QueryDepositByTxQuery(clientCtx client.Context, params v1beta1.QueryDepositParams) ([]byte, error) { +func QueryDepositByTxQuery(clientCtx client.Context, params v1beta2.QueryDepositParams) ([]byte, error) { // initial deposit was submitted with proposal, so must be queried separately initialDeposit, err := queryInitialDepositByTxQuery(clientCtx, params.ProposalID) @@ -245,7 +245,7 @@ func QueryDepositByTxQuery(clientCtx client.Context, params v1beta1.QueryDeposit return nil, err } - if !initialDeposit.Amount.IsZero() { + if !sdk.Coins(initialDeposit.Amount).IsZero() { bz, err := clientCtx.Codec.MarshalJSON(&initialDeposit) if err != nil { return nil, err @@ -258,13 +258,13 @@ func QueryDepositByTxQuery(clientCtx client.Context, params v1beta1.QueryDeposit clientCtx, defaultPage, // Query legacy Msgs event action []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta1.TypeMsgDeposit), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgDeposit), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalDeposit, types.AttributeKeyProposalID, params.ProposalID), fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeySender, params.Depositor.String()), }, // Query proto Msgs event action []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta1.MsgDeposit{})), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta2.MsgDeposit{})), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalDeposit, types.AttributeKeyProposalID, params.ProposalID), fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeySender, params.Depositor.String()), }, @@ -276,8 +276,8 @@ func QueryDepositByTxQuery(clientCtx client.Context, params v1beta1.QueryDeposit for _, info := range searchResult.Txs { for _, msg := range info.GetTx().GetMsgs() { // there should only be a single deposit under the given conditions - if depMsg, ok := msg.(*v1beta1.MsgDeposit); ok { - deposit := v1beta1.Deposit{ + if depMsg, ok := msg.(*v1beta2.MsgDeposit); ok { + deposit := v1beta2.Deposit{ Depositor: depMsg.Depositor, ProposalId: params.ProposalID, Amount: depMsg.Amount, @@ -304,12 +304,12 @@ func QueryProposerByTxQuery(clientCtx client.Context, proposalID uint64) (Propos defaultPage, // Query legacy Msgs event action []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta1.TypeMsgSubmitProposal), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgSubmitProposal), fmt.Sprintf("%s.%s='%d'", types.EventTypeSubmitProposal, types.AttributeKeyProposalID, proposalID), }, // Query proto Msgs event action []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta1.MsgSubmitProposal{})), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta2.MsgSubmitProposal{})), fmt.Sprintf("%s.%s='%d'", types.EventTypeSubmitProposal, types.AttributeKeyProposalID, proposalID), }, ) @@ -320,7 +320,7 @@ func QueryProposerByTxQuery(clientCtx client.Context, proposalID uint64) (Propos for _, info := range searchResult.Txs { for _, msg := range info.GetTx().GetMsgs() { // there should only be a single proposal under the given conditions - if subMsg, ok := msg.(*v1beta1.MsgSubmitProposal); ok { + if subMsg, ok := msg.(*v1beta2.MsgSubmitProposal); ok { return NewProposer(proposalID, subMsg.Proposer), nil } } @@ -331,7 +331,7 @@ func QueryProposerByTxQuery(clientCtx client.Context, proposalID uint64) (Propos // QueryProposalByID takes a proposalID and returns a proposal func QueryProposalByID(proposalID uint64, clientCtx client.Context, queryRoute string) ([]byte, error) { - params := v1beta1.NewQueryProposalParams(proposalID) + params := v1beta2.NewQueryProposalParams(proposalID) bz, err := clientCtx.LegacyAmino.MarshalJSON(params) if err != nil { return nil, err @@ -369,30 +369,30 @@ func combineEvents(clientCtx client.Context, page int, eventGroups ...[]string) // queryInitialDepositByTxQuery will query for a initial deposit of a governance proposal by // ID. -func queryInitialDepositByTxQuery(clientCtx client.Context, proposalID uint64) (v1beta1.Deposit, error) { +func queryInitialDepositByTxQuery(clientCtx client.Context, proposalID uint64) (v1beta2.Deposit, error) { searchResult, err := combineEvents( clientCtx, defaultPage, // Query legacy Msgs event action []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta1.TypeMsgSubmitProposal), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgSubmitProposal), fmt.Sprintf("%s.%s='%d'", types.EventTypeSubmitProposal, types.AttributeKeyProposalID, proposalID), }, // Query proto Msgs event action []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta1.MsgSubmitProposal{})), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta2.MsgSubmitProposal{})), fmt.Sprintf("%s.%s='%d'", types.EventTypeSubmitProposal, types.AttributeKeyProposalID, proposalID), }, ) if err != nil { - return v1beta1.Deposit{}, err + return v1beta2.Deposit{}, err } for _, info := range searchResult.Txs { for _, msg := range info.GetTx().GetMsgs() { // there should only be a single proposal under the given conditions - if subMsg, ok := msg.(*v1beta1.MsgSubmitProposal); ok { - return v1beta1.Deposit{ + if subMsg, ok := msg.(*v1beta2.MsgSubmitProposal); ok { + return v1beta2.Deposit{ ProposalId: proposalID, Depositor: subMsg.Proposer, Amount: subMsg.InitialDeposit, @@ -401,5 +401,5 @@ func queryInitialDepositByTxQuery(clientCtx client.Context, proposalID uint64) ( } } - return v1beta1.Deposit{}, sdkerrors.ErrNotFound.Wrapf("failed to find the initial deposit for proposalID %d", proposalID) + return v1beta2.Deposit{}, sdkerrors.ErrNotFound.Wrapf("failed to find the initial deposit for proposalID %d", proposalID) } diff --git a/x/gov/client/utils/query_test.go b/x/gov/client/utils/query_test.go index 091dc7a1fd5e..82a0fde961c9 100644 --- a/x/gov/client/utils/query_test.go +++ b/x/gov/client/utils/query_test.go @@ -15,7 +15,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" "github.com/cosmos/cosmos-sdk/x/gov/client/utils" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) type TxSearchMock struct { @@ -81,19 +81,19 @@ func TestGetPaginatedVotes(t *testing.T) { description string page, limit int msgs [][]sdk.Msg - votes []v1beta1.Vote + votes []v1beta2.Vote } acc1 := make(sdk.AccAddress, 20) acc1[0] = 1 acc2 := make(sdk.AccAddress, 20) acc2[0] = 2 acc1Msgs := []sdk.Msg{ - v1beta1.NewMsgVote(acc1, 0, v1beta1.OptionYes), - v1beta1.NewMsgVote(acc1, 0, v1beta1.OptionYes), + v1beta2.NewMsgVote(acc1, 0, v1beta2.OptionYes), + v1beta2.NewMsgVote(acc1, 0, v1beta2.OptionYes), } acc2Msgs := []sdk.Msg{ - v1beta1.NewMsgVote(acc2, 0, v1beta1.OptionYes), - v1beta1.NewMsgVoteWeighted(acc2, 0, v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)), + v1beta2.NewMsgVote(acc2, 0, v1beta2.OptionYes), + v1beta2.NewMsgVoteWeighted(acc2, 0, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)), } for _, tc := range []testCase{ { @@ -104,9 +104,9 @@ func TestGetPaginatedVotes(t *testing.T) { acc1Msgs[:1], acc2Msgs[:1], }, - votes: []v1beta1.Vote{ - v1beta1.NewVote(0, acc1, v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)), - v1beta1.NewVote(0, acc2, v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))}, + votes: []v1beta2.Vote{ + v1beta2.NewVote(0, acc1, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)), + v1beta2.NewVote(0, acc2, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))}, }, { description: "2MsgPerTx1Chunk", @@ -116,9 +116,9 @@ func TestGetPaginatedVotes(t *testing.T) { acc1Msgs, acc2Msgs, }, - votes: []v1beta1.Vote{ - v1beta1.NewVote(0, acc1, v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)), - v1beta1.NewVote(0, acc1, v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)), + votes: []v1beta2.Vote{ + v1beta2.NewVote(0, acc1, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)), + v1beta2.NewVote(0, acc1, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)), }, }, { @@ -129,9 +129,9 @@ func TestGetPaginatedVotes(t *testing.T) { acc1Msgs, acc2Msgs, }, - votes: []v1beta1.Vote{ - v1beta1.NewVote(0, acc2, v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)), - v1beta1.NewVote(0, acc2, v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)), + votes: []v1beta2.Vote{ + v1beta2.NewVote(0, acc2, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)), + v1beta2.NewVote(0, acc2, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)), }, }, { @@ -141,7 +141,7 @@ func TestGetPaginatedVotes(t *testing.T) { msgs: [][]sdk.Msg{ acc1Msgs[:1], }, - votes: []v1beta1.Vote{v1beta1.NewVote(0, acc1, v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes))}, + votes: []v1beta2.Vote{v1beta2.NewVote(0, acc1, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes))}, }, { description: "InvalidPage", @@ -179,10 +179,10 @@ func TestGetPaginatedVotes(t *testing.T) { marshalled[i] = tx } - params := v1beta1.NewQueryProposalVotesParams(0, tc.page, tc.limit) + params := v1beta2.NewQueryProposalVotesParams(0, tc.page, tc.limit) votesData, err := utils.QueryVotesByTxQuery(clientCtx, params) require.NoError(t, err) - votes := []v1beta1.Vote{} + votes := []v1beta2.Vote{} require.NoError(t, clientCtx.LegacyAmino.UnmarshalJSON(votesData, &votes)) require.Equal(t, len(tc.votes), len(votes)) for i := range votes { diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index 992dd90cfd2b..c450889484f8 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -106,7 +106,7 @@ func TestImportExportQueues(t *testing.T) { require.True(t, proposal2.Status == v1beta2.StatusVotingPeriod) macc := app2.GovKeeper.GetGovernanceAccount(ctx2) - require.Equal(t, app2.GovKeeper.GetDepositParams(ctx2).MinDeposit, app2.BankKeeper.GetAllBalances(ctx2, macc.GetAddress())) + require.Equal(t, sdk.Coins(app2.GovKeeper.GetDepositParams(ctx2).MinDeposit), app2.BankKeeper.GetAllBalances(ctx2, macc.GetAddress())) // Run the endblocker. Check to make sure that proposal1 is removed from state, and proposal2 is finished VotingPeriod. gov.EndBlocker(ctx2, app2.GovKeeper) diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index c80bc1c02e52..92feed14d2dd 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -137,7 +137,7 @@ func (keeper Keeper) DeleteProposal(ctx sdk.Context, proposalID uint64) { if proposal.VotingEndTime != nil { keeper.RemoveFromActiveProposalQueue(ctx, proposalID, *proposal.VotingEndTime) } - + store.Delete(types.ProposalKey(proposalID)) } diff --git a/x/gov/types/v1beta2/genesis.go b/x/gov/types/v1beta2/genesis.go index 693082b3f581..91ee6ad4f612 100644 --- a/x/gov/types/v1beta2/genesis.go +++ b/x/gov/types/v1beta2/genesis.go @@ -8,12 +8,12 @@ import ( ) // NewGenesisState creates a new genesis state for the governance module -func NewGenesisState(startingProposalID uint64, dp DepositParams, vp VotingParams, tp TallyParams) *GenesisState { +func NewGenesisState(startingProposalID uint64, dp *DepositParams, vp *VotingParams, tp *TallyParams) *GenesisState { return &GenesisState{ StartingProposalId: startingProposalID, - DepositParams: &dp, - VotingParams: &vp, - TallyParams: &tp, + DepositParams: dp, + VotingParams: vp, + TallyParams: tp, } } diff --git a/x/gov/types/v1beta2/params.go b/x/gov/types/v1beta2/params.go index f65cf333ccc3..94984509800e 100644 --- a/x/gov/types/v1beta2/params.go +++ b/x/gov/types/v1beta2/params.go @@ -39,15 +39,15 @@ func ParamKeyTable() paramtypes.KeyTable { } // NewDepositParams creates a new DepositParams object -func NewDepositParams(minDeposit sdk.Coins, maxDepositPeriod time.Duration) DepositParams { - return DepositParams{ +func NewDepositParams(minDeposit sdk.Coins, maxDepositPeriod time.Duration) *DepositParams { + return &DepositParams{ MinDeposit: minDeposit, MaxDepositPeriod: &maxDepositPeriod, } } // DefaultDepositParams default parameters for deposits -func DefaultDepositParams() DepositParams { +func DefaultDepositParams() *DepositParams { return NewDepositParams( sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, DefaultMinDepositTokens)), DefaultPeriod, @@ -77,8 +77,8 @@ func validateDepositParams(i interface{}) error { } // NewTallyParams creates a new TallyParams object -func NewTallyParams(quorum, threshold, vetoThreshold sdk.Dec) TallyParams { - return TallyParams{ +func NewTallyParams(quorum, threshold, vetoThreshold sdk.Dec) *TallyParams { + return &TallyParams{ Quorum: quorum.String(), Threshold: threshold.String(), VetoThreshold: vetoThreshold.String(), @@ -86,7 +86,7 @@ func NewTallyParams(quorum, threshold, vetoThreshold sdk.Dec) TallyParams { } // DefaultTallyParams default parameters for tallying -func DefaultTallyParams() TallyParams { +func DefaultTallyParams() *TallyParams { return NewTallyParams(DefaultQuorum, DefaultThreshold, DefaultVetoThreshold) } @@ -138,14 +138,14 @@ func validateTallyParams(i interface{}) error { } // NewVotingParams creates a new VotingParams object -func NewVotingParams(votingPeriod time.Duration) VotingParams { - return VotingParams{ +func NewVotingParams(votingPeriod time.Duration) *VotingParams { + return &VotingParams{ VotingPeriod: &votingPeriod, } } // DefaultVotingParams default parameters for voting -func DefaultVotingParams() VotingParams { +func DefaultVotingParams() *VotingParams { return NewVotingParams(DefaultPeriod) } @@ -173,9 +173,9 @@ func validateVotingParams(i interface{}) error { // Params returns all of the governance params type Params struct { - VotingParams VotingParams `json:"voting_params" yaml:"voting_params"` - TallyParams TallyParams `json:"tally_params" yaml:"tally_params"` - DepositParams DepositParams `json:"deposit_params" yaml:"deposit_params"` + VotingParams *VotingParams `json:"voting_params" yaml:"voting_params"` + TallyParams *TallyParams `json:"tally_params" yaml:"tally_params"` + DepositParams *DepositParams `json:"deposit_params" yaml:"deposit_params"` } func (gp Params) String() string { @@ -184,7 +184,7 @@ func (gp Params) String() string { } // NewParams creates a new gov Params instance -func NewParams(vp VotingParams, tp TallyParams, dp DepositParams) Params { +func NewParams(vp *VotingParams, tp *TallyParams, dp *DepositParams) Params { return Params{ VotingParams: vp, DepositParams: dp, diff --git a/x/params/client/cli/tx.go b/x/params/client/cli/tx.go index 0189b969d28f..7c670d72d641 100644 --- a/x/params/client/cli/tx.go +++ b/x/params/client/cli/tx.go @@ -10,7 +10,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" + govv1beta2 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" paramscutils "github.com/cosmos/cosmos-sdk/x/params/client/utils" paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" ) @@ -76,7 +77,12 @@ Where proposal.json contains: return err } - msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + msgContent, err := govkeeper.NewContentProposal(content, clientCtx.GetFromAddress().String()) + if err != nil { + return err + } + + msg, err := govv1beta2.NewMsgSubmitProposal([]sdk.Msg{msgContent}, deposit, from) if err != nil { return err } From 3355e070a5aec6825b697601c685395e7a8f07e3 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Wed, 12 Jan 2022 14:17:49 +0100 Subject: [PATCH 12/39] Fix 2 or 3 more tests --- x/gov/client/cli/tx.go | 12 +- x/gov/client/testutil/cli_test.go | 4 +- x/gov/keeper/grpc_query_test.go | 10 +- x/gov/types/v1beta2/gov.pb.go | 133 ++-- x/gov/types/v1beta2/msgs.go | 11 +- x/gov/types/v1beta2/params.go | 6 +- x/staking/types/staking.pb.go | 1073 +++++++++++++---------------- 7 files changed, 567 insertions(+), 682 deletions(-) diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index 30bede4d6a0e..121620c9ed05 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -12,8 +12,12 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govutils "github.com/cosmos/cosmos-sdk/x/gov/client/utils" + "github.com/cosmos/cosmos-sdk/x/gov/keeper" + "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) // Proposal flags @@ -120,8 +124,14 @@ $ %s tx gov submit-proposal --title="Test Proposal" --description="My awesome pr } content := v1beta1.ContentFromProposalType(proposal.Title, proposal.Description, proposal.Type) + // The signer of the MsgContent must be the gov module. + govModuleAcct := authtypes.NewModuleAddress(types.ModuleName) + msgContent, err := keeper.NewContentProposal(content, govModuleAcct.String()) + if err != nil { + return err + } - msg, err := v1beta1.NewMsgSubmitProposal(content, amount, clientCtx.GetFromAddress()) + msg, err := v1beta2.NewMsgSubmitProposal([]sdk.Msg{msgContent}, amount, clientCtx.GetFromAddress()) if err != nil { return fmt.Errorf("invalid message: %w", err) } diff --git a/x/gov/client/testutil/cli_test.go b/x/gov/client/testutil/cli_test.go index 94a102d1083b..1304823ff2e9 100644 --- a/x/gov/client/testutil/cli_test.go +++ b/x/gov/client/testutil/cli_test.go @@ -20,8 +20,8 @@ func TestIntegrationTestSuite(t *testing.T) { dp := v1beta2.NewDepositParams(sdk.NewCoins(sdk.NewCoin(cfg.BondDenom, v1beta2.DefaultMinDepositTokens)), time.Duration(15)*time.Second) vp := v1beta2.NewVotingParams(time.Duration(5) * time.Second) genesisState := v1beta2.DefaultGenesisState() - genesisState.DepositParams = &dp - genesisState.VotingParams = &vp + genesisState.DepositParams = dp + genesisState.VotingParams = vp bz, err := cfg.Codec.MarshalJSON(genesisState) require.NoError(t, err) cfg.GenesisState["gov"] = bz diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index e169a09f2f70..70aad16b9952 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -461,8 +461,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { depositParams := v1beta2.DefaultDepositParams() tallyParams := v1beta2.NewTallyParams(sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0)) expRes = &v1beta2.QueryParamsResponse{ - DepositParams: &depositParams, - TallyParams: &tallyParams, + DepositParams: depositParams, + TallyParams: tallyParams, } }, true, @@ -474,8 +474,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { votingParams := v1beta2.DefaultVotingParams() tallyParams := v1beta2.NewTallyParams(sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0)) expRes = &v1beta2.QueryParamsResponse{ - VotingParams: &votingParams, - TallyParams: &tallyParams, + VotingParams: votingParams, + TallyParams: tallyParams, } }, true, @@ -486,7 +486,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { req = &v1beta2.QueryParamsRequest{ParamsType: v1beta2.ParamTallying} tallyParams := v1beta2.DefaultTallyParams() expRes = &v1beta2.QueryParamsResponse{ - TallyParams: &tallyParams, + TallyParams: tallyParams, } }, true, diff --git a/x/gov/types/v1beta2/gov.pb.go b/x/gov/types/v1beta2/gov.pb.go index 411c5ab9f359..9a408fcfcf73 100644 --- a/x/gov/types/v1beta2/gov.pb.go +++ b/x/gov/types/v1beta2/gov.pb.go @@ -725,71 +725,74 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1beta2/gov.proto", fileDescriptor_5abf7b8852811c49) } var fileDescriptor_5abf7b8852811c49 = []byte{ - // 1022 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0x41, 0x6f, 0xdb, 0x36, - 0x14, 0x8e, 0x6c, 0xc7, 0x49, 0x9e, 0x13, 0x57, 0x63, 0x83, 0x55, 0x49, 0x3b, 0x39, 0xf3, 0x21, - 0x08, 0x8a, 0xc5, 0x4e, 0x32, 0xac, 0x03, 0x76, 0xaa, 0x1d, 0xa9, 0xab, 0x82, 0x34, 0x32, 0x24, - 0xd5, 0xc1, 0x76, 0x11, 0xe4, 0x88, 0x95, 0x85, 0x59, 0xa2, 0x27, 0xd2, 0x69, 0xf2, 0x13, 0x76, - 0xeb, 0x71,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 0x47, 0xbd, 0xc6, 0x09, 0x89, 0xc4, 0xbb, 0x40, 0xfc, 0x6c, 0x53, 0xff, 0xa7, - 0xe6, 0x19, 0x7f, 0xf5, 0xb0, 0xf3, 0x21, 0xa6, 0xf9, 0xdb, 0xa7, 0x57, 0xe6, 0x66, 0xfb, 0xfa, - 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x59, 0x87, 0xaa, 0xdc, 0x18, 0x09, 0x00, 0x00, + // 1070 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0xc1, 0x4f, 0xe3, 0xc6, + 0x17, 0xc6, 0x49, 0x36, 0x81, 0x17, 0xc8, 0xe6, 0x37, 0x8b, 0x7e, 0x6b, 0x58, 0x9a, 0xd0, 0x1c, + 0x10, 0x5a, 0x95, 0x04, 0xa8, 0xba, 0x95, 0xda, 0xcb, 0x26, 0xd8, 0xdb, 0x35, 0x02, 0x1c, 0xd9, + 0xde, 0xa0, 0xf6, 0x62, 0x39, 0x78, 0xd6, 0xb1, 0x1a, 0x7b, 0x52, 0xcf, 0x84, 0x25, 0x7f, 0x42, + 0x6f, 0x7b, 0xac, 0xda, 0x4b, 0xef, 0xbd, 0xf2, 0x47, 0xac, 0x7a, 0xa8, 0x56, 0x2b, 0xad, 0xd4, + 0x53, 0x5b, 0xc1, 0x3f, 0x52, 0x79, 0x3c, 0x26, 0x21, 0xa4, 0x22, 0x27, 0x26, 0xef, 0x7d, 0xdf, + 0x37, 0xef, 0xcd, 0x7c, 0xf3, 0x30, 0x6c, 0x9c, 0x11, 0x1a, 0x10, 0xda, 0xf0, 0xc8, 0x79, 0xe3, + 0x7c, 0xaf, 0x8b, 0x99, 0xb3, 0x1f, 0xaf, 0xeb, 0x83, 0x88, 0x30, 0x82, 0x50, 0x92, 0xad, 0xc7, + 0x11, 0x91, 0x5d, 0xaf, 0x08, 0x46, 0xd7, 0xa1, 0x58,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ab, 0x9b, 0xe7, 0x57, 0xfd, 0xf9, + 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x56, 0x0c, 0x37, 0x2e, 0x81, 0x09, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { diff --git a/x/gov/types/v1beta2/msgs.go b/x/gov/types/v1beta2/msgs.go index b2baa5167cbf..1e7093e6c814 100644 --- a/x/gov/types/v1beta2/msgs.go +++ b/x/gov/types/v1beta2/msgs.go @@ -10,6 +10,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" sdktx "github.com/cosmos/cosmos-sdk/types/tx" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // Governance message types and routes @@ -22,8 +23,8 @@ const ( ) var ( - _, _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{}, &MsgVoteWeighted{} - _ types.UnpackInterfacesMessage = &MsgSubmitProposal{} + _, _, _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{}, &MsgVoteWeighted{}, &MsgContent{} + _, _ types.UnpackInterfacesMessage = &MsgSubmitProposal{}, &MsgContent{} ) // NewMsgSubmitProposal creates a new MsgSubmitProposal. @@ -287,3 +288,9 @@ func (c MsgContent) ValidateBasic() error { return nil } + +// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces +func (m MsgContent) UnpackInterfaces(unpacker types.AnyUnpacker) error { + var content v1beta1.Content + return unpacker.UnpackAny(m.Content, &content) +} diff --git a/x/gov/types/v1beta2/params.go b/x/gov/types/v1beta2/params.go index 94984509800e..86feccfeed08 100644 --- a/x/gov/types/v1beta2/params.go +++ b/x/gov/types/v1beta2/params.go @@ -60,7 +60,7 @@ func (dp DepositParams) Equal(dp2 DepositParams) bool { } func validateDepositParams(i interface{}) error { - v, ok := i.(DepositParams) + v, ok := i.(*DepositParams) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } @@ -96,7 +96,7 @@ func (tp TallyParams) Equal(other TallyParams) bool { } func validateTallyParams(i interface{}) error { - v, ok := i.(TallyParams) + v, ok := i.(*TallyParams) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } @@ -155,7 +155,7 @@ func (vp VotingParams) Equal(other VotingParams) bool { } func validateVotingParams(i interface{}) error { - v, ok := i.(VotingParams) + v, ok := i.(*VotingParams) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } diff --git a/x/staking/types/staking.pb.go b/x/staking/types/staking.pb.go index 737d4c2910c8..4cf6aeaf5461 100644 --- a/x/staking/types/staking.pb.go +++ b/x/staking/types/staking.pb.go @@ -1253,610 +1253,475 @@ func (this *Pool) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_ func StakingDescription() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) { d := &github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet{} var gzipped = []byte{ - // 9634 bytes of a gzipped FileDescriptorSet - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x7d, 0x7b, 0x70, 0x24, 0xc7, - 0x79, 0x1f, 0x66, 0x5f, 0xd8, 0xfd, 0xb0, 0x00, 0x16, 0x0d, 0xdc, 0x71, 0x6f, 0x49, 0x02, 0xe0, - 0xf2, 0x71, 0xc7, 0x23, 0x89, 0x23, 0x8f, 0xbc, 0xd7, 0x9e, 0x24, 0x1a, 0x0b, 0xec, 0xe1, 0xc0, - 0xc3, 0x8b, 0x03, 0xe0, 0xf8, 0x90, 0x9d, 0xad, 0xc1, 0x6c, 0x63, 0x31, 0xc4, 0xec, 0xcc, 0x68, - 0x66, 0xf6, 0x78, 0x38, 0x59, 0x29, 0xca, 0x4a, 0x1c, 0x8a, 0xa9, 0x24, 0x72, 0x94, 0x8a, 0x25, - 0x59, 0xa7, 0x50, 0x96, 0x12, 0x39, 0xb2, 0x9c, 0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d, 0x97, 0x0d, 0x89, 0xf5, 0xe8, 0xe9, 0xdc, 0xb0, 0x57, 0x45, - 0x65, 0x65, 0x73, 0x39, 0x37, 0x82, 0xc6, 0x60, 0x98, 0x55, 0x21, 0x84, 0x18, 0x6d, 0xc9, 0x3a, - 0xfb, 0x58, 0x2e, 0xe7, 0x0b, 0xc2, 0x50, 0xc6, 0x42, 0x19, 0x67, 0x1f, 0xcb, 0xa1, 0xe2, 0x1c, - 0x24, 0xa9, 0x19, 0x22, 0x04, 0x23, 0x4b, 0xb3, 0xe5, 0xca, 0x52, 0x75, 0x75, 0x6d, 0x63, 0x71, - 0x75, 0x65, 0x76, 0x29, 0x27, 0xf9, 0x79, 0x72, 0xe5, 0xc9, 0xcd, 0x45, 0xb9, 0x32, 0x9f, 0x8b, - 0x05, 0xf3, 0xd6, 0x2a, 0xb3, 0x1b, 0x95, 0xf9, 0x5c, 0xbc, 0xa8, 0xc2, 0x44, 0x27, 0x87, 0xda, - 0x71, 0x08, 0x05, 0x6c, 0x21, 0xd6, 0xc5, 0x16, 0x28, 0x56, 0xab, 0x2d, 0x14, 0xbf, 0x15, 0x83, - 0xf1, 0x0e, 0x93, 0x4a, 0xc7, 0x4a, 0x1e, 0x87, 0x24, 0xb3, 0x65, 0x36, 0xcd, 0xde, 0xdf, 0x71, - 0x76, 0xa2, 0x96, 0xdd, 0x36, 0xd5, 0x52, 0xbe, 0x60, 0xa8, 0x11, 0xef, 0x12, 0x6a, 0x10, 0x88, - 0x36, 0x83, 0xfd, 0x99, 0x36, 0xe7, 0xcf, 0xe6, 0xc7, 0xb3, 0xfd, 0xcc, 0x8f, 0x34, 0x6f, 0x7f, - 0x93, 0x40, 0xb2, 0xc3, 0x24, 0x70, 0x11, 0xc6, 0xda, 0x80, 0xfa, 0x76, 0xc6, 0xef, 0x91, 0x20, - 0xdf, 0x4d, 0x39, 0x11, 0x2e, 0x31, 0x16, 0x72, 0x89, 0x17, 0x5b, 0x35, 0x78, 0x57, 0xf7, 0x4e, - 0x68, 0xeb, 0xeb, 0x4f, 0x48, 0x70, 0xb4, 0x73, 0x48, 0xd9, 0x51, 0x86, 0xb7, 0x41, 0xaa, 0x81, - 0xdd, 0x1d, 0x53, 0x84, 0x55, 0xf7, 0x75, 0x98, 0xac, 0x49, 0x71, 0x6b, 0x67, 0x73, 0xae, 0xe0, - 0x6c, 0x1f, 0xef, 0x16, 0x17, 0x32, 0x69, 0xda, 0x24, 0x7d, 0x6f, 0x0c, 0x8e, 0x74, 0x04, 0xef, - 0x28, 0xe8, 0x9d, 0x00, 0x9a, 0x61, 0x35, 0x5d, 0x16, 0x3a, 0x31, 0x4f, 0x9c, 0xa1, 0x39, 0xd4, - 0x79, 0x11, 0x2f, 0xdb, 0x74, 0xbd, 0xf2, 0x38, 0x2d, 0x07, 0x96, 0x45, 0x09, 0xce, 0xfb, 0x82, - 0x26, 0xa8, 0xa0, 0x93, 0x5d, 0x5a, 0xda, 0x66, 0x98, 0x0f, 0x43, 0x4e, 0xd5, 0x35, 0x6c, 0xb8, - 0x55, 0xc7, 0xb5, 0xb1, 0xd2, 0xd0, 0x8c, 0x3a, 0x9d, 0x6a, 0xd2, 0xa5, 0xe4, 0xb6, 0xa2, 0x3b, - 0x58, 0x1e, 0x65, 0xc5, 0xeb, 0xa2, 0x94, 0x70, 0x50, 0x03, 0xb2, 0x03, 0x1c, 0xa9, 0x10, 0x07, - 0x2b, 0xf6, 0x38, 0x8a, 0xbf, 0x90, 0x81, 0xa1, 0x40, 0x00, 0x8e, 0xee, 0x82, 0xec, 0x73, 0xca, - 0x35, 0xa5, 0x2a, 0x16, 0x55, 0x4c, 0x13, 0x43, 0x24, 0x6f, 0x8d, 0x2f, 0xac, 0x1e, 0x86, 0x09, - 0x4a, 0x62, 0x36, 0x5d, 0x6c, 0x57, 0x55, 0x5d, 0x71, 0x1c, 0xaa, 0xb4, 0x34, 0x25, 0x45, 0xa4, - 0x6c, 0x95, 0x14, 0xcd, 0x89, 0x12, 0x74, 0x06, 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0x55, 0x48, 0xfa, 0xc7, 0xb2, 0x4c, 0x7a, 0x22, - 0x91, 0x4e, 0xe7, 0x32, 0x4f, 0x24, 0xd2, 0x99, 0x1c, 0x14, 0x5f, 0x8b, 0x43, 0x36, 0x18, 0xaf, - 0x93, 0xe5, 0x8f, 0x4a, 0x67, 0x2c, 0x89, 0xfa, 0xb4, 0xbb, 0x7b, 0x46, 0xf7, 0x33, 0x73, 0x64, - 0x2a, 0x2b, 0xa5, 0x58, 0x70, 0x2c, 0x33, 0x4e, 0x12, 0x46, 0x10, 0x63, 0xc3, 0x2c, 0x18, 0x49, - 0xcb, 0x3c, 0x85, 0x16, 0x20, 0xf5, 0x9c, 0x43, 0xb1, 0x53, 0x14, 0xfb, 0x9e, 0xde, 0xd8, 0x4f, - 0xac, 0x53, 0xf0, 0xcc, 0x13, 0xeb, 0xd5, 0x95, 0x55, 0x79, 0x79, 0x76, 0x49, 0xe6, 0xec, 0xe8, - 0x18, 0x24, 0x74, 0xe5, 0xc6, 0x5e, 0x78, 0xd2, 0xa3, 0x59, 0xfd, 0x76, 0xc2, 0x31, 0x48, 0x3c, - 0x8f, 0x95, 0xdd, 0xf0, 0x54, 0x43, 0xb3, 0x6e, 0xe1, 0x60, 0x38, 0x05, 0x49, 0xaa, 0x2f, 0x04, - 0xc0, 0x35, 0x96, 0x1b, 0x40, 0x69, 0x48, 0xcc, 0xad, 0xca, 0x64, 0x40, 0xe4, 0x20, 0xcb, 0x72, - 0xab, 0x6b, 0x8b, 0x95, 0xb9, 0x4a, 0x2e, 0x56, 0x3c, 0x03, 0x29, 0xa6, 0x04, 0x32, 0x58, 0x3c, - 0x35, 0xe4, 0x06, 0x78, 0x92, 0x63, 0x48, 0xa2, 0x74, 0x73, 0xb9, 0x5c, 0x91, 0x73, 0xb1, 0x70, - 0x57, 0x27, 0x72, 0xc9, 0xa2, 0x03, 0xd9, 0x60, 0x1c, 0xfe, 0xe3, 0x59, 0x8c, 0x7f, 0x41, 0x82, - 0xa1, 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, 0x85, 0x94, 0x19, 0x59, 0xf1, 0x09, 0x48, 0xcf, 0x9b, 0x0d, 0xcd, 0x30, 0xc3, 0x68, 0x19, - 0x86, 0x46, 0x65, 0xb6, 0x9a, 0x3c, 0x66, 0x91, 0x59, 0x02, 0x1d, 0x85, 0x14, 0x7b, 0x74, 0xc1, - 0xef, 0xb8, 0xf0, 0x54, 0x71, 0x0e, 0x06, 0x29, 0xf6, 0xaa, 0x85, 0x10, 0x7f, 0xae, 0xc7, 0x5f, - 0x77, 0xd0, 0xd5, 0x15, 0x87, 0x8f, 0xf9, 0xc2, 0x22, 0x48, 0xd4, 0x14, 0x57, 0xe1, 0xed, 0xa6, - 0xbf, 0x8b, 0x6f, 0x83, 0x34, 0x07, 0x21, 0xd3, 0x42, 0xdc, 0xb4, 0x1c, 0x7e, 0x4b, 0xa5, 0xd0, - 0xad, 0x29, 0xab, 0x56, 0x39, 0x41, 0x22, 0x1a, 0x99, 0x10, 0x97, 0xe5, 0xae, 0x4e, 0xf5, 0x7c, - 0xc0, 0xa9, 0x06, 0xba, 0x3c, 0xf0, 0x93, 0x75, 0x69, 0x9b, 0x39, 0x78, 0xc6, 0xf2, 0xd1, 0x18, - 0x4c, 0x06, 0x4a, 0xaf, 0x61, 0xdb, 0xd1, 0x4c, 0x83, 0xcf, 0xf4, 0xcc, 0x5a, 0x50, 0x40, 0x48, - 0x5e, 0xde, 0xc5, 0x5c, 0xde, 0x0a, 0xf1, 0x59, 0xcb, 0x42, 0x05, 0x48, 0xd3, 0xb4, 0x6a, 0x32, - 0x7b, 0x49, 0xc8, 0x5e, 0x9a, 0x94, 0x39, 0xe6, 0xb6, 0xfb, 0xbc, 0x62, 0x7b, 0xef, 0x12, 0x45, - 0xba, 0x78, 0x01, 0x32, 0x73, 0xa6, 0xe1, 0x60, 0xc3, 0x69, 0xd2, 0x31, 0xb8, 0xa5, 0x9b, 0xea, - 0x2e, 0x47, 0x60, 0x09, 0xa2, 0x70, 0xc5, 0xb2, 0x28, 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, 0xf2, 0xd9, 0x55, 0x87, 0xc1, 0x32, 0x71, 0xc5, - 0x8b, 0xf3, 0x9e, 0x20, 0x92, 0x2f, 0x08, 0x5a, 0x86, 0x51, 0x4b, 0xb1, 0x5d, 0xfa, 0xce, 0x66, - 0x87, 0xb6, 0x82, 0xdb, 0xfa, 0x54, 0xfb, 0xc8, 0x0b, 0x35, 0x96, 0xd7, 0x32, 0x6c, 0x05, 0x33, - 0x8b, 0x7f, 0x96, 0x80, 0x14, 0x57, 0xc6, 0x5b, 0x61, 0x90, 0xab, 0x95, 0x5b, 0xe7, 0x9d, 0x33, - 0xed, 0x13, 0xd3, 0x8c, 0x37, 0x81, 0x70, 0x3c, 0xc1, 0x83, 0xee, 0x83, 0xb4, 0xba, 0xa3, 0x68, - 0x46, 0x55, 0xab, 0xf1, 0xed, 0x8a, 0xa1, 0xd7, 0x5e, 0x9d, 0x1a, 0x9c, 0x23, 0x79, 0x8b, 0xf3, - 0xf2, 0x20, 0x2d, 0x5c, 0xac, 0x91, 0x48, 0x60, 0x07, 0x6b, 0xf5, 0x1d, 0x97, 0x8f, 0x30, 0x9e, - 0x42, 0xe7, 0x21, 0x41, 0x0c, 0x82, 0xbf, 0xc2, 0x2c, 0xb4, 0x6d, 0x26, 0x79, 0xc1, 0x5e, 0x39, - 0x4d, 0x2a, 0x7e, 0xdf, 0x37, 0xa6, 0x24, 0x99, 0x72, 0xa0, 0x39, 0x18, 0xd6, 0x15, 0xc7, 0xad, - 0xd2, 0x19, 0x8c, 0x54, 0x9f, 0xe4, 0x2b, 0xf1, 0x36, 0x85, 0x70, 0xc5, 0x72, 0xd1, 0x87, 0x08, - 0x17, 0xcb, 0xaa, 0xa1, 0x13, 0x90, 0xa3, 0x20, 0xaa, 0xd9, 0x68, 0x68, 0x2e, 0x8b, 0xad, 0x52, - 0x54, 0xef, 0x23, 0x24, 0x7f, 0x8e, 0x66, 0xd3, 0x08, 0xeb, 0x76, 0xc8, 0xd0, 0x77, 0x5f, 0x94,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4, 0xb1, 0xd8, 0x4e, 0xf1, 0xb6, 0xa3, 0x15, 0x4b, 0x9b, 0x21, 0x04, 0x72, - 0x53, 0xc7, 0x32, 0x23, 0x41, 0x15, 0x98, 0xda, 0x6e, 0xea, 0xfa, 0x5e, 0xb5, 0x86, 0xe9, 0xbf, - 0x8a, 0xf2, 0xfe, 0xd9, 0x02, 0xbe, 0x6e, 0x29, 0xe2, 0x93, 0x8d, 0x44, 0x31, 0x77, 0x50, 0xb2, - 0x79, 0x4a, 0x25, 0xfe, 0xd1, 0x42, 0x45, 0xd0, 0x14, 0xff, 0x38, 0x06, 0x69, 0x01, 0x4d, 0xef, - 0x38, 0x63, 0x1d, 0xab, 0xae, 0x29, 0x0e, 0x03, 0xbc, 0x34, 0x42, 0x10, 0xaf, 0xf3, 0xce, 0xcb, - 0x5c, 0x1e, 0x90, 0x49, 0x82, 0xe4, 0x79, 0x37, 0xcf, 0x49, 0x9e, 0xd5, 0x24, 0xfd, 0x99, 0xb0, - 0x4c, 0xb1, 0xde, 0xba, 0x3c, 0x20, 0xd3, 0x14, 0xca, 0x43, 0x8a, 0x0c, 0x27, 0x97, 0xf5, 0x16, - 0xc9, 0xe7, 0x69, 0x74, 0x14, 0x92, 0x96, 0xe2, 0xaa, 0xec, 0x52, 0x18, 0x29, 0x60, 0x49, 0x74, - 0x0e, 0x52, 0xec, 0x45, 0x72, 0xeb, 0xff, 0x61, 0x21, 0xca, 0x60, 0x9f, 0x7e, 0x23, 0x72, 0xaf, - 0x29, 0xae, 0x8b, 0x6d, 0x83, 0x00, 0x32, 0x72, 0x84, 0x20, 0xb1, 0x65, 0xd6, 0xf6, 0xf8, 0xff, - 0x86, 0xa1, 0xbf, 0xf9, 0x3f, 0xa3, 0xa0, 0xf6, 0x50, 0xa5, 0x85, 0xec, 0x5f, 0x62, 0x65, 0x45, - 0x66, 0x99, 0x10, 0x55, 0x60, 0x5c, 0xa9, 0xd5, 0x34, 0xf6, 0x6f, 0x5a, 0xaa, 0x5b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b, 0x07, 0xb7, 0x20, 0xea, 0x1e, 0x8b, 0x76, 0x70, - 0x1d, 0x44, 0x7b, 0xad, 0x6e, 0xa3, 0x97, 0xf6, 0x5a, 0x68, 0x7b, 0x6a, 0xaf, 0xdb, 0x90, 0xda, - 0x02, 0x08, 0xd8, 0xff, 0xbd, 0x3d, 0x10, 0x7c, 0xb2, 0xc2, 0x43, 0x7d, 0x91, 0x79, 0x27, 0x4e, - 0x87, 0x1c, 0x3a, 0xff, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbc, 0x80, 0x9c, 0x18, 0x2b, 0x98, - 0x00, 0x00, + // 7484 bytes of a gzipped FileDescriptorSet + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x7c, 0x6b, 0x70, 0x1c, 0xd9, + 0x75, 0x1e, 0x7a, 0x66, 0x30, 0x98, 0x39, 0x33, 0x00, 0x1a, 0x17, 0x20, 0x39, 0xc4, 0xee, 0x02, + 0xd8, 0xd9, 0x07, 0xb9, 0x2f, 0x70, 0x97, 0xbb, 0x24, 0x97, 0x43, 0x4b, 0x1b, 0xcc, 0x83, 0x20, + 0x48, 0x3c, 0x46, 0x3d, 0x00, 0xf7, 0xe1, 0x38, 0x5d, 0x8d, 0x9e, 0x8b, 0x41, 0x2f, 0x7a, 0xba, + 0xdb, 0xdd, 0x3d, 0x24, 0xb1, 0xe5, 0x4a, 0xad, 0x4b, 0x79, 0x48, 0x4c, 0xc5, 0x91, 0xe3, 0x54, + 0x2c, 0xcb, 0xa2, 0xb2, 0xb2, 0x9c, 0xc8, 0x51, 0x94, 0x87, 0x2d, 0x45, 0x89, 0xe3, 0x4a, 0xa2, + 0x38, 0x95, 0x44, 0xd6, 0x8f, 0x94, 0xec, 0x1f, 0xb1, 0x9d, 0xc4, 0x1b, 0x67, 0xa5, 0x4a, 0x14, + 0x47, 0x89, 0x1d, 0x65, 0x53, 0x95, 0x94, 0x4a, 0xa9, 0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71, 0x27, 0xa6, 0xef, 0xd3, 0x89, 0x2b, 0x90, 0xb3, 0xb0, 0xe7, 0xe3, + 0x26, 0x8b, 0x88, 0xe4, 0x88, 0x31, 0x05, 0x0c, 0xd4, 0x1b, 0x52, 0xa9, 0xfb, 0x0a, 0xa9, 0xd7, + 0x60, 0x3a, 0x30, 0x49, 0x75, 0x35, 0xab, 0x25, 0x62, 0xf3, 0xdc, 0x30, 0x4b, 0x96, 0x6b, 0x02, + 0xa7, 0x10, 0x98, 0x32, 0x85, 0x63, 0xd7, 0xa8, 0x0a, 0x60, 0x5b, 0xd8, 0xde, 0x53, 0x9b, 0x58, + 0x37, 0x0b, 0x99, 0x01, 0x5e, 0xda, 0x22, 0x2a, 0x3d, 0x5e, 0xb2, 0x99, 0x54, 0x37, 0xd1, 0xe5, + 0x30, 0xd4, 0x26, 0x06, 0x44, 0xca, 0x06, 0x9b, 0x64, 0x3d, 0xd1, 0xb6, 0x03, 0x53, 0x2e, 0x26, + 0x71, 0x8f, 0x9b, 0xbc, 0x67, 0x59, 0x6a, 0xc4, 0xf2, 0xd0, 0x9e, 0x29, 0x1c, 0xc6, 0x3a, 0x36, + 0xe9, 0x46, 0x2f, 0xd1, 0x63, 0x10, 0x08, 0x54, 0x1a, 0x56, 0x40, 0xb3, 0x50, 0x5e, 0x08, 0x37, + 0xb5, 0x36, 0x9e, 0x7f, 0x0b, 0xa6, 0xe2, 0xee, 0x41, 0x73, 0x30, 0xee, 0xf9, 0x9a, 0xeb, 0xd3, + 0x28, 0x1c, 0x57, 0xd8, 0x05, 0x92, 0x21, 0x89, 0xad, 0x26, 0xcd, 0x72, 0xe3, 0x0a, 0xf9, 0x89, + 0xfe, 0x44, 0xd8, 0xe1, 0x24, 0xed, 0xf0, 0x93, 0xbd, 0x23, 0x1a, 0x63, 0xee, 0xee, 0xf7, 0xfc, + 0x25, 0x98, 0x8c, 0x75, 0x60, 0xd4, 0x5b, 0x17, 0x7f, 0x0c, 0x4e, 0xf4, 0xa5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x61, 0x12, 0xcd, 0x72, 0x8f, 0x1d, 0x59, 0xef, + 0x2f, 0x57, 0xc8, 0xe2, 0x56, 0x4a, 0xb3, 0x72, 0x59, 0x61, 0x48, 0x52, 0x58, 0x90, 0xf0, 0xc3, + 0xac, 0x3c, 0xc9, 0x28, 0xfc, 0x0a, 0xad, 0x42, 0xfa, 0x4d, 0x8f, 0x72, 0xa7, 0x29, 0xf7, 0xe3, + 0x47, 0x73, 0x5f, 0x6f, 0x50, 0xf2, 0xec, 0xf5, 0x86, 0xba, 0xb9, 0xa5, 0x6c, 0xac, 0xac, 0x2b, + 0x1c, 0x8e, 0x4e, 0x43, 0xca, 0xd4, 0xde, 0x3a, 0x8c, 0x2f, 0x83, 0x54, 0x34, 0xea, 0xb0, 0x9c, + 0x86, 0xd4, 0x6d, 0xac, 0x1d, 0xc4, 0x17, 0x1f, 0x2a, 0xfa, 0x00, 0xa7, 0xc7, 0x39, 0x18, 0xa7, + 0xfe, 0x42, 0x00, 0xdc, 0x63, 0xf2, 0x18, 0xca, 0x40, 0xaa, 0xb2, 0xa5, 0x90, 0x29, 0x22, 0x43, + 0x9e, 0x49, 0xd5, 0xfa, 0x5a, 0xad, 0x52, 0x93, 0x13, 0xc5, 0x0b, 0x90, 0x66, 0x4e, 0x20, 0xd3, + 0x27, 0x70, 0x83, 0x3c, 0xc6, 0x2f, 0x39, 0x87, 0x24, 0x5a, 0x77, 0x36, 0xca, 0x35, 0x45, 0x4e, + 0xf4, 0x0c, 0x7e, 0xd1, 0x83, 0x7c, 0xb4, 0x32, 0xff, 0xc1, 0x6c, 0xcf, 0xbf, 0x2a, 0x41, 0x2e, + 0x52, 0x69, 0x93, 0x12, 0x49, 0x33, 0x4d, 0xfb, 0xb6, 0xaa, 0x99, 0x86, 0xe6, 0xf1, 0xd0, 0x00, + 0x2a, 0x5a, 0x21, 0x92, 0x51, 0x87, 0xee, 0x07, 0x34, 0x69, 0xc6, 0xe5, 0x74, 0xf1, 0x33, 0x12, + 0xc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, 0x8c, 0x28, 0x5a, 0x86, 0x43, 0xff, + 0x1c, 0x87, 0x06, 0x10, 0x02, 0x17, 0x05, 0xcb, 0x70, 0xf8, 0x9f, 0x17, 0x70, 0x01, 0x21, 0xf0, + 0xd1, 0x5d, 0xf8, 0xd5, 0xbf, 0x90, 0xe2, 0x8b, 0x8e, 0xf0, 0xdd, 0x15, 0x98, 0xe0, 0x95, 0xca, + 0x70, 0xf4, 0xc7, 0xf9, 0xcd, 0x05, 0xa2, 0x74, 0x09, 0xc6, 0x47, 0x74, 0xf8, 0x5f, 0xe4, 0x50, + 0xa6, 0x5f, 0xaa, 0x40, 0x2e, 0x52, 0x9d, 0x0c, 0x87, 0xff, 0x04, 0x87, 0x47, 0x51, 0xc4, 0x74, + 0x5e, 0x9d, 0x0c, 0x27, 0xf8, 0x4b, 0xc2, 0x74, 0x8e, 0x20, 0x6e, 0x13, 0x85, 0xc9, 0x70, 0xf4, + 0x27, 0x84, 0xd7, 0x05, 0xa4, 0xf4, 0x0a, 0x64, 0x83, 0xc5, 0x66, 0x38, 0xfe, 0x27, 0x39, 0x3e, + 0xc4, 0x10, 0x0f, 0x44, 0x16, 0xbb, 0xe1, 0x14, 0x7f, 0x59, 0x78, 0x20, 0x82, 0x22, 0xd3, 0xa8, + 0xbb, 0x80, 0x19, 0xce, 0xf4, 0x53, 0x62, 0x1a, 0x75, 0xd5, 0x2f, 0x64, 0x34, 0x69, 0xce, 0x1f, + 0x4e, 0xf1, 0x57, 0xc4, 0x68, 0x52, 0x7d, 0x62, 0x46, 0x77, 0x45, 0x30, 0x9c, 0xe3, 0xa7, 0x85, + 0x19, 0x5d, 0x05, 0x41, 0xa9, 0x0e, 0xa8, 0xb7, 0x1a, 0x18, 0xce, 0xf7, 0x49, 0xce, 0x37, 0xd3, + 0x53, 0x0c, 0x94, 0x5e, 0x85, 0x93, 0xfd, 0x2b, 0x81, 0xe1, 0xac, 0x3f, 0xf3, 0x7e, 0xd7, 0xde, + 0x2d, 0x5a, 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, 0xe8, 0x98, 0xa0, 0x1f, 0xf7, 0xe5, 0x99, 0xff, 0x93, 0x86, 0xd3, 0xba, 0xed, 0xb5, 0x6d, + 0x4f, 0x65, 0xcf, 0x47, 0xd8, 0x05, 0xf7, 0x49, 0x3e, 0xda, 0x34, 0xfc, 0x21, 0x49, 0xf1, 0x06, + 0xcc, 0xae, 0x91, 0x54, 0x41, 0xb6, 0x40, 0xe1, 0xe3, 0x9d, 0xbe, 0x2f, 0x92, 0x2e, 0xc5, 0xaa, + 0x7d, 0xfe, 0x78, 0x29, 0x2a, 0x2a, 0xfe, 0xb8, 0x04, 0x72, 0x43, 0xd7, 0x4c, 0xcd, 0xfd, 0xff, + 0xa5, 0x42, 0x97, 0x00, 0xe8, 0x07, 0x48, 0xe1, 0x17, 0x43, 0x53, 0xe7, 0x0b, 0xcb, 0xd1, 0xce, + 0x2d, 0xb3, 0x3b, 0xd1, 0xcf, 0x11, 0xb2, 0x54, 0x97, 0xfc, 0x7c, 0xfa, 0x35, 0x80, 0xb0, 0x01, + 0x3d, 0x04, 0xa7, 0x1a, 0x95, 0x95, 0xf5, 0x15, 0x45, 0x65, 0x6f, 0xb6, 0x6f, 0x36, 0xea, 0xb5, + 0xca, 0xda, 0xd5, 0xb5, 0x5a, 0x55, 0x1e, 0x43, 0x27, 0x01, 0x45, 0x1b, 0x83, 0x97, 0x52, 0x4e, + 0xc0, 0x4c, 0x54, 0xce, 0x5e, 0x8f, 0x4f, 0x90, 0x32, 0xd1, 0x68, 0x3b, 0x26, 0xa6, 0xcf, 0xfd, + 0x54, 0x43, 0x78, 0x6d, 0x78, 0x05, 0xf2, 0x6b, 0xff, 0x86, 0xbd, 0x32, 0x3d, 0x1b, 0xc2, 0x03, + 0x9f, 0x97, 0xd6, 0x61, 0x46, 0xd3, 0x75, 0xec, 0xc4, 0x28, 0x87, 0xe4, 0x69, 0x42, 0x48, 0x9f, + 0x64, 0x72, 0x64, 0xc8, 0x76, 0x09, 0xd2, 0x1e, 0xed,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0x9c, + 0xe6, 0x60, 0xdc, 0xb5, 0x3b, 0x56, 0x53, 0xbc, 0xbf, 0x4a, 0x2f, 0x50, 0x0d, 0x32, 0x41, 0x94, + 0xa4, 0x86, 0x45, 0xc9, 0x34, 0x89, 0x12, 0x12, 0xc3, 0x5c, 0xa0, 0x4c, 0xec, 0xf2, 0x60, 0x29, + 0x43, 0x36, 0x48, 0x5e, 0x3c, 0xda, 0x46, 0x0b, 0xd8, 0x10, 0x46, 0x16, 0x93, 0x60, 0xec, 0x03, + 0xe7, 0xb1, 0x88, 0x93, 0x83, 0x06, 0xee, 0xbd, 0x58, 0x58, 0xf1, 0xff, 0x71, 0x30, 0x41, 0xfb, + 0x15, 0x86, 0x15, 0xfb, 0x3f, 0x07, 0x0f, 0x43, 0xd6, 0x33, 0x5a, 0x96, 0xe6, 0x77, 0x5c, 0xcc, + 0x23, 0x2f, 0x14, 0x14, 0xbf, 0x2a, 0x41, 0x9a, 0x45, 0x72, 0xc4, 0x6f, 0x52, 0x7f, 0xbf, 0x25, + 0x06, 0xf9, 0x2d, 0x79, 0xff, 0x7e, 0x5b, 0x01, 0x08, 0x8c, 0xf1, 0xf8, 0xa7, 0xe7, 0x7d, 0x2a, + 0x06, 0x66, 0x62, 0xc3, 0x68, 0xf1, 0x89, 0x1a, 0x01, 0x15, 0x7f, 0x47, 0x22, 0x45, 0x2c, 0x6f, + 0x47, 0x2b, 0x30, 0x29, 0xec, 0x52, 0xf7, 0x4c, 0xad, 0xc5, 0x63, 0xe7, 0x91, 0x81, 0xc6, 0x5d, + 0x35, 0xb5, 0x96, 0x92, 0xe3, 0xf6, 0x90, 0x8b, 0xfe, 0xe3, 0x90, 0x18, 0x30, 0x0e, 0xb1, 0x81, + 0x4f, 0xde, 0xdf, 0xc0, 0xc7, 0x86, 0x28, 0xd5, 0x3d, 0x44, 0x5f, 0x4a, 0xd0, 0xcd, 0x8c, 0x63, + 0x7b, 0x9a, 0xf9, 0x83, 0x98, 0x11, 0x0f, 0x41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a5, 0xf9, 0xfc, 0xdd, 0x7b, + 0x4b, 0x19, 0x56, 0xf7, 0xe0, 0x26, 0x3a, 0x0b, 0x27, 0x7a, 0xf5, 0xd6, 0x36, 0x57, 0xe5, 0xc4, + 0xfc, 0xe4, 0xdd, 0x7b, 0x4b, 0xd9, 0xa0, 0x40, 0x42, 0x45, 0x40, 0x51, 0x4d, 0xce, 0x97, 0x9c, + 0x87, 0xbb, 0xf7, 0x96, 0xd2, 0xcc, 0x4b, 0xf3, 0xa9, 0x8f, 0x7d, 0x6e, 0x61, 0xac, 0x7c, 0x75, + 0xe0, 0x79, 0xee, 0xb3, 0x47, 0x3a, 0xe8, 0x4e, 0x70, 0x46, 0x1b, 0x3b, 0xc4, 0xfd, 0x7f, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x09, 0xa1, 0x85, 0x5f, 0xde, 0x65, 0x00, 0x00, } r := bytes.NewReader(gzipped) gzipr, err := compress_gzip.NewReader(r) From d1485221015f160d8dfcab00f4206f3944f39f12 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Wed, 12 Jan 2022 14:54:13 +0100 Subject: [PATCH 13/39] Small cleanups --- x/authz/client/testutil/tx.go | 5 +++-- x/gov/client/cli/tx.go | 14 ++------------ x/gov/keeper/deposit.go | 6 +++--- x/gov/keeper/msg_server.go | 25 +++++++++++++------------ x/gov/module.go | 5 ++++- x/gov/simulation/genesis.go | 3 ++- x/gov/simulation/genesis_test.go | 3 ++- x/gov/simulation/operations.go | 32 ++++++++++++++++---------------- x/gov/types/v1beta1/content.go | 4 ++-- x/gov/types/v1beta1/errors.go | 6 +++--- x/gov/types/v1beta1/msgs.go | 8 ++++---- x/gov/types/v1beta1/proposal.go | 2 +- x/gov/types/v1beta2/content.go | 4 ++-- x/gov/types/v1beta2/msgs.go | 8 ++++---- 14 files changed, 61 insertions(+), 64 deletions(-) diff --git a/x/authz/client/testutil/tx.go b/x/authz/client/testutil/tx.go index e883aa6fe848..d16faf1608bb 100644 --- a/x/authz/client/testutil/tx.go +++ b/x/authz/client/testutil/tx.go @@ -54,10 +54,11 @@ func (s *IntegrationTestSuite) SetupSuite() { s.Require().NoError(err) // create a proposal with deposit - _, err = govtestutil.MsgSubmitProposal(val.ClientCtx, val.Address.String(), + out, err := govtestutil.MsgSubmitProposal(val.ClientCtx, val.Address.String(), "Text Proposal 1", "Where is the title!?", govv1beta1.ProposalTypeText, fmt.Sprintf("--%s=%s", govcli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, govv1beta2.DefaultMinDepositTokens).String())) s.Require().NoError(err) + s.Require().Contains(out.String(), `"code":0`) // Create new account in the keyring. s.grantee[1] = s.createAccount("grantee2") @@ -65,7 +66,7 @@ func (s *IntegrationTestSuite) SetupSuite() { s.msgSendExec(s.grantee[1]) // grant send authorization to grantee2 - out, err := ExecGrant(val, []string{ + out, err = ExecGrant(val, []string{ s.grantee[1].String(), "send", fmt.Sprintf("--%s=100steak", cli.FlagSpendLimit), diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index 121620c9ed05..aab48b336198 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -12,12 +12,9 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govutils "github.com/cosmos/cosmos-sdk/x/gov/client/utils" - "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) // Proposal flags @@ -56,7 +53,7 @@ var ProposalFlags = []string{ // under the governance CLI (eg. parameter change proposals). func NewTxCmd(propCmds []*cobra.Command) *cobra.Command { govTxCmd := &cobra.Command{ - Use: v1beta1.ModuleName, + Use: types.ModuleName, Short: "Governance transactions subcommands", DisableFlagParsing: true, SuggestionsMinimumDistance: 2, @@ -124,14 +121,7 @@ $ %s tx gov submit-proposal --title="Test Proposal" --description="My awesome pr } content := v1beta1.ContentFromProposalType(proposal.Title, proposal.Description, proposal.Type) - // The signer of the MsgContent must be the gov module. - govModuleAcct := authtypes.NewModuleAddress(types.ModuleName) - msgContent, err := keeper.NewContentProposal(content, govModuleAcct.String()) - if err != nil { - return err - } - - msg, err := v1beta2.NewMsgSubmitProposal([]sdk.Msg{msgContent}, amount, clientCtx.GetFromAddress()) + msg, err := v1beta1.NewMsgSubmitProposal(content, amount, clientCtx.GetFromAddress()) if err != nil { return fmt.Errorf("invalid message: %w", err) } diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index 24238dde2d01..77c568095573 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -59,7 +59,7 @@ func (keeper Keeper) DeleteAndBurnDeposits(ctx sdk.Context, proposalID uint64) { store := ctx.KVStore(keeper.storeKey) keeper.IterateDeposits(ctx, proposalID, func(deposit v1beta2.Deposit) bool { - err := keeper.bankKeeper.BurnCoins(ctx, v1beta2.ModuleName, deposit.Amount) + err := keeper.bankKeeper.BurnCoins(ctx, types.ModuleName, deposit.Amount) if err != nil { panic(err) } @@ -124,7 +124,7 @@ func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAdd } // update the governance module's account coins pool - err := keeper.bankKeeper.SendCoinsFromAccountToModule(ctx, depositorAddr, v1beta2.ModuleName, depositAmount) + err := keeper.bankKeeper.SendCoinsFromAccountToModule(ctx, depositorAddr, types.ModuleName, depositAmount) if err != nil { return false, err } @@ -177,7 +177,7 @@ func (keeper Keeper) RefundAndDeleteDeposits(ctx sdk.Context, proposalID uint64) panic(err) } - err = keeper.bankKeeper.SendCoinsFromModuleToAccount(ctx, v1beta2.ModuleName, depositor, deposit.Amount) + err = keeper.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositor, deposit.Amount) if err != nil { panic(err) } diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 9fd7613c4382..afcb432f0deb 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -51,7 +51,7 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1beta2.MsgSubmitP "submit proposal", ) - defer telemetry.IncrCounter(1, v1beta2.ModuleName, "proposal") + defer telemetry.IncrCounter(1, types.ModuleName, "proposal") proposer, _ := sdk.AccAddressFromBech32(msg.GetProposer()) votingStarted, err := k.Keeper.AddDeposit(ctx, proposal.ProposalId, proposer, msg.GetInitialDeposit()) @@ -92,7 +92,7 @@ func (k msgServer) Vote(goCtx context.Context, msg *v1beta2.MsgVote) (*v1beta2.M } defer telemetry.IncrCounterWithLabels( - []string{v1beta2.ModuleName, "vote"}, + []string{types.ModuleName, "vote"}, 1, []metrics.Label{ telemetry.NewLabel("proposal_id", strconv.Itoa(int(msg.ProposalId))), @@ -122,7 +122,7 @@ func (k msgServer) VoteWeighted(goCtx context.Context, msg *v1beta2.MsgVoteWeigh } defer telemetry.IncrCounterWithLabels( - []string{v1beta2.ModuleName, "vote"}, + []string{types.ModuleName, "vote"}, 1, []metrics.Label{ telemetry.NewLabel("proposal_id", strconv.Itoa(int(msg.ProposalId))), @@ -152,7 +152,7 @@ func (k msgServer) Deposit(goCtx context.Context, msg *v1beta2.MsgDeposit) (*v1b } defer telemetry.IncrCounterWithLabels( - []string{v1beta2.ModuleName, "deposit"}, + []string{types.ModuleName, "deposit"}, 1, []metrics.Label{ telemetry.NewLabel("proposal_id", strconv.Itoa(int(msg.ProposalId))), @@ -180,19 +180,20 @@ func (k msgServer) Deposit(goCtx context.Context, msg *v1beta2.MsgDeposit) (*v1b } type legacyMsgServer struct { - Server v1beta2.MsgServer + govAcct string + server v1beta2.MsgServer } // NewLegacyMsgServerImpl returns an implementation of the v1beta1 legacy MsgServer interface. It wraps around // the current MsgServer -func NewLegacyMsgServerImpl(keeper Keeper) v1beta1.MsgServer { - return &legacyMsgServer{Server: NewMsgServerImpl(keeper)} +func NewLegacyMsgServerImpl(govAcct string, v1beta2Server v1beta2.MsgServer) v1beta1.MsgServer { + return &legacyMsgServer{govAcct: govAcct, server: v1beta2Server} } var _ v1beta1.MsgServer = legacyMsgServer{} func (k legacyMsgServer) SubmitProposal(goCtx context.Context, msg *v1beta1.MsgSubmitProposal) (*v1beta1.MsgSubmitProposalResponse, error) { - contentMsg, err := NewContentProposal(msg.GetContent(), msg.Proposer) + contentMsg, err := NewContentProposal(msg.GetContent(), k.govAcct) if err != nil { return nil, fmt.Errorf("error converting legacy content into proposal message: %w", err) } @@ -206,7 +207,7 @@ func (k legacyMsgServer) SubmitProposal(goCtx context.Context, msg *v1beta1.MsgS return nil, err } - resp, err := k.Server.SubmitProposal(goCtx, proposal) + resp, err := k.server.SubmitProposal(goCtx, proposal) if err != nil { return nil, err } @@ -215,7 +216,7 @@ func (k legacyMsgServer) SubmitProposal(goCtx context.Context, msg *v1beta1.MsgS } func (k legacyMsgServer) Vote(goCtx context.Context, msg *v1beta1.MsgVote) (*v1beta1.MsgVoteResponse, error) { - _, err := k.Server.Vote(goCtx, &v1beta2.MsgVote{ + _, err := k.server.Vote(goCtx, &v1beta2.MsgVote{ ProposalId: msg.ProposalId, Voter: msg.Voter, Option: v1beta2.VoteOption(msg.Option), @@ -235,7 +236,7 @@ func (k legacyMsgServer) VoteWeighted(goCtx context.Context, msg *v1beta1.MsgVot } } - _, err := k.Server.VoteWeighted(goCtx, &v1beta2.MsgVoteWeighted{ + _, err := k.server.VoteWeighted(goCtx, &v1beta2.MsgVoteWeighted{ ProposalId: msg.ProposalId, Voter: msg.Voter, Options: opts, @@ -247,7 +248,7 @@ func (k legacyMsgServer) VoteWeighted(goCtx context.Context, msg *v1beta1.MsgVot } func (k legacyMsgServer) Deposit(goCtx context.Context, msg *v1beta1.MsgDeposit) (*v1beta1.MsgDepositResponse, error) { - _, err := k.Server.Deposit(goCtx, &v1beta2.MsgDeposit{ + _, err := k.server.Deposit(goCtx, &v1beta2.MsgDeposit{ ProposalId: msg.ProposalId, Depositor: msg.Depositor, Amount: msg.Amount, diff --git a/x/gov/module.go b/x/gov/module.go index 6aa7990840ef..d93cad4b1df2 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -156,7 +156,10 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { - v1beta2.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + msgServer := keeper.NewMsgServerImpl(am.keeper) + v1beta1.RegisterMsgServer(cfg.MsgServer(), keeper.NewLegacyMsgServerImpl(am.accountKeeper.GetModuleAddress(types.ModuleName).String(), msgServer)) + v1beta2.RegisterMsgServer(cfg.MsgServer(), msgServer) + v1beta2.RegisterQueryServer(cfg.QueryServer(), am.keeper) m := keeper.NewMigrator(am.keeper) diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index 1d696f0f6f27..92260ac9e053 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -11,6 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) @@ -106,5 +107,5 @@ func RandomizedGenState(simState *module.SimulationState) { panic(err) } fmt.Printf("Selected randomly generated governance parameters:\n%s\n", bz) - simState.GenState[v1beta2.ModuleName] = simState.Cdc.MustMarshalJSON(govGenesis) + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(govGenesis) } diff --git a/x/gov/simulation/genesis_test.go b/x/gov/simulation/genesis_test.go index 2042d342aacf..44690f3cda31 100644 --- a/x/gov/simulation/genesis_test.go +++ b/x/gov/simulation/genesis_test.go @@ -13,6 +13,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/gov/simulation" + "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) @@ -38,7 +39,7 @@ func TestRandomizedGenState(t *testing.T) { simulation.RandomizedGenState(&simState) var govGenesis v1beta2.GenesisState - simState.Cdc.MustUnmarshalJSON(simState.GenState[v1beta2.ModuleName], &govGenesis) + simState.Cdc.MustUnmarshalJSON(simState.GenState[types.ModuleName], &govGenesis) dec1, _ := sdk.NewDecFromStr("0.361000000000000000") dec2, _ := sdk.NewDecFromStr("0.512000000000000000") diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index 1d5b7d967227..69e5cb559eee 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -126,26 +126,26 @@ func SimulateMsgSubmitProposal( // 1) submit proposal now content := contentSim(r, ctx, accs) if content == nil { - return simtypes.NoOpMsg(v1beta2.ModuleName, v1beta2.TypeMsgSubmitProposal, "content is nil"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgSubmitProposal, "content is nil"), nil, nil } simAccount, _ := simtypes.RandomAcc(r, accs) deposit, skip, err := randomDeposit(r, ctx, ak, bk, k, simAccount.Address) switch { case skip: - return simtypes.NoOpMsg(v1beta2.ModuleName, v1beta2.TypeMsgSubmitProposal, "skip deposit"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgSubmitProposal, "skip deposit"), nil, nil case err != nil: - return simtypes.NoOpMsg(v1beta2.ModuleName, v1beta2.TypeMsgSubmitProposal, "unable to generate deposit"), nil, err + return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgSubmitProposal, "unable to generate deposit"), nil, err } contentMsg, err := keeper.NewContentProposal(content, k.GetGovernanceAccount(ctx).GetAddress().String()) if err != nil { - return simtypes.NoOpMsg(v1beta2.ModuleName, v1beta2.TypeMsgSubmitProposal, "unable to create a content proposal message"), nil, err + return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgSubmitProposal, "unable to create a content proposal message"), nil, err } msg, err := v1beta2.NewMsgSubmitProposal([]sdk.Msg{contentMsg}, deposit, simAccount.Address) if err != nil { - return simtypes.NoOpMsg(v1beta2.ModuleName, v1beta2.TypeMsgSubmitProposal, "unable to generate a submit proposal msg"), nil, err + return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgSubmitProposal, "unable to generate a submit proposal msg"), nil, err } account := ak.GetAccount(ctx, simAccount.Address) @@ -156,7 +156,7 @@ func SimulateMsgSubmitProposal( if !hasNeg { fees, err = simtypes.RandomFees(r, ctx, coins) if err != nil { - return simtypes.NoOpMsg(v1beta2.ModuleName, msg.Type(), "unable to generate fees"), nil, err + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate fees"), nil, err } } @@ -172,12 +172,12 @@ func SimulateMsgSubmitProposal( simAccount.PrivKey, ) if err != nil { - return simtypes.NoOpMsg(v1beta2.ModuleName, msg.Type(), "unable to generate mock tx"), nil, err + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate mock tx"), nil, err } _, _, err = app.SimDeliver(txGen.TxEncoder(), tx) if err != nil { - return simtypes.NoOpMsg(v1beta2.ModuleName, msg.Type(), "unable to deliver tx"), nil, err + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to deliver tx"), nil, err } opMsg := simtypes.NewOperationMsg(msg, true, "", nil) @@ -185,7 +185,7 @@ func SimulateMsgSubmitProposal( // get the submitted proposal ID proposalID, err := k.GetProposalID(ctx) if err != nil { - return simtypes.NoOpMsg(v1beta2.ModuleName, msg.Type(), "unable to generate proposalID"), nil, err + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate proposalID"), nil, err } // 2) Schedule operations for votes @@ -222,15 +222,15 @@ func SimulateMsgDeposit(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Ke simAccount, _ := simtypes.RandomAcc(r, accs) proposalID, ok := randomProposalID(r, k, ctx, v1beta2.StatusDepositPeriod) if !ok { - return simtypes.NoOpMsg(v1beta2.ModuleName, v1beta2.TypeMsgDeposit, "unable to generate proposalID"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgDeposit, "unable to generate proposalID"), nil, nil } deposit, skip, err := randomDeposit(r, ctx, ak, bk, k, simAccount.Address) switch { case skip: - return simtypes.NoOpMsg(v1beta2.ModuleName, v1beta2.TypeMsgDeposit, "skip deposit"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgDeposit, "skip deposit"), nil, nil case err != nil: - return simtypes.NoOpMsg(v1beta2.ModuleName, v1beta2.TypeMsgDeposit, "unable to generate deposit"), nil, err + return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgDeposit, "unable to generate deposit"), nil, err } msg := v1beta2.NewMsgDeposit(simAccount.Address, proposalID, deposit) @@ -243,7 +243,7 @@ func SimulateMsgDeposit(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Ke if !hasNeg { fees, err = simtypes.RandomFees(r, ctx, coins) if err != nil { - return simtypes.NoOpMsg(v1beta2.ModuleName, msg.Type(), "unable to generate fees"), nil, err + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate fees"), nil, err } } @@ -256,7 +256,7 @@ func SimulateMsgDeposit(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Ke Context: ctx, SimAccount: simAccount, AccountKeeper: ak, - ModuleName: v1beta2.ModuleName, + ModuleName: types.ModuleName, } return simulation.GenAndDeliverTx(txCtx, fees) @@ -285,7 +285,7 @@ func operationSimulateMsgVote(ak types.AccountKeeper, bk types.BankKeeper, k kee var ok bool proposalID, ok = randomProposalID(r, k, ctx, v1beta2.StatusVotingPeriod) if !ok { - return simtypes.NoOpMsg(v1beta2.ModuleName, v1beta2.TypeMsgVote, "unable to generate proposalID"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgVote, "unable to generate proposalID"), nil, nil } default: proposalID = uint64(proposalIDInt) @@ -338,7 +338,7 @@ func operationSimulateMsgVoteWeighted(ak types.AccountKeeper, bk types.BankKeepe var ok bool proposalID, ok = randomProposalID(r, k, ctx, v1beta2.StatusVotingPeriod) if !ok { - return simtypes.NoOpMsg(v1beta2.ModuleName, v1beta2.TypeMsgVoteWeighted, "unable to generate proposalID"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgVoteWeighted, "unable to generate proposalID"), nil, nil } default: proposalID = uint64(proposalIDInt) diff --git a/x/gov/types/v1beta1/content.go b/x/gov/types/v1beta1/content.go index 9bdeec13322b..830c98925fca 100644 --- a/x/gov/types/v1beta1/content.go +++ b/x/gov/types/v1beta1/content.go @@ -4,9 +4,9 @@ import sdk "github.com/cosmos/cosmos-sdk/types" // Copied over from /x/gov/types/keys.go to avoid circular imports const ( - ModuleName = "gov" + moduleName = "gov" - RouterKey = ModuleName + routerKey = moduleName ) // Content defines an interface that a proposal must implement. It contains diff --git a/x/gov/types/v1beta1/errors.go b/x/gov/types/v1beta1/errors.go index a24e10d6b39a..1569fb6eecc2 100644 --- a/x/gov/types/v1beta1/errors.go +++ b/x/gov/types/v1beta1/errors.go @@ -5,7 +5,7 @@ import ( ) var ( - ErrInvalidProposalContent = sdkerrors.Register(ModuleName, 5, "invalid proposal content") - ErrInvalidProposalType = sdkerrors.Register(ModuleName, 6, "invalid proposal type") - ErrInvalidVote = sdkerrors.Register(ModuleName, 7, "invalid vote option") + ErrInvalidProposalContent = sdkerrors.Register(moduleName, 5, "invalid proposal content") + ErrInvalidProposalType = sdkerrors.Register(moduleName, 6, "invalid proposal type") + ErrInvalidVote = sdkerrors.Register(moduleName, 7, "invalid vote option") ) diff --git a/x/gov/types/v1beta1/msgs.go b/x/gov/types/v1beta1/msgs.go index 4a9653570a88..eeafbefb244e 100644 --- a/x/gov/types/v1beta1/msgs.go +++ b/x/gov/types/v1beta1/msgs.go @@ -76,7 +76,7 @@ func (m *MsgSubmitProposal) SetContent(content Content) error { } // Route implements Msg -func (m MsgSubmitProposal) Route() string { return RouterKey } +func (m MsgSubmitProposal) Route() string { return routerKey } // Type implements Msg func (m MsgSubmitProposal) Type() string { return TypeMsgSubmitProposal } @@ -138,7 +138,7 @@ func NewMsgDeposit(depositor sdk.AccAddress, proposalID uint64, amount sdk.Coins } // Route implements Msg -func (msg MsgDeposit) Route() string { return RouterKey } +func (msg MsgDeposit) Route() string { return routerKey } // Type implements Msg func (msg MsgDeposit) Type() string { return TypeMsgDeposit } @@ -183,7 +183,7 @@ func NewMsgVote(voter sdk.AccAddress, proposalID uint64, option VoteOption) *Msg } // Route implements Msg -func (msg MsgVote) Route() string { return RouterKey } +func (msg MsgVote) Route() string { return routerKey } // Type implements Msg func (msg MsgVote) Type() string { return TypeMsgVote } @@ -225,7 +225,7 @@ func NewMsgVoteWeighted(voter sdk.AccAddress, proposalID uint64, options Weighte } // Route implements Msg -func (msg MsgVoteWeighted) Route() string { return RouterKey } +func (msg MsgVoteWeighted) Route() string { return routerKey } // Type implements Msg func (msg MsgVoteWeighted) Type() string { return TypeMsgVoteWeighted } diff --git a/x/gov/types/v1beta1/proposal.go b/x/gov/types/v1beta1/proposal.go index be686d5aa8f8..5998a98c391c 100644 --- a/x/gov/types/v1beta1/proposal.go +++ b/x/gov/types/v1beta1/proposal.go @@ -183,7 +183,7 @@ func (tp *TextProposal) GetTitle() string { return tp.Title } func (tp *TextProposal) GetDescription() string { return tp.Description } // ProposalRoute returns the proposal router key -func (tp *TextProposal) ProposalRoute() string { return RouterKey } +func (tp *TextProposal) ProposalRoute() string { return routerKey } // ProposalType is "Text" func (tp *TextProposal) ProposalType() string { return ProposalTypeText } diff --git a/x/gov/types/v1beta2/content.go b/x/gov/types/v1beta2/content.go index db0ff42ccc46..f7d926f45ad9 100644 --- a/x/gov/types/v1beta2/content.go +++ b/x/gov/types/v1beta2/content.go @@ -4,9 +4,9 @@ import sdk "github.com/cosmos/cosmos-sdk/types" // Copied over from /x/gov/types/keys.go to avoid circular imports const ( - ModuleName = "gov" + moduleName = "gov" - RouterKey = ModuleName + routerKey = moduleName ) // Content defines an interface that a proposal must implement. It contains diff --git a/x/gov/types/v1beta2/msgs.go b/x/gov/types/v1beta2/msgs.go index 1e7093e6c814..987fbdb64c5f 100644 --- a/x/gov/types/v1beta2/msgs.go +++ b/x/gov/types/v1beta2/msgs.go @@ -73,7 +73,7 @@ func (m *MsgSubmitProposal) SetMessages(messages []sdk.Msg) error { } // Route implements Msg -func (m MsgSubmitProposal) Route() string { return RouterKey } +func (m MsgSubmitProposal) Route() string { return routerKey } // Type implements Msg func (m MsgSubmitProposal) Type() string { return TypeMsgSubmitProposal } @@ -138,7 +138,7 @@ func NewMsgDeposit(depositor sdk.AccAddress, proposalID uint64, amount sdk.Coins } // Route implements Msg -func (msg MsgDeposit) Route() string { return RouterKey } +func (msg MsgDeposit) Route() string { return routerKey } // Type implements Msg func (msg MsgDeposit) Type() string { return TypeMsgDeposit } @@ -178,7 +178,7 @@ func NewMsgVote(voter sdk.AccAddress, proposalID uint64, option VoteOption) *Msg } // Route implements Msg -func (msg MsgVote) Route() string { return RouterKey } +func (msg MsgVote) Route() string { return routerKey } // Type implements Msg func (msg MsgVote) Type() string { return TypeMsgVote } @@ -214,7 +214,7 @@ func NewMsgVoteWeighted(voter sdk.AccAddress, proposalID uint64, options Weighte } // Route implements Msg -func (msg MsgVoteWeighted) Route() string { return RouterKey } +func (msg MsgVoteWeighted) Route() string { return routerKey } // Type implements Msg func (msg MsgVoteWeighted) Type() string { return TypeMsgVoteWeighted } From b24374a7ffe821fe736c72797bbccdb6015d6da6 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Thu, 13 Jan 2022 16:35:17 +0100 Subject: [PATCH 14/39] Fix more --- x/gov/client/testutil/suite.go | 51 +++++++++++++++++----------------- x/gov/keeper/msg_server.go | 2 +- x/gov/simulation/operations.go | 2 +- x/gov/types/v1beta2/content.go | 19 ------------- x/gov/types/v1beta2/msgs.go | 16 +++-------- x/params/client/cli/tx.go | 10 ++----- 6 files changed, 34 insertions(+), 66 deletions(-) diff --git a/x/gov/client/testutil/suite.go b/x/gov/client/testutil/suite.go index 0dc7a3cf9175..96c358929969 100644 --- a/x/gov/client/testutil/suite.go +++ b/x/gov/client/testutil/suite.go @@ -17,6 +17,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/client/cli" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) type IntegrationTestSuite struct { @@ -45,7 +46,7 @@ func (s *IntegrationTestSuite) SetupSuite() { // create a proposal with deposit _, err = MsgSubmitProposal(val.ClientCtx, val.Address.String(), "Text Proposal 1", "Where is the title!?", v1beta1.ProposalTypeText, - fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, v1beta1.DefaultMinDepositTokens).String())) + fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, v1beta2.DefaultMinDepositTokens).String())) s.Require().NoError(err) _, err = s.network.WaitForHeight(1) s.Require().NoError(err) @@ -64,7 +65,7 @@ func (s *IntegrationTestSuite) SetupSuite() { // create a proposal3 with deposit _, err = MsgSubmitProposal(val.ClientCtx, val.Address.String(), "Text Proposal 3", "Where is the title!?", v1beta1.ProposalTypeText, - fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, v1beta1.DefaultMinDepositTokens).String())) + fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, v1beta2.DefaultMinDepositTokens).String())) s.Require().NoError(err) _, err = s.network.WaitForHeight(1) s.Require().NoError(err) @@ -226,7 +227,7 @@ func (s *IntegrationTestSuite) TestCmdTally() { name string args []string expectErr bool - expectedOutput v1beta1.TallyResult + expectedOutput v1beta2.TallyResult }{ { "without proposal id", @@ -234,7 +235,7 @@ func (s *IntegrationTestSuite) TestCmdTally() { fmt.Sprintf("--%s=json", tmcli.OutputFlag), }, true, - v1beta1.TallyResult{}, + v1beta2.TallyResult{}, }, { "json output", @@ -243,7 +244,7 @@ func (s *IntegrationTestSuite) TestCmdTally() { fmt.Sprintf("--%s=json", tmcli.OutputFlag), }, false, - v1beta1.NewTallyResult(sdk.NewInt(0), sdk.NewInt(0), sdk.NewInt(0), sdk.NewInt(0)), + v1beta2.NewTallyResult(sdk.NewInt(0), sdk.NewInt(0), sdk.NewInt(0), sdk.NewInt(0)), }, { "json output", @@ -252,7 +253,7 @@ func (s *IntegrationTestSuite) TestCmdTally() { fmt.Sprintf("--%s=json", tmcli.OutputFlag), }, false, - v1beta1.NewTallyResult(s.cfg.BondedTokens, sdk.NewInt(0), sdk.NewInt(0), sdk.NewInt(0)), + v1beta2.NewTallyResult(s.cfg.BondedTokens, sdk.NewInt(0), sdk.NewInt(0), sdk.NewInt(0)), }, } @@ -267,7 +268,7 @@ func (s *IntegrationTestSuite) TestCmdTally() { if tc.expectErr { s.Require().Error(err) } else { - var tally v1beta1.TallyResult + var tally v1beta2.TallyResult s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &tally), out.String()) s.Require().Equal(tally, tc.expectedOutput) } @@ -407,9 +408,9 @@ func (s *IntegrationTestSuite) TestCmdGetProposal() { s.Require().Error(err) } else { s.Require().NoError(err) - var proposal v1beta1.Proposal + var proposal v1beta2.Proposal s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &proposal), out.String()) - s.Require().Equal(title, proposal.GetTitle()) + s.Require().Equal(title, proposal.Messages[0].GetCachedValue().(*v1beta2.MsgContent).Content.GetCachedValue().(v1beta1.Content).GetTitle()) } }) } @@ -452,7 +453,7 @@ func (s *IntegrationTestSuite) TestCmdGetProposals() { s.Require().Error(err) } else { s.Require().NoError(err) - var proposals v1beta1.QueryProposalsResponse + var proposals v1beta2.QueryProposalsResponse s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &proposals), out.String()) s.Require().Len(proposals.Proposals, 3) @@ -499,7 +500,7 @@ func (s *IntegrationTestSuite) TestCmdQueryDeposits() { } else { s.Require().NoError(err) - var deposits v1beta1.QueryDepositsResponse + var deposits v1beta2.QueryDepositsResponse s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &deposits), out.String()) s.Require().Len(deposits.Deposits, 1) } @@ -509,7 +510,7 @@ func (s *IntegrationTestSuite) TestCmdQueryDeposits() { func (s *IntegrationTestSuite) TestCmdQueryDeposit() { val := s.network.Validators[0] - depositAmount := sdk.NewCoin(s.cfg.BondDenom, v1beta1.DefaultMinDepositTokens) + depositAmount := sdk.NewCoin(s.cfg.BondDenom, v1beta2.DefaultMinDepositTokens) testCases := []struct { name string @@ -555,9 +556,9 @@ func (s *IntegrationTestSuite) TestCmdQueryDeposit() { } else { s.Require().NoError(err) - var deposit v1beta1.Deposit + var deposit v1beta2.Deposit s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &deposit), out.String()) - s.Require().Equal(depositAmount.String(), deposit.Amount.String()) + s.Require().Equal(depositAmount.String(), sdk.Coins(deposit.Amount).String()) } }) } @@ -684,7 +685,7 @@ func (s *IntegrationTestSuite) TestCmdQueryVotes() { } else { s.Require().NoError(err) - var votes v1beta1.QueryVotesResponse + var votes v1beta2.QueryVotesResponse s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &votes), out.String()) s.Require().Len(votes.Votes, 1) } @@ -699,7 +700,7 @@ func (s *IntegrationTestSuite) TestCmdQueryVote() { name string args []string expectErr bool - expVoteOptions v1beta1.WeightedVoteOptions + expVoteOptions v1beta2.WeightedVoteOptions }{ { "get vote of non existing proposal", @@ -708,7 +709,7 @@ func (s *IntegrationTestSuite) TestCmdQueryVote() { val.Address.String(), }, true, - v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes), + v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), }, { "get vote by wrong voter", @@ -717,7 +718,7 @@ func (s *IntegrationTestSuite) TestCmdQueryVote() { "wrong address", }, true, - v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes), + v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), }, { "vote for valid proposal", @@ -727,7 +728,7 @@ func (s *IntegrationTestSuite) TestCmdQueryVote() { fmt.Sprintf("--%s=json", tmcli.OutputFlag), }, false, - v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes), + v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), }, { "split vote for valid proposal", @@ -737,11 +738,11 @@ func (s *IntegrationTestSuite) TestCmdQueryVote() { fmt.Sprintf("--%s=json", tmcli.OutputFlag), }, false, - v1beta1.WeightedVoteOptions{ - v1beta1.WeightedVoteOption{Option: v1beta1.OptionYes, Weight: sdk.NewDecWithPrec(60, 2)}, - v1beta1.WeightedVoteOption{Option: v1beta1.OptionNo, Weight: sdk.NewDecWithPrec(30, 2)}, - v1beta1.WeightedVoteOption{Option: v1beta1.OptionAbstain, Weight: sdk.NewDecWithPrec(5, 2)}, - v1beta1.WeightedVoteOption{Option: v1beta1.OptionNoWithVeto, Weight: sdk.NewDecWithPrec(5, 2)}, + v1beta2.WeightedVoteOptions{ + &v1beta2.WeightedVoteOption{Option: v1beta2.OptionYes, Weight: sdk.NewDecWithPrec(60, 2).String()}, + &v1beta2.WeightedVoteOption{Option: v1beta2.OptionNo, Weight: sdk.NewDecWithPrec(30, 2).String()}, + &v1beta2.WeightedVoteOption{Option: v1beta2.OptionAbstain, Weight: sdk.NewDecWithPrec(5, 2).String()}, + &v1beta2.WeightedVoteOption{Option: v1beta2.OptionNoWithVeto, Weight: sdk.NewDecWithPrec(5, 2).String()}, }, }, } @@ -764,7 +765,7 @@ func (s *IntegrationTestSuite) TestCmdQueryVote() { s.Require().Equal(len(vote.Options), len(tc.expVoteOptions)) for i, option := range tc.expVoteOptions { s.Require().Equal(option.Option, vote.Options[i].Option) - s.Require().True(option.Weight.Equal(vote.Options[i].Weight)) + s.Require().Equal(option.Weight, (vote.Options[i].Weight).String()) } } }) diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index afcb432f0deb..d8c67bd17b24 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -201,7 +201,7 @@ func (k legacyMsgServer) SubmitProposal(goCtx context.Context, msg *v1beta1.MsgS proposal, err := v1beta2.NewMsgSubmitProposal( []sdk.Msg{contentMsg}, msg.InitialDeposit, - sdk.AccAddress(msg.Proposer), + msg.Proposer, ) if err != nil { return nil, err diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index 69e5cb559eee..a451ddd078c4 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -143,7 +143,7 @@ func SimulateMsgSubmitProposal( return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgSubmitProposal, "unable to create a content proposal message"), nil, err } - msg, err := v1beta2.NewMsgSubmitProposal([]sdk.Msg{contentMsg}, deposit, simAccount.Address) + msg, err := v1beta2.NewMsgSubmitProposal([]sdk.Msg{contentMsg}, deposit, simAccount.Address.String()) if err != nil { return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgSubmitProposal, "unable to generate a submit proposal msg"), nil, err } diff --git a/x/gov/types/v1beta2/content.go b/x/gov/types/v1beta2/content.go index f7d926f45ad9..baaf8860eab1 100644 --- a/x/gov/types/v1beta2/content.go +++ b/x/gov/types/v1beta2/content.go @@ -1,27 +1,8 @@ package v1beta2 -import sdk "github.com/cosmos/cosmos-sdk/types" - // Copied over from /x/gov/types/keys.go to avoid circular imports const ( moduleName = "gov" routerKey = moduleName ) - -// Content defines an interface that a proposal must implement. It contains -// information such as the title and description along with the type and routing -// information for the appropriate handler to process the proposal. Content can -// have additional fields, which will handled by a proposal's Handler. -type Content interface { - GetTitle() string - GetDescription() string - ProposalRoute() string - ProposalType() string - ValidateBasic() error - String() string -} - -// Handler defines a function that handles a proposal after it has passed the -// governance process. -type Handler func(ctx sdk.Context, content Content) error diff --git a/x/gov/types/v1beta2/msgs.go b/x/gov/types/v1beta2/msgs.go index 987fbdb64c5f..b982b6d07e9b 100644 --- a/x/gov/types/v1beta2/msgs.go +++ b/x/gov/types/v1beta2/msgs.go @@ -29,13 +29,13 @@ var ( // NewMsgSubmitProposal creates a new MsgSubmitProposal. //nolint:interfacer -func NewMsgSubmitProposal(messages []sdk.Msg, initialDeposit sdk.Coins, proposer sdk.AccAddress) (*MsgSubmitProposal, error) { +func NewMsgSubmitProposal(messages []sdk.Msg, initialDeposit sdk.Coins, proposer string) (*MsgSubmitProposal, error) { m := &MsgSubmitProposal{ InitialDeposit: initialDeposit, - Proposer: proposer.String(), + Proposer: proposer, } - if err := m.SetMessages(messages); err != nil { + if err := m.setMessages(messages); err != nil { return &MsgSubmitProposal{}, err } @@ -46,15 +46,7 @@ func (m *MsgSubmitProposal) GetMsgs() ([]sdk.Msg, error) { return sdktx.GetMsgs(m.Messages, "sdk.MsgProposal") } -func (m *MsgSubmitProposal) SetInitialDeposit(coins sdk.Coins) { - m.InitialDeposit = coins -} - -func (m *MsgSubmitProposal) SetProposer(address fmt.Stringer) { - m.Proposer = address.String() -} - -func (m *MsgSubmitProposal) SetMessages(messages []sdk.Msg) error { +func (m *MsgSubmitProposal) setMessages(messages []sdk.Msg) error { msgs := make([]*types.Any, len(messages)) for i, msg := range messages { m, ok := msg.(proto.Message) diff --git a/x/params/client/cli/tx.go b/x/params/client/cli/tx.go index 7c670d72d641..d7726dec6d4c 100644 --- a/x/params/client/cli/tx.go +++ b/x/params/client/cli/tx.go @@ -10,8 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" - govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" - govv1beta2 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" paramscutils "github.com/cosmos/cosmos-sdk/x/params/client/utils" paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" ) @@ -77,12 +76,7 @@ Where proposal.json contains: return err } - msgContent, err := govkeeper.NewContentProposal(content, clientCtx.GetFromAddress().String()) - if err != nil { - return err - } - - msg, err := govv1beta2.NewMsgSubmitProposal([]sdk.Msg{msgContent}, deposit, from) + msg, err := govv1beta1.NewMsgSubmitProposal(content, deposit, from) if err != nil { return err } From d46152c0bc6f7dc2b17cfebd7d4fbbec5e215075 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Thu, 13 Jan 2022 16:47:56 +0100 Subject: [PATCH 15/39] Fix gov query --- x/gov/client/utils/query.go | 60 ++++++++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/x/gov/client/utils/query.go b/x/gov/client/utils/query.go index 426f4b7d31d5..61cbb306d9a4 100644 --- a/x/gov/client/utils/query.go +++ b/x/gov/client/utils/query.go @@ -8,6 +8,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) @@ -58,7 +59,12 @@ func QueryDepositsByTxQuery(clientCtx client.Context, params v1beta2.QueryPropos fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgDeposit), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalDeposit, types.AttributeKeyProposalID, params.ProposalID), }, - // Query proto Msgs event action + // Query proto Msgs event action v1beta1 + []string{ + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta1.MsgDeposit{})), + fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalDeposit, types.AttributeKeyProposalID, params.ProposalID), + }, + // Query proto Msgs event action v1beta2 []string{ fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta2.MsgDeposit{})), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalDeposit, types.AttributeKeyProposalID, params.ProposalID), @@ -108,7 +114,12 @@ func QueryVotesByTxQuery(clientCtx client.Context, params v1beta2.QueryProposalV fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgVote), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), }, - // Query Vote proto Msgs + // Query Vote proto Msgs v1beta1 + []string{ + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta1.MsgVote{})), + fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), + }, + // Query Vote proto Msgs v1beta2 []string{ fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta2.MsgVote{})), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), @@ -118,7 +129,12 @@ func QueryVotesByTxQuery(clientCtx client.Context, params v1beta2.QueryProposalV fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgVoteWeighted), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), }, - // Query VoteWeighted proto Msgs + // Query VoteWeighted proto Msgs v1beta1 + []string{ + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta1.MsgVoteWeighted{})), + fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), + }, + // Query VoteWeighted proto Msgs v1beta2 []string{ fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta2.MsgVoteWeighted{})), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), @@ -178,7 +194,13 @@ func QueryVoteByTxQuery(clientCtx client.Context, params v1beta2.QueryVoteParams fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeySender, params.Voter), }, - // Query Vote proto Msgs + // Query Vote proto Msgs v1beta1 + []string{ + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta1.MsgVote{})), + fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeySender, params.Voter.String()), + }, + // Query Vote proto Msgs v1beta2 []string{ fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta2.MsgVote{})), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), @@ -190,7 +212,13 @@ func QueryVoteByTxQuery(clientCtx client.Context, params v1beta2.QueryVoteParams fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeySender, params.Voter.String()), }, - // Query VoteWeighted proto Msgs + // Query VoteWeighted proto Msgs v1beta1 + []string{ + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta1.MsgVoteWeighted{})), + fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeySender, params.Voter), + }, + // Query VoteWeighted proto Msgs v1beta2 []string{ fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta2.MsgVoteWeighted{})), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), @@ -262,7 +290,13 @@ func QueryDepositByTxQuery(clientCtx client.Context, params v1beta2.QueryDeposit fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalDeposit, types.AttributeKeyProposalID, params.ProposalID), fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeySender, params.Depositor.String()), }, - // Query proto Msgs event action + // Query proto Msgs event action v1beta1 + []string{ + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta1.MsgDeposit{})), + fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalDeposit, types.AttributeKeyProposalID, params.ProposalID), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeySender, params.Depositor.String()), + }, + // Query proto Msgs event action v1beta2 []string{ fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta2.MsgDeposit{})), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalDeposit, types.AttributeKeyProposalID, params.ProposalID), @@ -307,7 +341,12 @@ func QueryProposerByTxQuery(clientCtx client.Context, proposalID uint64) (Propos fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgSubmitProposal), fmt.Sprintf("%s.%s='%d'", types.EventTypeSubmitProposal, types.AttributeKeyProposalID, proposalID), }, - // Query proto Msgs event action + // Query proto Msgs event action v1beta1 + []string{ + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta1.MsgSubmitProposal{})), + fmt.Sprintf("%s.%s='%d'", types.EventTypeSubmitProposal, types.AttributeKeyProposalID, proposalID), + }, + // Query proto Msgs event action v1beta2 []string{ fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta2.MsgSubmitProposal{})), fmt.Sprintf("%s.%s='%d'", types.EventTypeSubmitProposal, types.AttributeKeyProposalID, proposalID), @@ -377,7 +416,12 @@ func queryInitialDepositByTxQuery(clientCtx client.Context, proposalID uint64) ( fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgSubmitProposal), fmt.Sprintf("%s.%s='%d'", types.EventTypeSubmitProposal, types.AttributeKeyProposalID, proposalID), }, - // Query proto Msgs event action + // Query proto Msgs event action v1beta1 + []string{ + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta1.MsgSubmitProposal{})), + fmt.Sprintf("%s.%s='%d'", types.EventTypeSubmitProposal, types.AttributeKeyProposalID, proposalID), + }, + // Query proto Msgs event action v1beta2 []string{ fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, sdk.MsgTypeURL(&v1beta2.MsgSubmitProposal{})), fmt.Sprintf("%s.%s='%d'", types.EventTypeSubmitProposal, types.AttributeKeyProposalID, proposalID), From f601e560c5715ea25e07e06862e7fa8d620925be Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Thu, 13 Jan 2022 18:05:11 +0100 Subject: [PATCH 16/39] Use Msg ExecLegacyContent --- proto/cosmos/gov/v1beta2/gov.proto | 6 - proto/cosmos/gov/v1beta2/tx.proto | 18 + x/gov/abci_test.go | 10 +- x/gov/keeper/msg_server.go | 6 +- x/gov/keeper/proposal.go | 29 +- x/gov/keeper/proposal_test.go | 7 +- x/gov/simulation/operations.go | 2 +- x/gov/simulation/operations_test.go | 11 +- x/gov/types/v1beta2/codec.go | 4 +- x/gov/types/v1beta2/content.go | 35 ++ x/gov/types/v1beta2/gov.pb.go | 364 ++++--------------- x/gov/types/v1beta2/msgs.go | 14 +- x/gov/types/v1beta2/msgs_test.go | 4 +- x/gov/types/v1beta2/tx.pb.go | 522 +++++++++++++++++++++++++--- 14 files changed, 628 insertions(+), 404 deletions(-) diff --git a/proto/cosmos/gov/v1beta2/gov.proto b/proto/cosmos/gov/v1beta2/gov.proto index efff1d652c3a..92bcbb2c6def 100644 --- a/proto/cosmos/gov/v1beta2/gov.proto +++ b/proto/cosmos/gov/v1beta2/gov.proto @@ -121,9 +121,3 @@ message TallyParams { // vetoed. Default value: 1/3. string veto_threshold = 3 [(cosmos_proto.scalar) = "cosmos.Dec"]; } - -// Content is used to wrap the legacy content field into a message. This ensures backwards compatibility -message MsgContent { - google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; - string authority = 2; -} diff --git a/proto/cosmos/gov/v1beta2/tx.proto b/proto/cosmos/gov/v1beta2/tx.proto index f1869d7150b4..35226c9bc5e9 100644 --- a/proto/cosmos/gov/v1beta2/tx.proto +++ b/proto/cosmos/gov/v1beta2/tx.proto @@ -14,6 +14,10 @@ service Msg { // SubmitProposal defines a method to create new proposal given a content. rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); + // ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal + // to execute a legacy content-based proposal. + rpc ExecLegacyContent(MsgExecLegacyContent) returns (MsgExecLegacyContentResponse); + // Vote defines a method to add a vote on a specific proposal. rpc Vote(MsgVote) returns (MsgVoteResponse); @@ -39,6 +43,20 @@ message MsgSubmitProposalResponse { uint64 proposal_id = 1; } +// MsgExecLegacyContent is used to wrap the legacy content field into a message. +// This ensures backwards compatibility with v1beta1.MsgSubmitProposal. +message MsgExecLegacyContent { + // content is the proposal's content. + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; + // authority must be the gov module address. + string authority = 2; +} + +// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. +message MsgExecLegacyContentResponse { + uint64 proposal_id = 1; +} + // MsgVote defines a message to cast a vote. message MsgVote { uint64 proposal_id = 1; diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index eab34ec0439e..77fbf0a01912 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -36,7 +36,7 @@ func TestTickExpiredDepositPeriod(t *testing.T) { newProposalMsg, err := v1beta2.NewMsgSubmitProposal( []sdk.Msg{}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, - addrs[0], + addrs[0].String(), ) require.NoError(t, err) @@ -88,7 +88,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { newProposalMsg, err := v1beta2.NewMsgSubmitProposal( []sdk.Msg{}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, - addrs[0], + addrs[0].String(), ) require.NoError(t, err) @@ -111,7 +111,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { newProposalMsg2, err := v1beta2.NewMsgSubmitProposal( []sdk.Msg{}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, - addrs[0], + addrs[0].String(), ) require.NoError(t, err) @@ -168,7 +168,7 @@ func TestTickPassedDepositPeriod(t *testing.T) { newProposalMsg, err := v1beta2.NewMsgSubmitProposal( []sdk.Msg{}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, - addrs[0], + addrs[0].String(), ) require.NoError(t, err) @@ -221,7 +221,7 @@ func TestTickPassedVotingPeriod(t *testing.T) { activeQueue.Close() proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 5))} - newProposalMsg, err := v1beta2.NewMsgSubmitProposal([]sdk.Msg{}, proposalCoins, addrs[0]) + newProposalMsg, err := v1beta2.NewMsgSubmitProposal([]sdk.Msg{}, proposalCoins, addrs[0].String()) require.NoError(t, err) wrapCtx := sdk.WrapSDKContext(ctx) diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index d8c67bd17b24..62e661be1c65 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -80,6 +80,10 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1beta2.MsgSubmitP }, nil } +func (k msgServer) ExecLegacyContent(goCtx context.Context, msg *v1beta2.MsgExecLegacyContent) (*v1beta2.MsgExecLegacyContentResponse, error) { + panic("todo") +} + func (k msgServer) Vote(goCtx context.Context, msg *v1beta2.MsgVote) (*v1beta2.MsgVoteResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) accAddr, accErr := sdk.AccAddressFromBech32(msg.Voter) @@ -193,7 +197,7 @@ func NewLegacyMsgServerImpl(govAcct string, v1beta2Server v1beta2.MsgServer) v1b var _ v1beta1.MsgServer = legacyMsgServer{} func (k legacyMsgServer) SubmitProposal(goCtx context.Context, msg *v1beta1.MsgSubmitProposal) (*v1beta1.MsgSubmitProposalResponse, error) { - contentMsg, err := NewContentProposal(msg.GetContent(), k.govAcct) + contentMsg, err := v1beta2.NewLegacyContent(msg.GetContent(), k.govAcct) if err != nil { return nil, fmt.Errorf("error converting legacy content into proposal message: %w", err) } diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 92feed14d2dd..615db5134bce 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -3,10 +3,7 @@ package keeper import ( "fmt" - "github.com/gogo/protobuf/proto" - "github.com/cosmos/cosmos-sdk/client" - codec "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -35,8 +32,8 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg) (v1beta } // check if the message wraps the legacy content type - if contentMsg, ok := msg.(*v1beta2.MsgContent); ok { - content := ContentFromMessage(contentMsg) + if contentMsg, ok := msg.(*v1beta2.MsgExecLegacyContent); ok { + content := v1beta2.LegacyContentFromMessage(contentMsg) if content == nil { return v1beta2.Proposal{}, sdkerrors.Wrap(v1beta1.ErrInvalidProposalContent, "content is nil") } @@ -263,25 +260,3 @@ func (keeper Keeper) UnmarshalProposal(bz []byte, proposal *v1beta2.Proposal) er } return nil } - -// TODO: move both these functions to the migration package -func NewContentProposal(content v1beta1.Content, authority string) (*v1beta2.MsgContent, error) { - msg, ok := content.(proto.Message) - if !ok { - return nil, fmt.Errorf("%T does not implement proto.Message", content) - } - - any, err := codec.NewAnyWithValue(msg) - if err != nil { - return nil, err - } - return v1beta2.NewMsgContent(any, authority), nil -} - -func ContentFromMessage(msg *v1beta2.MsgContent) v1beta1.Content { - content, ok := msg.Content.GetCachedValue().(v1beta1.Content) - if !ok { - return nil - } - return content -} diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index 4022a5e0deb4..732a2fb60c1f 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -10,7 +10,6 @@ import ( "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" @@ -70,7 +69,7 @@ func (suite *KeeperTestSuite) TestSubmitProposal() { } for i, tc := range testCases { - prop, err := keeper.NewContentProposal(tc.content, suite.app.GovKeeper.GetGovernanceAccount(suite.ctx).GetAddress().String()) + prop, err := v1beta2.NewLegacyContent(tc.content, suite.app.GovKeeper.GetGovernanceAccount(suite.ctx).GetAddress().String()) suite.Require().NoError(err) _, err = suite.app.GovKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}) suite.Require().True(errors.Is(tc.expectedErr, err), "tc #%d; got: %v, expected: %v", i, err, tc.expectedErr) @@ -136,8 +135,8 @@ func (suite *KeeperTestSuite) TestGetProposalsFiltered() { func TestMigrateProposalMessages(t *testing.T) { content := v1beta1.NewTextProposal("Test", "description") - contentMsg, err := keeper.NewContentProposal(content, sdk.AccAddress("test1").String()) + contentMsg, err := v1beta2.NewLegacyContent(content, sdk.AccAddress("test1").String()) require.NoError(t, err) - content = keeper.ContentFromMessage(contentMsg) + content = v1beta2.LegacyContentFromMessage(contentMsg) require.NotNil(t, content) } diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index a451ddd078c4..a506340f726b 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -138,7 +138,7 @@ func SimulateMsgSubmitProposal( return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgSubmitProposal, "unable to generate deposit"), nil, err } - contentMsg, err := keeper.NewContentProposal(content, k.GetGovernanceAccount(ctx).GetAddress().String()) + contentMsg, err := v1beta2.NewLegacyContent(content, k.GetGovernanceAccount(ctx).GetAddress().String()) if err != nil { return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgSubmitProposal, "unable to create a content proposal message"), nil, err } diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index fb99228c4dd8..3a2d0002bb7e 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -15,7 +15,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/bank/testutil" - "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/simulation" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" @@ -125,9 +124,9 @@ func TestSimulateMsgSubmitProposal(t *testing.T) { msgs, err := proposal.GetMsgs() require.NoError(t, err) require.Len(t, msgs, 1) - contentMsg, ok := msgs[0].(*v1beta2.MsgContent) + contentMsg, ok := msgs[0].(*v1beta2.MsgExecLegacyContent) require.True(t, ok) - content := keeper.ContentFromMessage(contentMsg) + content := v1beta2.LegacyContentFromMessage(contentMsg) require.Equal(t, "title-3: ZBSpYuLyYggwexjxusrBqDOTtGTOWeLrQKjLxzIivHSlcxgdXhhuTSkuxKGLwQvuyNhYFmBZHeAerqyNEUzXPFGkqEGqiQWIXnku", content.GetTitle()) require.Equal(t, "description-3: NJWzHdBNpAXKJPHWQdrGYcAHSctgVlqwqHoLfHsXUdStwfefwzqLuKEhmMyYLdbZrcPgYqjNHxPexsruwEGStAneKbWkQDDIlCWBLSiAASNhZqNFlPtfqPJoxKsgMdzjWqLWdqKQuJqWPMvwPQWZUtVMOTMYKJbfdlZsjdsomuScvDmbDkgRualsxDvRJuCAmPOXitIbcyWsKGSdrEunFAOdmXnsuyFVgJqEjbklvmwrUlsxjRSfKZxGcpayDdgoFcnVSutxjRgOSFzPwidAjubMncNweqpbxhXGchpZUxuFDOtpnhNUycJICRYqsPhPSCjPTWZFLkstHWJxvdPEAyEIxXgLwbNOjrgzmaujiBABBIXvcXpLrbcEWNNQsbjvgJFgJkflpRohHUutvnaUqoopuKjTDaemDeSdqbnOzcfJpcTuAQtZoiLZOoAIlboFDAeGmSNwkvObPRvRWQgWkGkxwtPauYgdkmypLjbqhlHJIQTntgWjXwZdOyYEdQRRLfMSdnxqppqUofqLbLQDUjwKVKfZJUJQPsWIPwIVaSTrmKskoAhvmZyJgeRpkaTfGgrJzAigcxtfshmiDCFkuiluqtMOkidknnTBtumyJYlIsWLnCQclqdVmikUoMOPdPWwYbJxXyqUVicNxFxyqJTenNblyyKSdlCbiXxUi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cbWwNbeH", content.GetDescription()) require.Equal(t, "gov", proposal.Route()) @@ -149,7 +148,7 @@ func TestSimulateMsgDeposit(t *testing.T) { // setup a proposal content := v1beta1.NewTextProposal("Test", "description") - contentMsg, err := keeper.NewContentProposal(content, app.GovKeeper.GetGovernanceAccount(ctx).GetAddress().String()) + contentMsg, err := v1beta2.NewLegacyContent(content, app.GovKeeper.GetGovernanceAccount(ctx).GetAddress().String()) require.NoError(t, err) submitTime := ctx.BlockHeader().Time @@ -194,7 +193,7 @@ func TestSimulateMsgVote(t *testing.T) { // setup a proposal govAcc := app.GovKeeper.GetGovernanceAccount(ctx).GetAddress().String() - contentMsg, err := keeper.NewContentProposal(v1beta1.NewTextProposal("Test", "description"), govAcc) + contentMsg, err := v1beta2.NewLegacyContent(v1beta1.NewTextProposal("Test", "description"), govAcc) require.NoError(t, err) submitTime := ctx.BlockHeader().Time @@ -238,7 +237,7 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { // setup a proposal govAcc := app.GovKeeper.GetGovernanceAccount(ctx).GetAddress().String() - contentMsg, err := keeper.NewContentProposal(v1beta1.NewTextProposal("Test", "description"), govAcc) + contentMsg, err := v1beta2.NewLegacyContent(v1beta1.NewTextProposal("Test", "description"), govAcc) require.NoError(t, err) submitTime := ctx.BlockHeader().Time diff --git a/x/gov/types/v1beta2/codec.go b/x/gov/types/v1beta2/codec.go index fe371244b814..1f46b036f149 100644 --- a/x/gov/types/v1beta2/codec.go +++ b/x/gov/types/v1beta2/codec.go @@ -15,7 +15,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgDeposit{}, "cosmos-sdk/v1beta2/MsgDeposit", nil) cdc.RegisterConcrete(&MsgVote{}, "cosmos-sdk/v1beta2/MsgVote", nil) cdc.RegisterConcrete(&MsgVoteWeighted{}, "cosmos-sdk/v1beta2/MsgVoteWeighted", nil) - cdc.RegisterConcrete(&MsgContent{}, "cosmos-sdk/v1beta2/MsgContent", nil) + cdc.RegisterConcrete(&MsgExecLegacyContent{}, "cosmos-sdk/v1beta2/MsgExecLegacyContent", nil) } func RegisterInterfaces(registry types.InterfaceRegistry) { @@ -24,7 +24,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &MsgVote{}, &MsgVoteWeighted{}, &MsgDeposit{}, - &MsgContent{}, + &MsgExecLegacyContent{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/gov/types/v1beta2/content.go b/x/gov/types/v1beta2/content.go index baaf8860eab1..99f6d70edeeb 100644 --- a/x/gov/types/v1beta2/content.go +++ b/x/gov/types/v1beta2/content.go @@ -1,8 +1,43 @@ package v1beta2 +import ( + "fmt" + + "github.com/gogo/protobuf/proto" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" +) + // Copied over from /x/gov/types/keys.go to avoid circular imports const ( moduleName = "gov" routerKey = moduleName ) + +// NewLegacyContent creates a new MsgExecLegacyContent from a legacy Content +// interface. +func NewLegacyContent(content v1beta1.Content, authority string) (*MsgExecLegacyContent, error) { + msg, ok := content.(proto.Message) + if !ok { + return nil, fmt.Errorf("%T does not implement proto.Message", content) + } + + any, err := codectypes.NewAnyWithValue(msg) + if err != nil { + return nil, err + } + + return NewMsgExecLegacyContent(any, authority), nil +} + +// LegacyContentFromMessage extracts the legacy Content interface from a +// MsgExecLegacyContent. +func LegacyContentFromMessage(msg *MsgExecLegacyContent) v1beta1.Content { + content, ok := msg.Content.GetCachedValue().(v1beta1.Content) + if !ok { + return nil + } + return content +} diff --git a/x/gov/types/v1beta2/gov.pb.go b/x/gov/types/v1beta2/gov.pb.go index 9a408fcfcf73..b8064e10147e 100644 --- a/x/gov/types/v1beta2/gov.pb.go +++ b/x/gov/types/v1beta2/gov.pb.go @@ -655,59 +655,6 @@ func (m *TallyParams) GetVetoThreshold() string { return "" } -// Content is used to wrap the legacy content field into a message. This ensures backwards compatibility -type MsgContent struct { - Content *types1.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` - Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"` -} - -func (m *MsgContent) Reset() { *m = MsgContent{} } -func (m *MsgContent) String() string { return proto.CompactTextString(m) } -func (*MsgContent) ProtoMessage() {} -func (*MsgContent) Descriptor() ([]byte, []int) { - return fileDescriptor_5abf7b8852811c49, []int{8} -} -func (m *MsgContent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgContent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgContent.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 *MsgContent) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgContent.Merge(m, src) -} -func (m *MsgContent) XXX_Size() int { - return m.Size() -} -func (m *MsgContent) XXX_DiscardUnknown() { - xxx_messageInfo_MsgContent.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgContent proto.InternalMessageInfo - -func (m *MsgContent) GetContent() *types1.Any { - if m != nil { - return m.Content - } - return nil -} - -func (m *MsgContent) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - func init() { proto.RegisterEnum("cosmos.gov.v1beta2.VoteOption", VoteOption_name, VoteOption_value) proto.RegisterEnum("cosmos.gov.v1beta2.ProposalStatus", ProposalStatus_name, ProposalStatus_value) @@ -719,80 +666,76 @@ func init() { proto.RegisterType((*DepositParams)(nil), "cosmos.gov.v1beta2.DepositParams") proto.RegisterType((*VotingParams)(nil), "cosmos.gov.v1beta2.VotingParams") proto.RegisterType((*TallyParams)(nil), "cosmos.gov.v1beta2.TallyParams") - proto.RegisterType((*MsgContent)(nil), "cosmos.gov.v1beta2.MsgContent") } func init() { proto.RegisterFile("cosmos/gov/v1beta2/gov.proto", fileDescriptor_5abf7b8852811c49) } var fileDescriptor_5abf7b8852811c49 = []byte{ - // 1070 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0xc1, 0x4f, 0xe3, 0xc6, - 0x17, 0xc6, 0x49, 0x36, 0x81, 0x17, 0xc8, 0xe6, 0x37, 0x8b, 0x7e, 0x6b, 0x58, 0x9a, 0xd0, 0x1c, - 0x10, 0x5a, 0x95, 0x04, 0xa8, 0xba, 0x95, 0xda, 0xcb, 0x26, 0xd8, 0xdb, 0x35, 0x02, 0x1c, 0xd9, - 0xde, 0xa0, 0xf6, 0x62, 0x39, 0x78, 0xd6, 0xb1, 0x1a, 0x7b, 0x52, 0xcf, 0x84, 0x25, 0x7f, 0x42, - 0x6f, 0x7b, 0xac, 0xda, 0x4b, 0xef, 0xbd, 0xf2, 0x47, 0xac, 0x7a, 0xa8, 0x56, 0x2b, 0xad, 0xd4, - 0x53, 0x5b, 0xc1, 0x3f, 0x52, 0x79, 0x3c, 0x26, 0x21, 0xa4, 0x22, 0x27, 0x26, 0xef, 0x7d, 0xdf, - 0x37, 0xef, 0xcd, 0x7c, 0xf3, 0x30, 0x6c, 0x9c, 0x11, 0x1a, 0x10, 0xda, 0xf0, 0xc8, 0x79, 0xe3, - 0x7c, 0xaf, 0x8b, 0x99, 0xb3, 0x1f, 0xaf, 0xeb, 0x83, 0x88, 0x30, 0x82, 0x50, 0x92, 0xad, 0xc7, - 0x11, 0x91, 0x5d, 0xaf, 0x08, 0x46, 0xd7, 0xa1, 0x58, 0x50, 0xf6, 0x1a, 0x67, 0xc4, 0x0f, 0x13, - 0xce, 0xfa, 0xaa, 0x47, 0x3c, 0xc2, 0x97, 0x8d, 0x78, 0x25, 0xa2, 0x55, 0x8f, 0x10, 0xaf, 0x8f, - 0x1b, 0xfc, 0x57, 0x77, 0xf8, 0xba, 0xc1, 0xfc, 0x00, 0x53, 0xe6, 0x04, 0x03, 0x01, 0x58, 0x9b, - 0x06, 0x38, 0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, 0xd3, 0x3f, - 0x24, 0x28, 0xdd, 0x9e, 0xf3, 0xa8, 0x0a, 0x4f, 0xda, 0x86, 0xde, 0xd6, 0xcd, 0xe6, 0x91, 0x6d, - 0x5a, 0x4d, 0xeb, 0x95, 0x39, 0x55, 0x53, 0x0d, 0x2a, 0xd3, 0x00, 0x45, 0x6d, 0xeb, 0xa6, 0x66, - 0xd9, 0x6d, 0xd5, 0xd0, 0x74, 0xa5, 0x2c, 0xa1, 0x4f, 0xe1, 0x93, 0x69, 0x4c, 0x47, 0xb7, 0xb4, - 0x93, 0x6f, 0x52, 0x48, 0x06, 0xad, 0xc3, 0xff, 0xa7, 0x21, 0xed, 0xa6, 0x69, 0xaa, 0x4a, 0x52, - 0xf4, 0x74, 0xce, 0x50, 0x0f, 0xd5, 0x03, 0x4b, 0x55, 0xca, 0xb9, 0x59, 0xcc, 0x17, 0x4d, 0xed, - 0x48, 0x55, 0xca, 0x0f, 0x5a, 0x87, 0xef, 0xae, 0x2a, 0xd2, 0xfb, 0xab, 0x8a, 0xf4, 0xcf, 0x55, - 0x45, 0x7a, 0x7b, 0x5d, 0x59, 0x78, 0x7f, 0x5d, 0x59, 0xf8, 0xf3, 0xba, 0xb2, 0xf0, 0xdd, 0xae, - 0xe7, 0xb3, 0xde, 0xb0, 0x5b, 0x3f, 0x23, 0x81, 0xf8, 0x00, 0x11, 0x7f, 0x76, 0xa8, 0xfb, 0x7d, - 0xe3, 0x82, 0x7f, 0x5e, 0xb1, 0xd1, 0x00, 0xd3, 0xf4, 0x23, 0xab, 0x9b, 0xe7, 0x57, 0xfd, 0xf9, - 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x56, 0x0c, 0x37, 0x2e, 0x81, 0x09, 0x00, 0x00, + // 1022 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0x41, 0x6f, 0xdb, 0x36, + 0x14, 0x8e, 0x6c, 0xc7, 0x49, 0x9e, 0x13, 0x57, 0x63, 0x83, 0x55, 0x49, 0x3b, 0x39, 0xf3, 0x21, + 0x08, 0x8a, 0xc5, 0x4e, 0x32, 0xac, 0x03, 0x76, 0xaa, 0x1d, 0xa9, 0xab, 0x82, 0x34, 0x32, 0x24, + 0xd5, 0xc1, 0x76, 0x11, 0xe4, 0x88, 0x95, 0x85, 0x59, 0xa2, 0x27, 0xd2, 0x69, 0xf2, 0x13, 0x76, + 0xeb, 0x71, 0xd8, 0x2e, 0xbb, 0xef, 0xda, 0x1f, 0xd1, 0xd3, 0x50, 0x14, 0x28, 0xb0, 0xd3, 0x36, + 0x24, 0x7f, 0x64, 0x10, 0x45, 0x25, 0x8e, 0xe3, 0x22, 0x3e, 0x99, 0x7a, 0xef, 0xfb, 0x3e, 0x3e, + 0x92, 0x1f, 0x9f, 0x09, 0x8f, 0x4e, 0x08, 0x8d, 0x08, 0x6d, 0x06, 0xe4, 0xb4, 0x79, 0xba, 0xdb, + 0xc3, 0xcc, 0xdb, 0x4b, 0xc7, 0x8d, 0x61, 0x42, 0x18, 0x41, 0x28, 0xcb, 0x36, 0xd2, 0x88, 0xc8, + 0xae, 0xab, 0x82, 0xd1, 0xf3, 0x28, 0x16, 0x94, 0xdd, 0xe6, 0x09, 0x09, 0xe3, 0x8c, 0xb3, 0xbe, + 0x1a, 0x90, 0x80, 0xf0, 0x61, 0x33, 0x1d, 0x89, 0x68, 0x2d, 0x20, 0x24, 0x18, 0xe0, 0x26, 0xff, + 0xea, 0x8d, 0x5e, 0x35, 0x59, 0x18, 0x61, 0xca, 0xbc, 0x68, 0x28, 0x00, 0x6b, 0x93, 0x00, 0x2f, + 0x3e, 0x17, 0x29, 0x75, 0x32, 0xe5, 0x8f, 0x12, 0x8f, 0x85, 0x24, 0x9f, 0x71, 0x2d, 0xab, 0xc8, + 0xcd, 0x26, 0x15, 0x25, 0xf3, 0x8f, 0x3a, 0x03, 0x74, 0x8c, 0xc3, 0xa0, 0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xfd, 0x40, 0xdf, 0x77, 0x74, 0x4d, 0x2e, 0x4d, 0x63, 0x3e, 0x6b, + 0x19, 0x87, 0xba, 0x26, 0xcf, 0xb7, 0x0f, 0xde, 0x5d, 0xa8, 0xd2, 0xfb, 0x0b, 0x55, 0xfa, 0xef, + 0x42, 0x95, 0xde, 0x5c, 0xaa, 0x73, 0xef, 0x2f, 0xd5, 0xb9, 0xbf, 0x2f, 0xd5, 0xb9, 0x1f, 0x77, + 0x82, 0x90, 0xf5, 0x47, 0xbd, 0xc6, 0x09, 0x89, 0xc4, 0xbb, 0x40, 0xfc, 0x6c, 0x53, 0xff, 0xa7, + 0xe6, 0x19, 0x7f, 0xf5, 0xb0, 0xf3, 0x21, 0xa6, 0xf9, 0xdb, 0xa7, 0x57, 0xe6, 0x66, 0xfb, 0xfa, + 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x59, 0x87, 0xaa, 0xdc, 0x18, 0x09, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { @@ -1221,48 +1164,6 @@ func (m *TallyParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgContent) 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 *MsgContent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgContent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintGov(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0x12 - } - if m.Content != nil { - { - size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func encodeVarintGov(dAtA []byte, offset int, v uint64) int { offset -= sovGov(v) base := offset @@ -1462,23 +1363,6 @@ func (m *TallyParams) Size() (n int) { return n } -func (m *MsgContent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Content != nil { - l = m.Content.Size() - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - return n -} - func sovGov(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2741,124 +2625,6 @@ func (m *TallyParams) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgContent) 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: MsgContent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgContent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Content == nil { - m.Content = &types1.Any{} - } - if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", 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.Authority = 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 skipGov(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/gov/types/v1beta2/msgs.go b/x/gov/types/v1beta2/msgs.go index b982b6d07e9b..39e85643ad80 100644 --- a/x/gov/types/v1beta2/msgs.go +++ b/x/gov/types/v1beta2/msgs.go @@ -23,8 +23,8 @@ const ( ) var ( - _, _, _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{}, &MsgVoteWeighted{}, &MsgContent{} - _, _ types.UnpackInterfacesMessage = &MsgSubmitProposal{}, &MsgContent{} + _, _, _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{}, &MsgVoteWeighted{}, &MsgExecLegacyContent{} + _, _ types.UnpackInterfacesMessage = &MsgSubmitProposal{}, &MsgExecLegacyContent{} ) // NewMsgSubmitProposal creates a new MsgSubmitProposal. @@ -260,19 +260,19 @@ func (msg MsgVoteWeighted) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{voter} } -func NewMsgContent(content *types.Any, authority string) *MsgContent { - return &MsgContent{ +func NewMsgExecLegacyContent(content *types.Any, authority string) *MsgExecLegacyContent { + return &MsgExecLegacyContent{ Content: content, Authority: authority, } } -func (c MsgContent) GetSigners() []sdk.AccAddress { +func (c MsgExecLegacyContent) GetSigners() []sdk.AccAddress { authority, _ := sdk.AccAddressFromBech32(c.Authority) return []sdk.AccAddress{authority} } -func (c MsgContent) ValidateBasic() error { +func (c MsgExecLegacyContent) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(c.Authority) if err != nil { return err @@ -282,7 +282,7 @@ func (c MsgContent) ValidateBasic() error { } // UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces -func (m MsgContent) UnpackInterfaces(unpacker types.AnyUnpacker) error { +func (m MsgExecLegacyContent) UnpackInterfaces(unpacker types.AnyUnpacker) error { var content v1beta1.Content return unpacker.UnpackAny(m.Content, &content) } diff --git a/x/gov/types/v1beta2/msgs_test.go b/x/gov/types/v1beta2/msgs_test.go index 98b9e1a4715d..654487bd4ccc 100644 --- a/x/gov/types/v1beta2/msgs_test.go +++ b/x/gov/types/v1beta2/msgs_test.go @@ -129,12 +129,12 @@ func TestMsgVoteWeighted(t *testing.T) { // this tests that Amino JSON MsgSubmitProposal.GetSignBytes() still works with Content as Any using the ModuleCdc func TestMsgSubmitProposal_GetSignBytes(t *testing.T) { proposal := []sdk.Msg{v1beta2.NewMsgVote(addrs[0], 1, v1beta2.OptionYes)} - msg, err := v1beta2.NewMsgSubmitProposal(proposal, sdk.NewCoins(), sdk.AccAddress{}) + msg, err := v1beta2.NewMsgSubmitProposal(proposal, sdk.NewCoins(), addrs[1].String()) require.NoError(t, err) var bz []byte require.NotPanics(t, func() { bz = msg.GetSignBytes() }) - require.Equal(t, "{\"type\":\"cosmos-sdk/v1beta2/MsgSubmitProposal\",\"value\":{\"initial_deposit\":[],\"messages\":[{\"type\":\"cosmos-sdk/v1beta2/MsgVote\",\"value\":{\"option\":1,\"proposal_id\":\"1\",\"voter\":\"cosmos1w3jhxap3gempvr\"}}]}}", + require.Equal(t, `{"type":"cosmos-sdk/v1beta2/MsgSubmitProposal","value":{"initial_deposit":[],"messages":[{"type":"cosmos-sdk/v1beta2/MsgVote","value":{"option":1,"proposal_id":"1","voter":"cosmos1w3jhxap3gempvr"}}],"proposer":"cosmos1w3jhxapjx2whzu"}}`, string(bz)) } diff --git a/x/gov/types/v1beta2/tx.pb.go b/x/gov/types/v1beta2/tx.pb.go index e211ffac2c5f..15a37cb792ce 100644 --- a/x/gov/types/v1beta2/tx.pb.go +++ b/x/gov/types/v1beta2/tx.pb.go @@ -138,6 +138,107 @@ func (m *MsgSubmitProposalResponse) GetProposalId() uint64 { return 0 } +// MsgExecLegacyContent is used to wrap the legacy content field into a message. +// This ensures backwards compatibility with v1beta1.MsgSubmitProposal. +type MsgExecLegacyContent struct { + // content is the proposal's content. + Content *types.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` + // authority must be the gov module address. + Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (m *MsgExecLegacyContent) Reset() { *m = MsgExecLegacyContent{} } +func (m *MsgExecLegacyContent) String() string { return proto.CompactTextString(m) } +func (*MsgExecLegacyContent) ProtoMessage() {} +func (*MsgExecLegacyContent) Descriptor() ([]byte, []int) { + return fileDescriptor_4214261f6b3f9ed4, []int{2} +} +func (m *MsgExecLegacyContent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExecLegacyContent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExecLegacyContent.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 *MsgExecLegacyContent) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExecLegacyContent.Merge(m, src) +} +func (m *MsgExecLegacyContent) XXX_Size() int { + return m.Size() +} +func (m *MsgExecLegacyContent) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExecLegacyContent.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExecLegacyContent proto.InternalMessageInfo + +func (m *MsgExecLegacyContent) GetContent() *types.Any { + if m != nil { + return m.Content + } + return nil +} + +func (m *MsgExecLegacyContent) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. +type MsgExecLegacyContentResponse struct { + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` +} + +func (m *MsgExecLegacyContentResponse) Reset() { *m = MsgExecLegacyContentResponse{} } +func (m *MsgExecLegacyContentResponse) String() string { return proto.CompactTextString(m) } +func (*MsgExecLegacyContentResponse) ProtoMessage() {} +func (*MsgExecLegacyContentResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4214261f6b3f9ed4, []int{3} +} +func (m *MsgExecLegacyContentResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExecLegacyContentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExecLegacyContentResponse.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 *MsgExecLegacyContentResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExecLegacyContentResponse.Merge(m, src) +} +func (m *MsgExecLegacyContentResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgExecLegacyContentResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExecLegacyContentResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExecLegacyContentResponse proto.InternalMessageInfo + +func (m *MsgExecLegacyContentResponse) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + // MsgVote defines a message to cast a vote. type MsgVote struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` @@ -149,7 +250,7 @@ func (m *MsgVote) Reset() { *m = MsgVote{} } func (m *MsgVote) String() string { return proto.CompactTextString(m) } func (*MsgVote) ProtoMessage() {} func (*MsgVote) Descriptor() ([]byte, []int) { - return fileDescriptor_4214261f6b3f9ed4, []int{2} + return fileDescriptor_4214261f6b3f9ed4, []int{4} } func (m *MsgVote) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -207,7 +308,7 @@ func (m *MsgVoteResponse) Reset() { *m = MsgVoteResponse{} } func (m *MsgVoteResponse) String() string { return proto.CompactTextString(m) } func (*MsgVoteResponse) ProtoMessage() {} func (*MsgVoteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4214261f6b3f9ed4, []int{3} + return fileDescriptor_4214261f6b3f9ed4, []int{5} } func (m *MsgVoteResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -249,7 +350,7 @@ func (m *MsgVoteWeighted) Reset() { *m = MsgVoteWeighted{} } func (m *MsgVoteWeighted) String() string { return proto.CompactTextString(m) } func (*MsgVoteWeighted) ProtoMessage() {} func (*MsgVoteWeighted) Descriptor() ([]byte, []int) { - return fileDescriptor_4214261f6b3f9ed4, []int{4} + return fileDescriptor_4214261f6b3f9ed4, []int{6} } func (m *MsgVoteWeighted) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -309,7 +410,7 @@ func (m *MsgVoteWeightedResponse) Reset() { *m = MsgVoteWeightedResponse func (m *MsgVoteWeightedResponse) String() string { return proto.CompactTextString(m) } func (*MsgVoteWeightedResponse) ProtoMessage() {} func (*MsgVoteWeightedResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4214261f6b3f9ed4, []int{5} + return fileDescriptor_4214261f6b3f9ed4, []int{7} } func (m *MsgVoteWeightedResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -349,7 +450,7 @@ func (m *MsgDeposit) Reset() { *m = MsgDeposit{} } func (m *MsgDeposit) String() string { return proto.CompactTextString(m) } func (*MsgDeposit) ProtoMessage() {} func (*MsgDeposit) Descriptor() ([]byte, []int) { - return fileDescriptor_4214261f6b3f9ed4, []int{6} + return fileDescriptor_4214261f6b3f9ed4, []int{8} } func (m *MsgDeposit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -407,7 +508,7 @@ func (m *MsgDepositResponse) Reset() { *m = MsgDepositResponse{} } func (m *MsgDepositResponse) String() string { return proto.CompactTextString(m) } func (*MsgDepositResponse) ProtoMessage() {} func (*MsgDepositResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4214261f6b3f9ed4, []int{7} + return fileDescriptor_4214261f6b3f9ed4, []int{9} } func (m *MsgDepositResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -439,6 +540,8 @@ var xxx_messageInfo_MsgDepositResponse proto.InternalMessageInfo func init() { proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos.gov.v1beta2.MsgSubmitProposal") proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.gov.v1beta2.MsgSubmitProposalResponse") + proto.RegisterType((*MsgExecLegacyContent)(nil), "cosmos.gov.v1beta2.MsgExecLegacyContent") + proto.RegisterType((*MsgExecLegacyContentResponse)(nil), "cosmos.gov.v1beta2.MsgExecLegacyContentResponse") proto.RegisterType((*MsgVote)(nil), "cosmos.gov.v1beta2.MsgVote") proto.RegisterType((*MsgVoteResponse)(nil), "cosmos.gov.v1beta2.MsgVoteResponse") proto.RegisterType((*MsgVoteWeighted)(nil), "cosmos.gov.v1beta2.MsgVoteWeighted") @@ -450,44 +553,49 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1beta2/tx.proto", fileDescriptor_4214261f6b3f9ed4) } var fileDescriptor_4214261f6b3f9ed4 = []byte{ - // 588 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcf, 0x6e, 0xd3, 0x4e, - 0x10, 0x8e, 0x9b, 0xfe, 0xfa, 0x67, 0xfa, 0x53, 0xab, 0x5a, 0x91, 0x70, 0x5c, 0xe4, 0x46, 0x46, - 0x54, 0x91, 0x50, 0xd6, 0x4d, 0x40, 0xe5, 0xc2, 0x81, 0x06, 0x0e, 0x05, 0x29, 0x02, 0x5c, 0x09, - 0x24, 0x2e, 0xc1, 0x8e, 0xb7, 0xdb, 0x15, 0x89, 0xc7, 0xf2, 0x6e, 0xa2, 0xe6, 0x2d, 0x10, 0x0f, - 0xc0, 0x89, 0x47, 0xe0, 0x15, 0x90, 0x7a, 0xac, 0x38, 0x71, 0x42, 0x28, 0xb9, 0xf2, 0x10, 0x28, - 0xf6, 0xda, 0x85, 0x26, 0x4d, 0x7a, 0xe0, 0x94, 0xcd, 0x7c, 0xdf, 0x37, 0xf3, 0xcd, 0xee, 0x78, - 0x60, 0xa7, 0x83, 0xa2, 0x87, 0xc2, 0x61, 0x38, 0x70, 0x06, 0x75, 0x9f, 0x4a, 0xaf, 0xe1, 0xc8, - 0x33, 0x12, 0xc5, 0x28, 0x51, 0xd7, 0x53, 0x90, 0x30, 0x1c, 0x10, 0x05, 0x9a, 0x96, 0x12, 0xf8, - 0x9e, 0xa0, 0x4a, 0x51, 0x77, 0x3a, 0xc8, 0xc3, 0x54, 0x63, 0xde, 0x9e, 0x91, 0x70, 0xa2, 0x4f, - 0xd1, 0x12, 0x43, 0x86, 0xc9, 0xd1, 0x99, 0x9c, 0x54, 0xb4, 0x9c, 0x6a, 0xda, 0x29, 0xa0, 0x8a, - 0x2a, 0x88, 0x21, 0xb2, 0x2e, 0x75, 0x92, 0x7f, 0x7e, 0xff, 0xc4, 0xf1, 0xc2, 0x61, 0x0a, 0xd9, - 0x5f, 0x35, 0xd8, 0x6e, 0x09, 0x76, 0xdc, 0xf7, 0x7b, 0x5c, 0xbe, 0x8c, 0x31, 0x42, 0xe1, 0x75, - 0xf5, 0x7d, 0x58, 0xeb, 0x51, 0x21, 0x3c, 0x46, 0x85, 0xa1, 0x55, 0x8a, 0xd5, 0x8d, 0x46, 0x89, - 0xa4, 0x39, 0x48, 0x96, 0x83, 0x1c, 0x86, 0x43, 0x37, 0x67, 0xe9, 0x47, 0xb0, 0xc5, 0x43, 0x2e, - 0xb9, 0xd7, 0x6d, 0x07, 0x34, 0x42, 0xc1, 0xa5, 0xb1, 0x94, 0x08, 0xcb, 0x44, 0x59, 0x99, 0xf4, - 0xaa, 0x2e, 0xa0, 0x4e, 0x9e, 0x20, 0x0f, 0x9b, 0xcb, 0xe7, 0x3f, 0x76, 0x0b, 0xee, 0xa6, 0xd2, - 0x3d, 0x4d, 0x65, 0xfa, 0x03, 0x58, 0x8b, 0x12, 0x1f, 0x34, 0x36, 0x8a, 0x15, 0xad, 0xba, 0xde, - 0x34, 0xbe, 0x7d, 0xa9, 0x95, 0x54, 0x96, 0xc3, 0x20, 0x88, 0xa9, 0x10, 0xc7, 0x32, 0xe6, 0x21, - 0x73, 0x73, 0xa6, 0xfd, 0x08, 0xca, 0x53, 0x6d, 0xb8, 0x54, 0x44, 0x18, 0x0a, 0xaa, 0xef, 0xc2, - 0x46, 0xa4, 0x62, 0x6d, 0x1e, 0x18, 0x5a, 0x45, 0xab, 0x2e, 0xbb, 0x90, 0x85, 0x9e, 0x05, 0xf6, - 0x47, 0x0d, 0x56, 0x5b, 0x82, 0xbd, 0x46, 0xb9, 0x98, 0xac, 0x13, 0xf8, 0x6f, 0x80, 0x92, 0xc6, - 0xc6, 0xd2, 0x02, 0x77, 0x29, 0x4d, 0x3f, 0x80, 0x15, 0x8c, 0x24, 0xc7, 0x30, 0x69, 0x67, 0xb3, - 0x61, 0x91, 0xe9, 0x89, 0x20, 0x93, 0xd2, 0x2f, 0x12, 0x96, 0xab, 0xd8, 0xf6, 0x36, 0x6c, 0x29, - 0x4f, 0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4f, 0xed, 0x38, 0xf5, 0x53, 0x13, 0xc1, 0x7b, 0xe7, - 0x2c, 0xd9, 0x98, 0x72, 0x18, 0x51, 0x91, 0xed, 0x4d, 0x7f, 0x25, 0xd9, 0x58, 0xf7, 0x7f, 0x07, - 0x00, 0x00, 0xff, 0xff, 0x86, 0xf2, 0x34, 0xac, 0xa5, 0x05, 0x00, 0x00, + // 667 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xdd, 0x4e, 0x13, 0x41, + 0x14, 0xee, 0x52, 0xa4, 0x70, 0x30, 0x10, 0x26, 0x4d, 0xdc, 0x2e, 0x64, 0x21, 0x6b, 0x24, 0x4d, + 0x4c, 0x77, 0xa1, 0x1a, 0xbc, 0xd0, 0x44, 0x29, 0x9a, 0xa0, 0xb1, 0x51, 0x97, 0x44, 0x13, 0x6f, + 0x70, 0xdb, 0x1d, 0x86, 0x89, 0x74, 0xcf, 0xba, 0x33, 0x6d, 0xe8, 0x5b, 0x18, 0x1f, 0xc0, 0x2b, + 0x1f, 0x81, 0x57, 0x30, 0x21, 0x5e, 0x11, 0xaf, 0xbc, 0xd1, 0x18, 0x78, 0x11, 0xd3, 0xdd, 0xd9, + 0x45, 0xe9, 0xef, 0x85, 0x57, 0x9d, 0x9e, 0xef, 0xfb, 0xce, 0xf9, 0xce, 0xf4, 0x9c, 0x0e, 0x2c, + 0x37, 0x51, 0xb4, 0x50, 0x38, 0x0c, 0x3b, 0x4e, 0x67, 0xb3, 0x41, 0xa5, 0x57, 0x75, 0xe4, 0xb1, + 0x1d, 0x46, 0x28, 0x91, 0x90, 0x04, 0xb4, 0x19, 0x76, 0x6c, 0x05, 0x1a, 0xa6, 0x12, 0x34, 0x3c, + 0x41, 0x95, 0x62, 0xd3, 0x69, 0x22, 0x0f, 0x12, 0x8d, 0xb1, 0x32, 0x20, 0x61, 0x4f, 0x9f, 0xa0, + 0x45, 0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 0xa9, 0xed, + 0xea, 0xcf, 0x3c, 0xe4, 0xeb, 0x82, 0x91, 0x03, 0x58, 0xb8, 0xb2, 0xde, 0xb7, 0x06, 0x5d, 0x4e, + 0xdf, 0xfa, 0x18, 0x95, 0x89, 0x68, 0xd9, 0xc4, 0x22, 0x2c, 0xf5, 0x6f, 0x50, 0x79, 0x48, 0x8e, + 0x3e, 0xa6, 0xb1, 0x31, 0x29, 0x33, 0x2b, 0xb8, 0x0b, 0xd3, 0xf1, 0xf4, 0x2f, 0x0f, 0x51, 0xf6, + 0x40, 0xe3, 0xe6, 0x08, 0x30, 0xcb, 0xf4, 0x0e, 0xae, 0xff, 0x33, 0x9f, 0xa3, 0x44, 0x29, 0xc9, + 0xb8, 0x3d, 0x01, 0x29, 0xab, 0xf0, 0x0a, 0x0a, 0xe9, 0xfc, 0x98, 0x43, 0x74, 0x0a, 0x37, 0xd6, + 0x47, 0xe3, 0x69, 0xca, 0xda, 0xb3, 0xd3, 0x73, 0x53, 0x3b, 0x3b, 0x37, 0xb5, 0xdf, 0xe7, 0xa6, + 0xf6, 0xf1, 0xc2, 0xcc, 0x9d, 0x5d, 0x98, 0xb9, 0x1f, 0x17, 0x66, 0xee, 0xed, 0x06, 0xe3, 0xf2, + 0xb0, 0xdd, 0xb0, 0x9b, 0xd8, 0x52, 0x0f, 0x81, 0xfa, 0xa8, 0x08, 0xff, 0xbd, 0x73, 0x1c, 0x3f, + 0x2b, 0xb2, 0x1b, 0x52, 0x91, 0x3e, 0x2e, 0x8d, 0x99, 0xf8, 0xff, 0xec, 0xce, 0x9f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x10, 0x5f, 0xaf, 0xf2, 0xca, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -504,6 +612,9 @@ const _ = grpc.SupportPackageIsVersion4 type MsgClient interface { // SubmitProposal defines a method to create new proposal given a content. SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) + // ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal + // to execute a legacy content-based proposal. + ExecLegacyContent(ctx context.Context, in *MsgExecLegacyContent, opts ...grpc.CallOption) (*MsgExecLegacyContentResponse, error) // Vote defines a method to add a vote on a specific proposal. Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) // VoteWeighted defines a method to add a weighted vote on a specific proposal. @@ -531,6 +642,15 @@ func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, o return out, nil } +func (c *msgClient) ExecLegacyContent(ctx context.Context, in *MsgExecLegacyContent, opts ...grpc.CallOption) (*MsgExecLegacyContentResponse, error) { + out := new(MsgExecLegacyContentResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Msg/ExecLegacyContent", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) { out := new(MsgVoteResponse) err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Msg/Vote", in, out, opts...) @@ -562,6 +682,9 @@ func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.Ca type MsgServer interface { // SubmitProposal defines a method to create new proposal given a content. SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) + // ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal + // to execute a legacy content-based proposal. + ExecLegacyContent(context.Context, *MsgExecLegacyContent) (*MsgExecLegacyContentResponse, error) // Vote defines a method to add a vote on a specific proposal. Vote(context.Context, *MsgVote) (*MsgVoteResponse, error) // VoteWeighted defines a method to add a weighted vote on a specific proposal. @@ -579,6 +702,9 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) SubmitProposal(ctx context.Context, req *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitProposal not implemented") } +func (*UnimplementedMsgServer) ExecLegacyContent(ctx context.Context, req *MsgExecLegacyContent) (*MsgExecLegacyContentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExecLegacyContent not implemented") +} func (*UnimplementedMsgServer) Vote(ctx context.Context, req *MsgVote) (*MsgVoteResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Vote not implemented") } @@ -611,6 +737,24 @@ func _Msg_SubmitProposal_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _Msg_ExecLegacyContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgExecLegacyContent) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ExecLegacyContent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta2.Msg/ExecLegacyContent", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ExecLegacyContent(ctx, req.(*MsgExecLegacyContent)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgVote) if err := dec(in); err != nil { @@ -673,6 +817,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "SubmitProposal", Handler: _Msg_SubmitProposal_Handler, }, + { + MethodName: "ExecLegacyContent", + Handler: _Msg_ExecLegacyContent_Handler, + }, { MethodName: "Vote", Handler: _Msg_Vote_Handler, @@ -776,6 +924,76 @@ func (m *MsgSubmitProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } +func (m *MsgExecLegacyContent) 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 *MsgExecLegacyContent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExecLegacyContent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0x12 + } + if m.Content != nil { + { + size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgExecLegacyContentResponse) 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 *MsgExecLegacyContentResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExecLegacyContentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *MsgVote) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1031,6 +1249,35 @@ func (m *MsgSubmitProposalResponse) Size() (n int) { return n } +func (m *MsgExecLegacyContent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Content != nil { + l = m.Content.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgExecLegacyContentResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovTx(uint64(m.ProposalId)) + } + return n +} + func (m *MsgVote) Size() (n int) { if m == nil { return 0 @@ -1346,6 +1593,193 @@ func (m *MsgSubmitProposalResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgExecLegacyContent) 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 ErrIntOverflowTx + } + 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: MsgExecLegacyContent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExecLegacyContent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Content == nil { + m.Content = &types.Any{} + } + if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgExecLegacyContentResponse) 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 ErrIntOverflowTx + } + 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: MsgExecLegacyContentResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExecLegacyContentResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgVote) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 From c84a25da6e46344e287f2a3a8ec7312654337e8d Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Thu, 13 Jan 2022 20:22:14 +0100 Subject: [PATCH 17/39] Switch some more CLI to v1beta2 --- x/gov/client/cli/tx.go | 11 +-- x/gov/client/testutil/deposits.go | 25 +++---- x/gov/client/testutil/grpc.go | 108 +++++++++++++++--------------- x/gov/client/testutil/suite.go | 6 +- x/gov/client/utils/query.go | 82 +++++++++++++++++++++-- x/gov/keeper/grpc_query_test.go | 4 -- 6 files changed, 154 insertions(+), 82 deletions(-) diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index aab48b336198..304d18b5466a 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -15,6 +15,7 @@ import ( govutils "github.com/cosmos/cosmos-sdk/x/gov/client/utils" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) // Proposal flags @@ -177,7 +178,7 @@ $ %s tx gov deposit 1 10stake --from mykey return err } - msg := v1beta1.NewMsgDeposit(from, proposalID, amount) + msg := v1beta2.NewMsgDeposit(from, proposalID, amount) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, @@ -219,13 +220,13 @@ $ %s tx gov vote 1 yes --from mykey } // Find out which vote option user chose - byteVoteOption, err := v1beta1.VoteOptionFromString(govutils.NormalizeVoteOption(args[1])) + byteVoteOption, err := v1beta2.VoteOptionFromString(govutils.NormalizeVoteOption(args[1])) if err != nil { return err } // Build vote message and run basic validation - msg := v1beta1.NewMsgVote(from, proposalID, byteVoteOption) + msg := v1beta2.NewMsgVote(from, proposalID, byteVoteOption) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, @@ -268,13 +269,13 @@ $ %s tx gov weighted-vote 1 yes=0.6,no=0.3,abstain=0.05,no_with_veto=0.05 --from } // Figure out which vote options user chose - options, err := v1beta1.WeightedVoteOptionsFromString(govutils.NormalizeWeightedVoteOptions(args[1])) + options, err := v1beta2.WeightedVoteOptionsFromString(govutils.NormalizeWeightedVoteOptions(args[1])) if err != nil { return err } // Build vote message and run basic validation - msg := v1beta1.NewMsgVoteWeighted(from, proposalID, options) + msg := v1beta2.NewMsgVoteWeighted(from, proposalID, options) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } diff --git a/x/gov/client/testutil/deposits.go b/x/gov/client/testutil/deposits.go index 7cd765e7e748..d45aa13f3c76 100644 --- a/x/gov/client/testutil/deposits.go +++ b/x/gov/client/testutil/deposits.go @@ -12,6 +12,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/client/cli" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) type DepositTestSuite struct { @@ -41,7 +42,7 @@ func (s *DepositTestSuite) SetupSuite() { deposits := sdk.Coins{ sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(0)), - sdk.NewCoin(s.cfg.BondDenom, v1beta1.DefaultMinDepositTokens.Sub(sdk.NewInt(50))), + sdk.NewCoin(s.cfg.BondDenom, v1beta2.DefaultMinDepositTokens.Sub(sdk.NewInt(50))), } s.deposits = deposits @@ -98,7 +99,7 @@ func (s *DepositTestSuite) TestQueryDepositsWithoutInitialDeposit() { proposalID := s.proposalIDs[0] // deposit amount - depositAmount := sdk.NewCoin(s.cfg.BondDenom, v1beta1.DefaultMinDepositTokens.Add(sdk.NewInt(50))).String() + depositAmount := sdk.NewCoin(s.cfg.BondDenom, v1beta2.DefaultMinDepositTokens.Add(sdk.NewInt(50))).String() _, err := MsgDeposit(clientCtx, val.Address.String(), proposalID, depositAmount) s.Require().NoError(err) @@ -109,14 +110,14 @@ func (s *DepositTestSuite) TestQueryDepositsWithoutInitialDeposit() { // query deposit deposit := s.queryDeposit(val, proposalID, false, "") s.Require().NotNil(deposit) - s.Require().Equal(deposit.Amount.String(), depositAmount) + s.Require().Equal(sdk.Coins(deposit.Amount).String(), depositAmount) // query deposits deposits := s.queryDeposits(val, proposalID, false, "") s.Require().NotNil(deposits) s.Require().Len(deposits.Deposits, 1) // verify initial deposit - s.Require().Equal(deposits.Deposits[0].Amount.String(), depositAmount) + s.Require().Equal(sdk.Coins(deposits.Deposits[0].Amount).String(), depositAmount) } func (s *DepositTestSuite) TestQueryProposalNotEnoughDeposits() { @@ -146,14 +147,14 @@ func (s *DepositTestSuite) TestRejectedProposalDeposits() { val := s.network.Validators[0] clientCtx := val.ClientCtx - initialDeposit := sdk.NewCoin(s.cfg.BondDenom, v1beta1.DefaultMinDepositTokens) + initialDeposit := sdk.NewCoin(s.cfg.BondDenom, v1beta2.DefaultMinDepositTokens) id := 1 proposalID := fmt.Sprintf("%d", id) s.createProposal(val, initialDeposit, id) // query deposits - var deposits v1beta1.QueryDepositsResponse + var deposits v1beta2.QueryDepositsResponse args := []string{proposalID, fmt.Sprintf("--%s=json", tmcli.OutputFlag)} cmd := cli.GetCmdQueryDeposits() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) @@ -161,7 +162,7 @@ func (s *DepositTestSuite) TestRejectedProposalDeposits() { s.Require().NoError(val.ClientCtx.LegacyAmino.UnmarshalJSON(out.Bytes(), &deposits)) s.Require().Equal(len(deposits.Deposits), 1) // verify initial deposit - s.Require().Equal(deposits.Deposits[0].Amount.String(), initialDeposit.String()) + s.Require().Equal(sdk.Coins(deposits.Deposits[0].Amount).String(), initialDeposit.String()) // vote _, err = MsgVote(clientCtx, val.Address.String(), proposalID, "no") @@ -180,12 +181,12 @@ func (s *DepositTestSuite) TestRejectedProposalDeposits() { s.Require().NotNil(depositsRes) s.Require().Len(depositsRes.Deposits, 1) // verify initial deposit - s.Require().Equal(depositsRes.Deposits[0].Amount.String(), initialDeposit.String()) + s.Require().Equal(sdk.Coins(depositsRes.Deposits[0].Amount).String(), initialDeposit.String()) } -func (s *DepositTestSuite) queryDeposits(val *network.Validator, proposalID string, exceptErr bool, message string) *v1beta1.QueryDepositsResponse { +func (s *DepositTestSuite) queryDeposits(val *network.Validator, proposalID string, exceptErr bool, message string) *v1beta2.QueryDepositsResponse { args := []string{proposalID, fmt.Sprintf("--%s=json", tmcli.OutputFlag)} - var depositsRes *v1beta1.QueryDepositsResponse + var depositsRes *v1beta2.QueryDepositsResponse cmd := cli.GetCmdQueryDeposits() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) @@ -200,9 +201,9 @@ func (s *DepositTestSuite) queryDeposits(val *network.Validator, proposalID stri return depositsRes } -func (s *DepositTestSuite) queryDeposit(val *network.Validator, proposalID string, exceptErr bool, message string) *v1beta1.Deposit { +func (s *DepositTestSuite) queryDeposit(val *network.Validator, proposalID string, exceptErr bool, message string) *v1beta2.Deposit { args := []string{proposalID, val.Address.String(), fmt.Sprintf("--%s=json", tmcli.OutputFlag)} - var depositRes *v1beta1.Deposit + var depositRes *v1beta2.Deposit cmd := cli.GetCmdQueryDeposit() out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) if exceptErr { diff --git a/x/gov/client/testutil/grpc.go b/x/gov/client/testutil/grpc.go index 83cb2828b6c7..6e71b5df0340 100644 --- a/x/gov/client/testutil/grpc.go +++ b/x/gov/client/testutil/grpc.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/rest" sdk "github.com/cosmos/cosmos-sdk/types" grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) func (s *IntegrationTestSuite) TestGetProposalGRPC() { @@ -22,17 +22,17 @@ func (s *IntegrationTestSuite) TestGetProposalGRPC() { }{ { "empty proposal", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s", val.APIAddress, ""), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s", val.APIAddress, ""), true, }, { "get non existing proposal", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s", val.APIAddress, "10"), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s", val.APIAddress, "10"), true, }, { "get proposal with id", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s", val.APIAddress, "1"), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s", val.APIAddress, "1"), false, }, } @@ -43,7 +43,7 @@ func (s *IntegrationTestSuite) TestGetProposalGRPC() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) - var proposal v1beta1.QueryProposalResponse + var proposal v1beta2.QueryProposalResponse err = val.ClientCtx.Codec.UnmarshalJSON(resp, &proposal) if tc.expErr { @@ -68,7 +68,7 @@ func (s *IntegrationTestSuite) TestGetProposalsGRPC() { }{ { "get proposals with height 1", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals", val.APIAddress), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals", val.APIAddress), map[string]string{ grpctypes.GRPCBlockHeightHeader: "1", }, @@ -77,14 +77,14 @@ func (s *IntegrationTestSuite) TestGetProposalsGRPC() { }, { "valid request", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals", val.APIAddress), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals", val.APIAddress), map[string]string{}, 3, false, }, { "valid request with filter by status", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals?proposal_status=1", val.APIAddress), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals?proposal_status=1", val.APIAddress), map[string]string{}, 1, false, @@ -97,7 +97,7 @@ func (s *IntegrationTestSuite) TestGetProposalsGRPC() { resp, err := testutil.GetRequestWithHeaders(tc.url, tc.headers) s.Require().NoError(err) - var proposals v1beta1.QueryProposalsResponse + var proposals v1beta2.QueryProposalsResponse err = val.ClientCtx.Codec.UnmarshalJSON(resp, &proposals) if tc.expErr { @@ -119,41 +119,41 @@ func (s *IntegrationTestSuite) TestGetProposalVoteGRPC() { name string url string expErr bool - expVoteOptions v1beta1.WeightedVoteOptions + expVoteOptions v1beta2.WeightedVoteOptions }{ { "empty proposal", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/votes/%s", val.APIAddress, "", voterAddressBech32), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/votes/%s", val.APIAddress, "", voterAddressBech32), true, - v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes), + v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), }, { "get non existing proposal", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/votes/%s", val.APIAddress, "10", voterAddressBech32), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/votes/%s", val.APIAddress, "10", voterAddressBech32), true, - v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes), + v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), }, { "get proposal with wrong voter address", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/votes/%s", val.APIAddress, "1", "wrongVoterAddress"), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/votes/%s", val.APIAddress, "1", "wrongVoterAddress"), true, - v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes), + v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), }, { "get proposal with id", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/votes/%s", val.APIAddress, "1", voterAddressBech32), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/votes/%s", val.APIAddress, "1", voterAddressBech32), false, - v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes), + v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), }, { "get proposal with id for split vote", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/votes/%s", val.APIAddress, "3", voterAddressBech32), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/votes/%s", val.APIAddress, "3", voterAddressBech32), false, - v1beta1.WeightedVoteOptions{ - v1beta1.WeightedVoteOption{Option: v1beta1.OptionYes, Weight: sdk.NewDecWithPrec(60, 2)}, - v1beta1.WeightedVoteOption{Option: v1beta1.OptionNo, Weight: sdk.NewDecWithPrec(30, 2)}, - v1beta1.WeightedVoteOption{Option: v1beta1.OptionAbstain, Weight: sdk.NewDecWithPrec(5, 2)}, - v1beta1.WeightedVoteOption{Option: v1beta1.OptionNoWithVeto, Weight: sdk.NewDecWithPrec(5, 2)}, + v1beta2.WeightedVoteOptions{ + &v1beta2.WeightedVoteOption{Option: v1beta2.OptionYes, Weight: sdk.NewDecWithPrec(60, 2).String()}, + &v1beta2.WeightedVoteOption{Option: v1beta2.OptionNo, Weight: sdk.NewDecWithPrec(30, 2).String()}, + &v1beta2.WeightedVoteOption{Option: v1beta2.OptionAbstain, Weight: sdk.NewDecWithPrec(5, 2).String()}, + &v1beta2.WeightedVoteOption{Option: v1beta2.OptionNoWithVeto, Weight: sdk.NewDecWithPrec(5, 2).String()}, }, }, } @@ -164,7 +164,7 @@ func (s *IntegrationTestSuite) TestGetProposalVoteGRPC() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) - var vote v1beta1.QueryVoteResponse + var vote v1beta2.QueryVoteResponse err = val.ClientCtx.Codec.UnmarshalJSON(resp, &vote) if tc.expErr { @@ -175,7 +175,7 @@ func (s *IntegrationTestSuite) TestGetProposalVoteGRPC() { s.Require().Equal(len(vote.Vote.Options), len(tc.expVoteOptions)) for i, option := range tc.expVoteOptions { s.Require().Equal(option.Option, vote.Vote.Options[i].Option) - s.Require().True(option.Weight.Equal(vote.Vote.Options[i].Weight)) + s.Require().Equal(option.Weight, vote.Vote.Options[i].Weight) } } }) @@ -192,12 +192,12 @@ func (s *IntegrationTestSuite) TestGetProposalVotesGRPC() { }{ { "votes with empty proposal id", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/votes", val.APIAddress, ""), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/votes", val.APIAddress, ""), true, }, { "get votes with valid id", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/votes", val.APIAddress, "1"), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/votes", val.APIAddress, "1"), false, }, } @@ -208,7 +208,7 @@ func (s *IntegrationTestSuite) TestGetProposalVotesGRPC() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) - var votes v1beta1.QueryVotesResponse + var votes v1beta2.QueryVotesResponse err = val.ClientCtx.Codec.UnmarshalJSON(resp, &votes) if tc.expErr { @@ -231,22 +231,22 @@ func (s *IntegrationTestSuite) TestGetProposalDepositGRPC() { }{ { "get deposit with empty proposal id", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/deposits/%s", val.APIAddress, "", val.Address.String()), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/deposits/%s", val.APIAddress, "", val.Address.String()), true, }, { "get deposit of non existing proposal", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/deposits/%s", val.APIAddress, "10", val.Address.String()), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/deposits/%s", val.APIAddress, "10", val.Address.String()), true, }, { "get deposit with wrong depositer address", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/deposits/%s", val.APIAddress, "1", "wrongDepositerAddress"), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/deposits/%s", val.APIAddress, "1", "wrongDepositerAddress"), true, }, { "get deposit valid request", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/deposits/%s", val.APIAddress, "1", val.Address.String()), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/deposits/%s", val.APIAddress, "1", val.Address.String()), false, }, } @@ -257,7 +257,7 @@ func (s *IntegrationTestSuite) TestGetProposalDepositGRPC() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) - var deposit v1beta1.QueryDepositResponse + var deposit v1beta2.QueryDepositResponse err = val.ClientCtx.Codec.UnmarshalJSON(resp, &deposit) if tc.expErr { @@ -280,12 +280,12 @@ func (s *IntegrationTestSuite) TestGetProposalDepositsGRPC() { }{ { "get deposits with empty proposal id", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/deposits", val.APIAddress, ""), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/deposits", val.APIAddress, ""), true, }, { "valid request", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/deposits", val.APIAddress, "1"), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/deposits", val.APIAddress, "1"), false, }, } @@ -296,7 +296,7 @@ func (s *IntegrationTestSuite) TestGetProposalDepositsGRPC() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) - var deposits v1beta1.QueryDepositsResponse + var deposits v1beta2.QueryDepositsResponse err = val.ClientCtx.Codec.UnmarshalJSON(resp, &deposits) if tc.expErr { @@ -320,17 +320,17 @@ func (s *IntegrationTestSuite) TestGetTallyGRPC() { }{ { "get tally with no proposal id", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/tally", val.APIAddress, ""), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/tally", val.APIAddress, ""), true, }, { "get tally with non existing proposal", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/tally", val.APIAddress, "10"), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/tally", val.APIAddress, "10"), true, }, { "get tally valid request", - fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%s/tally", val.APIAddress, "1"), + fmt.Sprintf("%s/cosmos/gov/v1beta2/proposals/%s/tally", val.APIAddress, "1"), false, }, } @@ -341,7 +341,7 @@ func (s *IntegrationTestSuite) TestGetTallyGRPC() { resp, err := rest.GetRequest(tc.url) s.Require().NoError(err) - var tally v1beta1.QueryTallyResultResponse + var tally v1beta2.QueryTallyResultResponse err = val.ClientCtx.Codec.UnmarshalJSON(resp, &tally) if tc.expErr { @@ -366,34 +366,34 @@ func (s *IntegrationTestSuite) TestGetParamsGRPC() { }{ { "request params with empty params type", - fmt.Sprintf("%s/cosmos/gov/v1beta1/params/%s", val.APIAddress, ""), + fmt.Sprintf("%s/cosmos/gov/v1beta2/params/%s", val.APIAddress, ""), true, nil, nil, }, { "get deposit params", - fmt.Sprintf("%s/cosmos/gov/v1beta1/params/%s", val.APIAddress, v1beta1.ParamDeposit), + fmt.Sprintf("%s/cosmos/gov/v1beta2/params/%s", val.APIAddress, v1beta2.ParamDeposit), false, - &v1beta1.QueryParamsResponse{}, - &v1beta1.QueryParamsResponse{ - DepositParams: v1beta1.DefaultDepositParams(), + &v1beta2.QueryParamsResponse{}, + &v1beta2.QueryParamsResponse{ + DepositParams: v1beta2.DefaultDepositParams(), }, }, { "get vote params", - fmt.Sprintf("%s/cosmos/gov/v1beta1/params/%s", val.APIAddress, v1beta1.ParamVoting), + fmt.Sprintf("%s/cosmos/gov/v1beta2/params/%s", val.APIAddress, v1beta2.ParamVoting), false, - &v1beta1.QueryParamsResponse{}, - &v1beta1.QueryParamsResponse{ - VotingParams: v1beta1.DefaultVotingParams(), + &v1beta2.QueryParamsResponse{}, + &v1beta2.QueryParamsResponse{ + VotingParams: v1beta2.DefaultVotingParams(), }, }, { "get tally params", - fmt.Sprintf("%s/cosmos/gov/v1beta1/params/%s", val.APIAddress, v1beta1.ParamTallying), + fmt.Sprintf("%s/cosmos/gov/v1beta2/params/%s", val.APIAddress, v1beta2.ParamTallying), false, - &v1beta1.QueryParamsResponse{}, - &v1beta1.QueryParamsResponse{ - TallyParams: v1beta1.DefaultTallyParams(), + &v1beta2.QueryParamsResponse{}, + &v1beta2.QueryParamsResponse{ + TallyParams: v1beta2.DefaultTallyParams(), }, }, } diff --git a/x/gov/client/testutil/suite.go b/x/gov/client/testutil/suite.go index 96c358929969..420c7125c0ec 100644 --- a/x/gov/client/testutil/suite.go +++ b/x/gov/client/testutil/suite.go @@ -410,7 +410,7 @@ func (s *IntegrationTestSuite) TestCmdGetProposal() { s.Require().NoError(err) var proposal v1beta2.Proposal s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &proposal), out.String()) - s.Require().Equal(title, proposal.Messages[0].GetCachedValue().(*v1beta2.MsgContent).Content.GetCachedValue().(v1beta1.Content).GetTitle()) + s.Require().Equal(title, proposal.Messages[0].GetCachedValue().(*v1beta2.MsgExecLegacyContent).Content.GetCachedValue().(v1beta1.Content).GetTitle()) } }) } @@ -760,12 +760,12 @@ func (s *IntegrationTestSuite) TestCmdQueryVote() { } else { s.Require().NoError(err) - var vote v1beta1.Vote + var vote v1beta2.Vote s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &vote), out.String()) s.Require().Equal(len(vote.Options), len(tc.expVoteOptions)) for i, option := range tc.expVoteOptions { s.Require().Equal(option.Option, vote.Options[i].Option) - s.Require().Equal(option.Weight, (vote.Options[i].Weight).String()) + s.Require().Equal(option.Weight, vote.Options[i].Weight) } } }) diff --git a/x/gov/client/utils/query.go b/x/gov/client/utils/query.go index 61cbb306d9a4..29cf0fb2f77d 100644 --- a/x/gov/client/utils/query.go +++ b/x/gov/client/utils/query.go @@ -76,6 +76,14 @@ func QueryDepositsByTxQuery(clientCtx client.Context, params v1beta2.QueryPropos for _, info := range searchResult.Txs { for _, msg := range info.GetTx().GetMsgs() { + if depMsg, ok := msg.(*v1beta1.MsgDeposit); ok { + deposits = append(deposits, v1beta2.Deposit{ + Depositor: depMsg.Depositor, + ProposalId: params.ProposalID, + Amount: depMsg.Amount, + }) + } + if depMsg, ok := msg.(*v1beta2.MsgDeposit); ok { deposits = append(deposits, v1beta2.Deposit{ Depositor: depMsg.Depositor, @@ -99,7 +107,7 @@ func QueryDepositsByTxQuery(clientCtx client.Context, params v1beta2.QueryPropos // marshalled result or any error that occurred. func QueryVotesByTxQuery(clientCtx client.Context, params v1beta2.QueryProposalVotesParams) ([]byte, error) { var ( - votes []v1beta2.Vote + votes []*v1beta2.Vote nextTxPage = defaultPage totalLimit = params.Limit * params.Page ) @@ -146,16 +154,28 @@ func QueryVotesByTxQuery(clientCtx client.Context, params v1beta2.QueryProposalV for _, info := range searchResult.Txs { for _, msg := range info.GetTx().GetMsgs() { + if voteMsg, ok := msg.(*v1beta1.MsgVote); ok { + votes = append(votes, &v1beta2.Vote{ + Voter: voteMsg.Voter, + ProposalId: params.ProposalID, + Options: v1beta2.NewNonSplitVoteOption(v1beta2.VoteOption(voteMsg.Option)), + }) + } + if voteMsg, ok := msg.(*v1beta2.MsgVote); ok { - votes = append(votes, v1beta2.Vote{ + votes = append(votes, &v1beta2.Vote{ Voter: voteMsg.Voter, ProposalId: params.ProposalID, Options: v1beta2.NewNonSplitVoteOption(voteMsg.Option), }) } + if voteWeightedMsg, ok := msg.(*v1beta1.MsgVoteWeighted); ok { + votes = append(votes, convertVote(voteWeightedMsg)) + } + if voteWeightedMsg, ok := msg.(*v1beta2.MsgVoteWeighted); ok { - votes = append(votes, v1beta2.Vote{ + votes = append(votes, &v1beta2.Vote{ Voter: voteWeightedMsg.Voter, ProposalId: params.ProposalID, Options: voteWeightedMsg.Options, @@ -171,7 +191,7 @@ func QueryVotesByTxQuery(clientCtx client.Context, params v1beta2.QueryProposalV } start, end := client.Paginate(len(votes), params.Page, params.Limit, 100) if start < 0 || end < 0 { - votes = []v1beta2.Vote{} + votes = []*v1beta2.Vote{} } else { votes = votes[start:end] } @@ -233,6 +253,14 @@ func QueryVoteByTxQuery(clientCtx client.Context, params v1beta2.QueryVoteParams for _, msg := range info.GetTx().GetMsgs() { // there should only be a single vote under the given conditions var vote *v1beta2.Vote + if voteMsg, ok := msg.(*v1beta1.MsgVote); ok { + vote = &v1beta2.Vote{ + Voter: voteMsg.Voter, + ProposalId: params.ProposalID, + Options: v1beta2.NewNonSplitVoteOption(v1beta2.VoteOption(voteMsg.Option)), + } + } + if voteMsg, ok := msg.(*v1beta2.MsgVote); ok { vote = &v1beta2.Vote{ Voter: voteMsg.Voter, @@ -241,6 +269,10 @@ func QueryVoteByTxQuery(clientCtx client.Context, params v1beta2.QueryVoteParams } } + if voteWeightedMsg, ok := msg.(*v1beta1.MsgVoteWeighted); ok { + vote = convertVote(voteWeightedMsg) + } + if voteWeightedMsg, ok := msg.(*v1beta2.MsgVoteWeighted); ok { vote = &v1beta2.Vote{ Voter: voteWeightedMsg.Voter, @@ -310,6 +342,21 @@ func QueryDepositByTxQuery(clientCtx client.Context, params v1beta2.QueryDeposit for _, info := range searchResult.Txs { for _, msg := range info.GetTx().GetMsgs() { // there should only be a single deposit under the given conditions + if depMsg, ok := msg.(*v1beta1.MsgDeposit); ok { + deposit := v1beta2.Deposit{ + Depositor: depMsg.Depositor, + ProposalId: params.ProposalID, + Amount: depMsg.Amount, + } + + bz, err := clientCtx.Codec.MarshalJSON(&deposit) + if err != nil { + return nil, err + } + + return bz, nil + } + if depMsg, ok := msg.(*v1beta2.MsgDeposit); ok { deposit := v1beta2.Deposit{ Depositor: depMsg.Depositor, @@ -359,6 +406,9 @@ func QueryProposerByTxQuery(clientCtx client.Context, proposalID uint64) (Propos for _, info := range searchResult.Txs { for _, msg := range info.GetTx().GetMsgs() { // there should only be a single proposal under the given conditions + if subMsg, ok := msg.(*v1beta1.MsgSubmitProposal); ok { + return NewProposer(proposalID, subMsg.Proposer), nil + } if subMsg, ok := msg.(*v1beta2.MsgSubmitProposal); ok { return NewProposer(proposalID, subMsg.Proposer), nil } @@ -435,6 +485,14 @@ func queryInitialDepositByTxQuery(clientCtx client.Context, proposalID uint64) ( for _, info := range searchResult.Txs { for _, msg := range info.GetTx().GetMsgs() { // there should only be a single proposal under the given conditions + if subMsg, ok := msg.(*v1beta1.MsgSubmitProposal); ok { + return v1beta2.Deposit{ + ProposalId: proposalID, + Depositor: subMsg.Proposer, + Amount: subMsg.InitialDeposit, + }, nil + } + if subMsg, ok := msg.(*v1beta2.MsgSubmitProposal); ok { return v1beta2.Deposit{ ProposalId: proposalID, @@ -447,3 +505,19 @@ func queryInitialDepositByTxQuery(clientCtx client.Context, proposalID uint64) ( return v1beta2.Deposit{}, sdkerrors.ErrNotFound.Wrapf("failed to find the initial deposit for proposalID %d", proposalID) } + +// convertVote converts a MsgVoteWeighted into a *v1beta2.Vote. +func convertVote(v *v1beta1.MsgVoteWeighted) *v1beta2.Vote { + opts := make([]*v1beta2.WeightedVoteOption, len(v.Options)) + for i, o := range v.Options { + opts[i] = &v1beta2.WeightedVoteOption{ + Option: v1beta2.VoteOption(o.Option), + Weight: o.Weight.String(), + } + } + return &v1beta2.Vote{ + Voter: v.Voter, + ProposalId: v.ProposalId, + Options: opts, + } +} diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 70aad16b9952..789fe7f821c6 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -459,10 +459,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { func() { req = &v1beta2.QueryParamsRequest{ParamsType: v1beta2.ParamDeposit} depositParams := v1beta2.DefaultDepositParams() - tallyParams := v1beta2.NewTallyParams(sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0)) expRes = &v1beta2.QueryParamsResponse{ DepositParams: depositParams, - TallyParams: tallyParams, } }, true, @@ -472,10 +470,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { func() { req = &v1beta2.QueryParamsRequest{ParamsType: v1beta2.ParamVoting} votingParams := v1beta2.DefaultVotingParams() - tallyParams := v1beta2.NewTallyParams(sdk.NewDec(0), sdk.NewDec(0), sdk.NewDec(0)) expRes = &v1beta2.QueryParamsResponse{ VotingParams: votingParams, - TallyParams: tallyParams, } }, true, From 35e16ec0ab0a3de04681bdf4f234463d687da62a Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Fri, 14 Jan 2022 13:03:32 +0100 Subject: [PATCH 18/39] Refactor codec stuff --- x/gov/keeper/grpc_query.go | 8 +-- x/gov/keeper/proposal_test.go | 3 +- x/gov/simulation/operations.go | 81 ++++++++++++++--------------- x/gov/simulation/operations_test.go | 53 ++++++++----------- x/gov/types/codec.go | 25 +++++++++ x/gov/types/v1beta1/codec.go | 23 ++------ x/gov/types/v1beta1/content.go | 7 --- x/gov/types/v1beta1/errors.go | 7 +-- x/gov/types/v1beta1/msgs.go | 30 +++++------ x/gov/types/v1beta1/proposal.go | 13 ++--- x/gov/types/v1beta2/codec.go | 31 ++--------- x/gov/types/v1beta2/content.go | 7 --- x/gov/types/v1beta2/msgs.go | 48 ++++++++--------- 13 files changed, 149 insertions(+), 187 deletions(-) create mode 100644 x/gov/types/codec.go diff --git a/x/gov/keeper/grpc_query.go b/x/gov/keeper/grpc_query.go index 02812a6a0c8c..05ab8c4171ab 100644 --- a/x/gov/keeper/grpc_query.go +++ b/x/gov/keeper/grpc_query.go @@ -139,13 +139,13 @@ func (q Keeper) Votes(c context.Context, req *v1beta2.QueryVotesRequest) (*v1bet votesStore := prefix.NewStore(store, types.VotesKey(req.ProposalId)) pageRes, err := query.Paginate(votesStore, req.Pagination, func(key []byte, value []byte) error { - var vote *v1beta2.Vote - if err := q.cdc.Unmarshal(value, vote); err != nil { + var vote v1beta2.Vote + if err := q.cdc.Unmarshal(value, &vote); err != nil { return err } - populateLegacyOption(vote) + populateLegacyOption(&vote) - votes = append(votes, vote) + votes = append(votes, &vote) return nil }) diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index 732a2fb60c1f..fbd72dae44f7 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -36,10 +36,9 @@ func (suite *KeeperTestSuite) TestActivateVotingPeriod() { suite.app.GovKeeper.ActivateVotingPeriod(suite.ctx, proposal) - suite.Require().True(proposal.VotingStartTime.Equal(suite.ctx.BlockHeader().Time)) - proposal, ok := suite.app.GovKeeper.GetProposal(suite.ctx, proposal.ProposalId) suite.Require().True(ok) + suite.Require().True(proposal.VotingStartTime.Equal(suite.ctx.BlockHeader().Time)) activeIterator := suite.app.GovKeeper.ActiveProposalQueueIterator(suite.ctx, *proposal.VotingEndTime) suite.Require().True(activeIterator.Valid()) diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index a506340f726b..bf72781cf646 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -13,7 +13,7 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/simulation" ) @@ -126,26 +126,21 @@ func SimulateMsgSubmitProposal( // 1) submit proposal now content := contentSim(r, ctx, accs) if content == nil { - return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgSubmitProposal, "content is nil"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, v1beta1.TypeMsgSubmitProposal, "content is nil"), nil, nil } simAccount, _ := simtypes.RandomAcc(r, accs) deposit, skip, err := randomDeposit(r, ctx, ak, bk, k, simAccount.Address) switch { case skip: - return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgSubmitProposal, "skip deposit"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, v1beta1.TypeMsgSubmitProposal, "skip deposit"), nil, nil case err != nil: - return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgSubmitProposal, "unable to generate deposit"), nil, err + return simtypes.NoOpMsg(types.ModuleName, v1beta1.TypeMsgSubmitProposal, "unable to generate deposit"), nil, err } - contentMsg, err := v1beta2.NewLegacyContent(content, k.GetGovernanceAccount(ctx).GetAddress().String()) + msg, err := v1beta1.NewMsgSubmitProposal(content, deposit, simAccount.Address) if err != nil { - return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgSubmitProposal, "unable to create a content proposal message"), nil, err - } - - msg, err := v1beta2.NewMsgSubmitProposal([]sdk.Msg{contentMsg}, deposit, simAccount.Address.String()) - if err != nil { - return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgSubmitProposal, "unable to generate a submit proposal msg"), nil, err + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate a submit proposal msg"), nil, err } account := ak.GetAccount(ctx, simAccount.Address) @@ -220,20 +215,20 @@ func SimulateMsgDeposit(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Ke accs []simtypes.Account, chainID string, ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { simAccount, _ := simtypes.RandomAcc(r, accs) - proposalID, ok := randomProposalID(r, k, ctx, v1beta2.StatusDepositPeriod) + proposalID, ok := randomProposalID(r, k, ctx, v1beta1.StatusDepositPeriod) if !ok { - return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgDeposit, "unable to generate proposalID"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, v1beta1.TypeMsgDeposit, "unable to generate proposalID"), nil, nil } deposit, skip, err := randomDeposit(r, ctx, ak, bk, k, simAccount.Address) switch { case skip: - return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgDeposit, "skip deposit"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, v1beta1.TypeMsgDeposit, "skip deposit"), nil, nil case err != nil: - return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgDeposit, "unable to generate deposit"), nil, err + return simtypes.NoOpMsg(types.ModuleName, v1beta1.TypeMsgDeposit, "unable to generate deposit"), nil, err } - msg := v1beta2.NewMsgDeposit(simAccount.Address, proposalID, deposit) + msg := v1beta1.NewMsgDeposit(simAccount.Address, proposalID, deposit) account := ak.GetAccount(ctx, simAccount.Address) spendable := bk.SpendableCoins(ctx, account.GetAddress()) @@ -283,16 +278,16 @@ func operationSimulateMsgVote(ak types.AccountKeeper, bk types.BankKeeper, k kee switch { case proposalIDInt < 0: var ok bool - proposalID, ok = randomProposalID(r, k, ctx, v1beta2.StatusVotingPeriod) + proposalID, ok = randomProposalID(r, k, ctx, v1beta1.StatusVotingPeriod) if !ok { - return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgVote, "unable to generate proposalID"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, v1beta1.TypeMsgVote, "unable to generate proposalID"), nil, nil } default: proposalID = uint64(proposalIDInt) } option := randomVotingOption(r) - msg := v1beta2.NewMsgVote(simAccount.Address, proposalID, option) + msg := v1beta1.NewMsgVote(simAccount.Address, proposalID, option) account := ak.GetAccount(ctx, simAccount.Address) spendable := bk.SpendableCoins(ctx, account.GetAddress()) @@ -336,16 +331,16 @@ func operationSimulateMsgVoteWeighted(ak types.AccountKeeper, bk types.BankKeepe switch { case proposalIDInt < 0: var ok bool - proposalID, ok = randomProposalID(r, k, ctx, v1beta2.StatusVotingPeriod) + proposalID, ok = randomProposalID(r, k, ctx, v1beta1.StatusVotingPeriod) if !ok { - return simtypes.NoOpMsg(types.ModuleName, v1beta2.TypeMsgVoteWeighted, "unable to generate proposalID"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, v1beta1.TypeMsgVoteWeighted, "unable to generate proposalID"), nil, nil } default: proposalID = uint64(proposalIDInt) } options := randomWeightedVotingOptions(r) - msg := v1beta2.NewMsgVoteWeighted(simAccount.Address, proposalID, options) + msg := v1beta1.NewMsgVoteWeighted(simAccount.Address, proposalID, options) account := ak.GetAccount(ctx, simAccount.Address) spendable := bk.SpendableCoins(ctx, account.GetAddress()) @@ -410,7 +405,7 @@ func randomDeposit(r *rand.Rand, ctx sdk.Context, // that matches a given Status. // It does not provide a default ID. func randomProposalID(r *rand.Rand, k keeper.Keeper, - ctx sdk.Context, status v1beta2.ProposalStatus) (proposalID uint64, found bool) { + ctx sdk.Context, status v1beta1.ProposalStatus) (proposalID uint64, found bool) { proposalID, _ = k.GetProposalID(ctx) switch { @@ -425,7 +420,7 @@ func randomProposalID(r *rand.Rand, k keeper.Keeper, } proposal, ok := k.GetProposal(ctx, proposalID) - if !ok || proposal.Status != status { + if !ok || v1beta1.ProposalStatus(proposal.Status) != status { return proposalID, false } @@ -433,50 +428,50 @@ func randomProposalID(r *rand.Rand, k keeper.Keeper, } // Pick a random voting option -func randomVotingOption(r *rand.Rand) v1beta2.VoteOption { +func randomVotingOption(r *rand.Rand) v1beta1.VoteOption { switch r.Intn(4) { case 0: - return v1beta2.OptionYes + return v1beta1.OptionYes case 1: - return v1beta2.OptionAbstain + return v1beta1.OptionAbstain case 2: - return v1beta2.OptionNo + return v1beta1.OptionNo case 3: - return v1beta2.OptionNoWithVeto + return v1beta1.OptionNoWithVeto default: panic("invalid vote option") } } // Pick a random weighted voting options -func randomWeightedVotingOptions(r *rand.Rand) v1beta2.WeightedVoteOptions { +func randomWeightedVotingOptions(r *rand.Rand) v1beta1.WeightedVoteOptions { w1 := r.Intn(100 + 1) w2 := r.Intn(100 - w1 + 1) w3 := r.Intn(100 - w1 - w2 + 1) w4 := 100 - w1 - w2 - w3 - weightedVoteOptions := v1beta2.WeightedVoteOptions{} + weightedVoteOptions := v1beta1.WeightedVoteOptions{} if w1 > 0 { - weightedVoteOptions = append(weightedVoteOptions, &v1beta2.WeightedVoteOption{ - Option: v1beta2.OptionYes, - Weight: sdk.NewDecWithPrec(int64(w1), 2).String(), + weightedVoteOptions = append(weightedVoteOptions, v1beta1.WeightedVoteOption{ + Option: v1beta1.OptionYes, + Weight: sdk.NewDecWithPrec(int64(w1), 2), }) } if w2 > 0 { - weightedVoteOptions = append(weightedVoteOptions, &v1beta2.WeightedVoteOption{ - Option: v1beta2.OptionAbstain, - Weight: sdk.NewDecWithPrec(int64(w2), 2).String(), + weightedVoteOptions = append(weightedVoteOptions, v1beta1.WeightedVoteOption{ + Option: v1beta1.OptionAbstain, + Weight: sdk.NewDecWithPrec(int64(w2), 2), }) } if w3 > 0 { - weightedVoteOptions = append(weightedVoteOptions, &v1beta2.WeightedVoteOption{ - Option: v1beta2.OptionNo, - Weight: sdk.NewDecWithPrec(int64(w3), 2).String(), + weightedVoteOptions = append(weightedVoteOptions, v1beta1.WeightedVoteOption{ + Option: v1beta1.OptionNo, + Weight: sdk.NewDecWithPrec(int64(w3), 2), }) } if w4 > 0 { - weightedVoteOptions = append(weightedVoteOptions, &v1beta2.WeightedVoteOption{ - Option: v1beta2.OptionNoWithVeto, - Weight: sdk.NewDecWithPrec(int64(w4), 2).String(), + weightedVoteOptions = append(weightedVoteOptions, v1beta1.WeightedVoteOption{ + Option: v1beta1.OptionNoWithVeto, + Weight: sdk.NewDecWithPrec(int64(w4), 2), }) } return weightedVoteOptions diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index 3a2d0002bb7e..43cf9963b0c6 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -81,9 +81,9 @@ func TestWeightedOperations(t *testing.T) { {0, types.ModuleName, "submit_proposal"}, {1, types.ModuleName, "submit_proposal"}, {2, types.ModuleName, "submit_proposal"}, - {simappparams.DefaultWeightMsgDeposit, types.ModuleName, v1beta2.TypeMsgDeposit}, - {simappparams.DefaultWeightMsgVote, types.ModuleName, v1beta2.TypeMsgVote}, - {simappparams.DefaultWeightMsgVoteWeighted, types.ModuleName, v1beta2.TypeMsgVoteWeighted}, + {simappparams.DefaultWeightMsgDeposit, types.ModuleName, v1beta1.TypeMsgDeposit}, + {simappparams.DefaultWeightMsgVote, types.ModuleName, v1beta1.TypeMsgVote}, + {simappparams.DefaultWeightMsgVoteWeighted, types.ModuleName, v1beta1.TypeMsgVoteWeighted}, } for i, w := range weightesOps { @@ -115,23 +115,16 @@ func TestSimulateMsgSubmitProposal(t *testing.T) { operationMsg, _, err := op(r, app.BaseApp, ctx, accounts, "") require.NoError(t, err) - var proposal v1beta2.MsgSubmitProposal - v1beta2.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &proposal) + var msg v1beta1.MsgSubmitProposal + v1beta1.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) require.True(t, operationMsg.OK) - require.Equal(t, "cosmos1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7u4x9a0", proposal.Proposer) - require.Equal(t, "2686011stake", proposal.InitialDeposit[0].String()) - msgs, err := proposal.GetMsgs() - require.NoError(t, err) - require.Len(t, msgs, 1) - contentMsg, ok := msgs[0].(*v1beta2.MsgExecLegacyContent) - require.True(t, ok) - content := v1beta2.LegacyContentFromMessage(contentMsg) - require.Equal(t, "title-3: ZBSpYuLyYggwexjxusrBqDOTtGTOWeLrQKjLxzIivHSlcxgdXhhuTSkuxKGLwQvuyNhYFmBZHeAerqyNEUzXPFGkqEGqiQWIXnku", content.GetTitle()) - require.Equal(t, "description-3: NJWzHdBNpAXKJPHWQdrGYcAHSctgVlqwqHoLfHsXUdStwfefwzqLuKEhmMyYLdbZrcPgYqjNHxPexsruwEGStAneKbWkQDDIlCWBLSiAASNhZqNFlPtfqPJoxKsgMdzjWqLWdqKQuJqWPMvwPQWZUtVMOTMYKJbfdlZsjdsomuScvDmbDkgRualsxDvRJuCAmPOXitIbcyWsKGSdrEunFAOdmXnsuyFVgJqEjbklvmwrUlsxjRSfKZxGcpayDdgoFcnVSutxjRgOSFzPwidAjubMncNweqpbxhXGchpZUxuFDOtpnhNUycJICRYqsPhPSCjPTWZFLkstHWJxvdPEAyEIxXgLwbNOjrgzmaujiBABBIXvcXpLrbcEWNNQsbjvgJFgJkflpRohHUutvnaUqoopuKjTDaemDeSdqbnOzcfJpcTuAQtZoiLZOoAIlboFDAeGmSNwkvObPRvRWQgWkGkxwtPauYgdkmypLjbqhlHJIQTntgWjXwZdOyYEdQRRLfMSdnxqppqUofqLbLQDUjwKVKfZJUJQPsWIPwIVaSTrmKskoAhvmZyJgeRpkaTfGgrJzAigcxtfshmiDCFkuiluqtMOkidknnTBtumyJYlIsWLnCQclqdVmikUoMOPdPW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sTxPjfweXhSUkMhPjMaxKlMIJMOXcnQfyzeOcbWwNbeH", content.GetDescription()) - require.Equal(t, "gov", proposal.Route()) - require.Equal(t, "gov", contentMsg.Authority) - require.Equal(t, v1beta2.TypeMsgSubmitProposal, proposal.Type()) + require.Equal(t, "cosmos1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7u4x9a0", msg.Proposer) + require.Equal(t, "2686011stake", msg.InitialDeposit.String()) + require.Equal(t, "title-3: ZBSpYuLyYggwexjxusrBqDOTtGTOWeLrQKjLxzIivHSlcxgdXhhuTSkuxKGLwQvuyNhYFmBZHeAerqyNEUzXPFGkqEGqiQWIXnku", msg.GetContent().GetTitle()) + require.Equal(t, "description-3: NJWzHdBNpAXKJPHWQdrGYcAHSctgVlqwqHoLfHsXUdStwfefwzqLuKEhmMyYLdbZrcPgYqjNHxPexsruwEGStAneKbWkQDDIlCWBLSiAASNhZqNFlPtfqPJoxKsgMdzjWqLWdqKQuJqWPMvwPQWZUtVMOTMYKJbfdlZsjdsomuScvDmbDkgRualsxDvRJuCAmPOXitIbcyWsKGSdrEunFAOdmXnsuyFVgJqEjbklvmwrUlsxjRSfKZxGcpayDdgoFcnVSutxjRgOSFzPwidAjubMncNweqpbxhXGchpZUxuFDOtpnhNUycJICRYqsPhPSCjPTWZFLkstHWJxvdPEAyEIxXgLwbNOjrgzmaujiBABBIXvcXpLrbcEWNNQsbjvgJFgJkflpRohHUutvnaUqoopuKjTDaemDeSdqbnOzcfJpcTuAQtZoiLZOoAIlboFDAeGmSNwkvObPRvRWQgWkGkxwtPauYgdkmypLjbqhlHJIQTntgWjXwZdOyYEdQRRLfMSdnxqppqUofqLbLQDUjwKVKfZJUJQPsWIPwIVaSTrmKskoAhvmZyJgeRpkaTfGgrJzAigcxtfshmiDCFkuiluqtMOkidknnTBtumyJYlIsWLnCQclqdVmikUoMOPdPWwYbJxXyqUVicNxFxyqJTenNblyyKSdlCbiXxUiYUiMwXZASYfvMDPFgxniSjWaZTjHkqlJvtB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cXzQiHIyjwdhPNwiPqFxeUfMVFQGImhykFgMIlQEoZCaRoqSBXTSWAeDumdbsOGtATwEdZlLfoBKiTvodQBGOEcuATWXfiinSjPmJKcWgQrTVYVrwlyMWhxqNbCMpIQNoSMGTiWfPTCezUjYcdWppnsYJihLQCqbNLRGgqrwHuIvsazapTpoPZIyZyeeSueJuTIhpHMEJfJpScshJubJGfkusuVBgfTWQoywSSliQQSfbvaHKiLnyjdSbpMkdBgXepoSsHnCQaYuHQqZsoEOmJCiuQUpJkmfyfbIShzlZpHFmLCsbknEAkKXKfRTRnuwdBeuOGgFbJLbDksHVapaRayWzwoYBEpmrlAxrUxYMUekKbpjPNfjUCjhbdMAnJmYQVZBQZkFVweHDAlaqJjRqoQPoOMLhyvYCzqEuQsAFoxWrzRnTVjStPadhsESlERnKhpEPsfDxNvxqcOyIulaCkmPdambLHvGhTZzysvqFauEgkFRItPfvisehFmoBhQqmkfbHVsgfHXDPJVyhwPllQpuYLRYvGodxKjkarnSNgsXoKEMlaSKxKdcVgvOkuLcfLFfdtXGTclqfPOfeoVLbqcjcXCUEBgAGplrkgsmIEhWRZLlGPGCwKWRaCKMkBHTAcypUrYjWwCLtOPVygMwMANGoQwFnCqFrUGMCRZUGJKTZIGPyldsifauoMnJPLTcDHmilcmahlqOELaAUYDBuzsVywnDQfwRLGIWozYaOAilMBcObErwgTDNGWnwQMUgFFSKtPDMEoEQCTKVREqrXZSGLqwTMcxHfWotDllNkIJPMbXzjDVjPOOjCFuIvTyhXKLyhUScOXvYthRXpPfKwMhptXaxIxgqBoUqzrWbaoLTVpQoottZyPFfNOoMioXHRuFwMRYUiKvcWPkrayyTLOCFJlAyslDameIuqVAuxErqFPEWIScKpBORIuZqoXlZuTvAjEdlEWDODFRregDTqGNoFBIHxvimmIZwLfFyKUfEWAnNBdtdzDmTPXtpHRGdIbuucfTjOygZsTxPjfweXhSUkMhPjMaxKlMIJMOXcnQfyzeOcbWwNbeH", msg.GetContent().GetDescription()) + require.Equal(t, "gov", msg.Route()) + require.Equal(t, v1beta1.TypeMsgSubmitProposal, msg.Type()) } // TestSimulateMsgDeposit tests the normal scenario of a valid message of type TypeMsgDeposit. @@ -167,16 +160,15 @@ func TestSimulateMsgDeposit(t *testing.T) { operationMsg, _, err := op(r, app.BaseApp, ctx, accounts, "") require.NoError(t, err) - var msg v1beta2.MsgDeposit - v1beta2.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + var msg v1beta1.MsgDeposit + v1beta1.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) require.True(t, operationMsg.OK) require.Equal(t, uint64(1), msg.ProposalId) require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Depositor) - require.Len(t, msg.Amount, 1) - require.Equal(t, "560969stake", msg.Amount[0].String()) + require.Equal(t, "560969stake", msg.Amount.String()) require.Equal(t, "gov", msg.Route()) - require.Equal(t, v1beta2.TypeMsgDeposit, msg.Type()) + require.Equal(t, v1beta1.TypeMsgDeposit, msg.Type()) } // TestSimulateMsgVote tests the normal scenario of a valid message of type TypeMsgVote. @@ -212,15 +204,15 @@ func TestSimulateMsgVote(t *testing.T) { operationMsg, _, err := op(r, app.BaseApp, ctx, accounts, "") require.NoError(t, err) - var msg v1beta2.MsgVote - v1beta2.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + var msg v1beta1.MsgVote + v1beta1.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) require.True(t, operationMsg.OK) require.Equal(t, uint64(1), msg.ProposalId) require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Voter) - require.Equal(t, v1beta2.OptionYes, msg.Option) + require.Equal(t, v1beta1.OptionYes, msg.Option) require.Equal(t, "gov", msg.Route()) - require.Equal(t, v1beta2.TypeMsgVote, msg.Type()) + require.Equal(t, v1beta1.TypeMsgVote, msg.Type()) } // TestSimulateMsgVoteWeighted tests the normal scenario of a valid message of type TypeMsgVoteWeighted. @@ -239,7 +231,6 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { govAcc := app.GovKeeper.GetGovernanceAccount(ctx).GetAddress().String() contentMsg, err := v1beta2.NewLegacyContent(v1beta1.NewTextProposal("Test", "description"), govAcc) require.NoError(t, err) - submitTime := ctx.BlockHeader().Time depositPeriod := app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod @@ -256,15 +247,15 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { operationMsg, _, err := op(r, app.BaseApp, ctx, accounts, "") require.NoError(t, err) - var msg v1beta2.MsgVoteWeighted - v1beta2.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + var msg v1beta1.MsgVoteWeighted + v1beta1.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) require.True(t, operationMsg.OK) require.Equal(t, uint64(1), msg.ProposalId) require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Voter) require.True(t, len(msg.Options) >= 1) require.Equal(t, "gov", msg.Route()) - require.Equal(t, v1beta2.TypeMsgVoteWeighted, msg.Type()) + require.Equal(t, v1beta1.TypeMsgVoteWeighted, msg.Type()) } // returns context and an app with updated mint keeper diff --git a/x/gov/types/codec.go b/x/gov/types/codec.go new file mode 100644 index 000000000000..8fe2ef66415e --- /dev/null +++ b/x/gov/types/codec.go @@ -0,0 +1,25 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" +) + +var ( + amino = codec.NewLegacyAmino() + + // ModuleCdc references the global x/gov module codec. Note, the codec should + // ONLY be used in certain instances of tests and for JSON encoding as Amino is + // still used for that purpose. + // + // The actual codec used for serialization should be provided to x/gov and + // defined at the application level. + ModuleCdc = codec.NewAminoCodec(amino) +) + +func init() { + cryptocodec.RegisterCrypto(amino) + + // v1beta1 and v1beta2 will each add their own Amino registrations inside + // their init() functions. +} diff --git a/x/gov/types/v1beta1/codec.go b/x/gov/types/v1beta1/codec.go index 6509735cdfc9..bb4daf87e9fc 100644 --- a/x/gov/types/v1beta1/codec.go +++ b/x/gov/types/v1beta1/codec.go @@ -2,10 +2,10 @@ package v1beta1 import ( "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" + "github.com/cosmos/cosmos-sdk/x/gov/types" ) // RegisterLegacyAminoCodec registers all the necessary types and interfaces for the @@ -19,7 +19,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&TextProposal{}, "cosmos-sdk/TextProposal", nil) } -func RegisterInterfaces(registry types.InterfaceRegistry) { +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSubmitProposal{}, &MsgVote{}, @@ -42,22 +42,9 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { // NOTE: This should only be used for applications that are still using a concrete // Amino codec for serialization. func RegisterProposalTypeCodec(o interface{}, name string) { - amino.RegisterConcrete(o, name, nil) + types.ModuleCdc.LegacyAmino.RegisterConcrete(o, name, nil) } -var ( - amino = codec.NewLegacyAmino() - - // ModuleCdc references the global x/gov module codec. Note, the codec should - // ONLY be used in certain instances of tests and for JSON encoding as Amino is - // still used for that purpose. - // - // The actual codec used for serialization should be provided to x/gov and - // defined at the application level. - ModuleCdc = codec.NewAminoCodec(amino) -) - func init() { - RegisterLegacyAminoCodec(amino) - cryptocodec.RegisterCrypto(amino) + RegisterLegacyAminoCodec(types.ModuleCdc.LegacyAmino) } diff --git a/x/gov/types/v1beta1/content.go b/x/gov/types/v1beta1/content.go index 830c98925fca..a0ce70457aab 100644 --- a/x/gov/types/v1beta1/content.go +++ b/x/gov/types/v1beta1/content.go @@ -2,13 +2,6 @@ package v1beta1 import sdk "github.com/cosmos/cosmos-sdk/types" -// Copied over from /x/gov/types/keys.go to avoid circular imports -const ( - moduleName = "gov" - - routerKey = moduleName -) - // Content defines an interface that a proposal must implement. It contains // information such as the title and description along with the type and routing // information for the appropriate handler to process the proposal. Content can diff --git a/x/gov/types/v1beta1/errors.go b/x/gov/types/v1beta1/errors.go index 1569fb6eecc2..43aa37410ec0 100644 --- a/x/gov/types/v1beta1/errors.go +++ b/x/gov/types/v1beta1/errors.go @@ -2,10 +2,11 @@ package v1beta1 import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/gov/types" ) var ( - ErrInvalidProposalContent = sdkerrors.Register(moduleName, 5, "invalid proposal content") - ErrInvalidProposalType = sdkerrors.Register(moduleName, 6, "invalid proposal type") - ErrInvalidVote = sdkerrors.Register(moduleName, 7, "invalid vote option") + ErrInvalidProposalContent = sdkerrors.Register(types.ModuleName, 5, "invalid proposal content") + ErrInvalidProposalType = sdkerrors.Register(types.ModuleName, 6, "invalid proposal type") + ErrInvalidVote = sdkerrors.Register(types.ModuleName, 7, "invalid vote option") ) diff --git a/x/gov/types/v1beta1/msgs.go b/x/gov/types/v1beta1/msgs.go index eeafbefb244e..1883ce48fcd4 100644 --- a/x/gov/types/v1beta1/msgs.go +++ b/x/gov/types/v1beta1/msgs.go @@ -3,13 +3,13 @@ package v1beta1 import ( "fmt" - "sigs.k8s.io/yaml" - "github.com/gogo/protobuf/proto" + "sigs.k8s.io/yaml" - "github.com/cosmos/cosmos-sdk/codec/types" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/gov/types" ) // Governance message types and routes @@ -21,8 +21,8 @@ const ( ) var ( - _, _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{}, &MsgVoteWeighted{} - _ types.UnpackInterfacesMessage = &MsgSubmitProposal{} + _, _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{}, &MsgVoteWeighted{} + _ codectypes.UnpackInterfacesMessage = &MsgSubmitProposal{} ) // NewMsgSubmitProposal creates a new MsgSubmitProposal. @@ -67,7 +67,7 @@ func (m *MsgSubmitProposal) SetContent(content Content) error { if !ok { return fmt.Errorf("can't proto marshal %T", msg) } - any, err := types.NewAnyWithValue(msg) + any, err := codectypes.NewAnyWithValue(msg) if err != nil { return err } @@ -76,7 +76,7 @@ func (m *MsgSubmitProposal) SetContent(content Content) error { } // Route implements Msg -func (m MsgSubmitProposal) Route() string { return routerKey } +func (m MsgSubmitProposal) Route() string { return types.RouterKey } // Type implements Msg func (m MsgSubmitProposal) Type() string { return TypeMsgSubmitProposal } @@ -109,7 +109,7 @@ func (m MsgSubmitProposal) ValidateBasic() error { // GetSignBytes implements Msg func (m MsgSubmitProposal) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&m) + bz := types.ModuleCdc.MustMarshalJSON(&m) return sdk.MustSortJSON(bz) } @@ -126,7 +126,7 @@ func (m MsgSubmitProposal) String() string { } // UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces -func (m MsgSubmitProposal) UnpackInterfaces(unpacker types.AnyUnpacker) error { +func (m MsgSubmitProposal) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { var content Content return unpacker.UnpackAny(m.Content, &content) } @@ -138,7 +138,7 @@ func NewMsgDeposit(depositor sdk.AccAddress, proposalID uint64, amount sdk.Coins } // Route implements Msg -func (msg MsgDeposit) Route() string { return routerKey } +func (msg MsgDeposit) Route() string { return types.RouterKey } // Type implements Msg func (msg MsgDeposit) Type() string { return TypeMsgDeposit } @@ -166,7 +166,7 @@ func (msg MsgDeposit) String() string { // GetSignBytes implements Msg func (msg MsgDeposit) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&msg) + bz := types.ModuleCdc.MustMarshalJSON(&msg) return sdk.MustSortJSON(bz) } @@ -183,7 +183,7 @@ func NewMsgVote(voter sdk.AccAddress, proposalID uint64, option VoteOption) *Msg } // Route implements Msg -func (msg MsgVote) Route() string { return routerKey } +func (msg MsgVote) Route() string { return types.RouterKey } // Type implements Msg func (msg MsgVote) Type() string { return TypeMsgVote } @@ -208,7 +208,7 @@ func (msg MsgVote) String() string { // GetSignBytes implements Msg func (msg MsgVote) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&msg) + bz := types.ModuleCdc.MustMarshalJSON(&msg) return sdk.MustSortJSON(bz) } @@ -225,7 +225,7 @@ func NewMsgVoteWeighted(voter sdk.AccAddress, proposalID uint64, options Weighte } // Route implements Msg -func (msg MsgVoteWeighted) Route() string { return routerKey } +func (msg MsgVoteWeighted) Route() string { return types.RouterKey } // Type implements Msg func (msg MsgVoteWeighted) Type() string { return TypeMsgVoteWeighted } @@ -271,7 +271,7 @@ func (msg MsgVoteWeighted) String() string { // GetSignBytes implements Msg func (msg MsgVoteWeighted) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&msg) + bz := types.ModuleCdc.MustMarshalJSON(&msg) return sdk.MustSortJSON(bz) } diff --git a/x/gov/types/v1beta1/proposal.go b/x/gov/types/v1beta1/proposal.go index 5998a98c391c..609cf3902dba 100644 --- a/x/gov/types/v1beta1/proposal.go +++ b/x/gov/types/v1beta1/proposal.go @@ -8,9 +8,10 @@ import ( "github.com/gogo/protobuf/proto" "sigs.k8s.io/yaml" - "github.com/cosmos/cosmos-sdk/codec/types" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/gov/types" ) // DefaultStartingProposalID is 1 @@ -22,7 +23,7 @@ func NewProposal(content Content, id uint64, submitTime, depositEndTime time.Tim return Proposal{}, fmt.Errorf("%T does not implement proto.Message", content) } - any, err := types.NewAnyWithValue(msg) + any, err := codectypes.NewAnyWithValue(msg) if err != nil { return Proposal{}, err } @@ -80,7 +81,7 @@ func (p Proposal) GetTitle() string { } // UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces -func (p Proposal) UnpackInterfaces(unpacker types.AnyUnpacker) error { +func (p Proposal) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { var content Content return unpacker.UnpackAny(p.Content, &content) } @@ -88,7 +89,7 @@ func (p Proposal) UnpackInterfaces(unpacker types.AnyUnpacker) error { // Proposals is an array of proposal type Proposals []Proposal -var _ types.UnpackInterfacesMessage = Proposals{} +var _ codectypes.UnpackInterfacesMessage = Proposals{} // Equal returns true if two slices (order-dependant) of proposals are equal. func (p Proposals) Equal(other Proposals) bool { @@ -117,7 +118,7 @@ func (p Proposals) String() string { } // UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces -func (p Proposals) UnpackInterfaces(unpacker types.AnyUnpacker) error { +func (p Proposals) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { for _, x := range p { err := x.UnpackInterfaces(unpacker) if err != nil { @@ -183,7 +184,7 @@ func (tp *TextProposal) GetTitle() string { return tp.Title } func (tp *TextProposal) GetDescription() string { return tp.Description } // ProposalRoute returns the proposal router key -func (tp *TextProposal) ProposalRoute() string { return routerKey } +func (tp *TextProposal) ProposalRoute() string { return types.RouterKey } // ProposalType is "Text" func (tp *TextProposal) ProposalType() string { return ProposalTypeText } diff --git a/x/gov/types/v1beta2/codec.go b/x/gov/types/v1beta2/codec.go index 1f46b036f149..c4b737f14aa0 100644 --- a/x/gov/types/v1beta2/codec.go +++ b/x/gov/types/v1beta2/codec.go @@ -2,10 +2,10 @@ package v1beta2 import ( "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" + "github.com/cosmos/cosmos-sdk/x/gov/types" ) // RegisterLegacyAminoCodec registers all the necessary types and interfaces for the @@ -18,7 +18,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgExecLegacyContent{}, "cosmos-sdk/v1beta2/MsgExecLegacyContent", nil) } -func RegisterInterfaces(registry types.InterfaceRegistry) { +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSubmitProposal{}, &MsgVote{}, @@ -30,29 +30,6 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } -// RegisterProposalTypeCodec registers an external proposal content type defined -// in another module for the internal ModuleCdc. This allows the MsgSubmitProposal -// to be correctly Amino encoded and decoded. -// -// NOTE: This should only be used for applications that are still using a concrete -// Amino codec for serialization. -func RegisterProposalTypeCodec(o interface{}, name string) { - amino.RegisterConcrete(o, name, nil) -} - -var ( - amino = codec.NewLegacyAmino() - - // ModuleCdc references the global x/gov module codec. Note, the codec should - // ONLY be used in certain instances of tests and for JSON encoding as Amino is - // still used for that purpose. - // - // The actual codec used for serialization should be provided to x/gov and - // defined at the application level. - ModuleCdc = codec.NewAminoCodec(amino) -) - func init() { - RegisterLegacyAminoCodec(amino) - cryptocodec.RegisterCrypto(amino) + RegisterLegacyAminoCodec(types.ModuleCdc.LegacyAmino) } diff --git a/x/gov/types/v1beta2/content.go b/x/gov/types/v1beta2/content.go index 99f6d70edeeb..c74612114551 100644 --- a/x/gov/types/v1beta2/content.go +++ b/x/gov/types/v1beta2/content.go @@ -9,13 +9,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) -// Copied over from /x/gov/types/keys.go to avoid circular imports -const ( - moduleName = "gov" - - routerKey = moduleName -) - // NewLegacyContent creates a new MsgExecLegacyContent from a legacy Content // interface. func NewLegacyContent(content v1beta1.Content, authority string) (*MsgExecLegacyContent, error) { diff --git a/x/gov/types/v1beta2/msgs.go b/x/gov/types/v1beta2/msgs.go index 39e85643ad80..7e0edd2663d5 100644 --- a/x/gov/types/v1beta2/msgs.go +++ b/x/gov/types/v1beta2/msgs.go @@ -5,11 +5,11 @@ import ( "github.com/gogo/protobuf/proto" - "github.com/cosmos/cosmos-sdk/codec/types" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" sdktx "github.com/cosmos/cosmos-sdk/types/tx" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -23,8 +23,8 @@ const ( ) var ( - _, _, _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{}, &MsgVoteWeighted{}, &MsgExecLegacyContent{} - _, _ types.UnpackInterfacesMessage = &MsgSubmitProposal{}, &MsgExecLegacyContent{} + _, _, _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{}, &MsgVoteWeighted{}, &MsgExecLegacyContent{} + _, _ codectypes.UnpackInterfacesMessage = &MsgSubmitProposal{}, &MsgExecLegacyContent{} ) // NewMsgSubmitProposal creates a new MsgSubmitProposal. @@ -47,13 +47,13 @@ func (m *MsgSubmitProposal) GetMsgs() ([]sdk.Msg, error) { } func (m *MsgSubmitProposal) setMessages(messages []sdk.Msg) error { - msgs := make([]*types.Any, len(messages)) + msgs := make([]*codectypes.Any, len(messages)) for i, msg := range messages { m, ok := msg.(proto.Message) if !ok { return fmt.Errorf("can't proto marshal %T", msg) } - any, err := types.NewAnyWithValue(m) + any, err := codectypes.NewAnyWithValue(m) if err != nil { return err } @@ -65,7 +65,7 @@ func (m *MsgSubmitProposal) setMessages(messages []sdk.Msg) error { } // Route implements Msg -func (m MsgSubmitProposal) Route() string { return routerKey } +func (m MsgSubmitProposal) Route() string { return types.RouterKey } // Type implements Msg func (m MsgSubmitProposal) Type() string { return TypeMsgSubmitProposal } @@ -98,7 +98,7 @@ func (m MsgSubmitProposal) ValidateBasic() error { for idx, msg := range msgs { if err := msg.ValidateBasic(); err != nil { - return sdkerrors.Wrap(govtypes.ErrInvalidProposalMsg, + return sdkerrors.Wrap(types.ErrInvalidProposalMsg, fmt.Sprintf("msg: %d, err: %s", idx, err.Error())) } } @@ -108,7 +108,7 @@ func (m MsgSubmitProposal) ValidateBasic() error { // GetSignBytes implements Msg func (m MsgSubmitProposal) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&m) + bz := types.ModuleCdc.MustMarshalJSON(&m) return sdk.MustSortJSON(bz) } @@ -119,7 +119,7 @@ func (m MsgSubmitProposal) GetSigners() []sdk.AccAddress { } // UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces -func (m MsgSubmitProposal) UnpackInterfaces(unpacker types.AnyUnpacker) error { +func (m MsgSubmitProposal) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { return sdktx.UnpackInterfaces(unpacker, m.Messages) } @@ -130,7 +130,7 @@ func NewMsgDeposit(depositor sdk.AccAddress, proposalID uint64, amount sdk.Coins } // Route implements Msg -func (msg MsgDeposit) Route() string { return routerKey } +func (msg MsgDeposit) Route() string { return types.RouterKey } // Type implements Msg func (msg MsgDeposit) Type() string { return TypeMsgDeposit } @@ -153,7 +153,7 @@ func (msg MsgDeposit) ValidateBasic() error { // GetSignBytes implements Msg func (msg MsgDeposit) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&msg) + bz := types.ModuleCdc.MustMarshalJSON(&msg) return sdk.MustSortJSON(bz) } @@ -170,7 +170,7 @@ func NewMsgVote(voter sdk.AccAddress, proposalID uint64, option VoteOption) *Msg } // Route implements Msg -func (msg MsgVote) Route() string { return routerKey } +func (msg MsgVote) Route() string { return types.RouterKey } // Type implements Msg func (msg MsgVote) Type() string { return TypeMsgVote } @@ -181,7 +181,7 @@ func (msg MsgVote) ValidateBasic() error { return sdkerrors.ErrInvalidAddress.Wrapf("invalid voter address: %s", err) } if !ValidVoteOption(msg.Option) { - return sdkerrors.Wrap(govtypes.ErrInvalidVote, msg.Option.String()) + return sdkerrors.Wrap(types.ErrInvalidVote, msg.Option.String()) } return nil @@ -189,7 +189,7 @@ func (msg MsgVote) ValidateBasic() error { // GetSignBytes implements Msg func (msg MsgVote) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&msg) + bz := types.ModuleCdc.MustMarshalJSON(&msg) return sdk.MustSortJSON(bz) } @@ -206,7 +206,7 @@ func NewMsgVoteWeighted(voter sdk.AccAddress, proposalID uint64, options Weighte } // Route implements Msg -func (msg MsgVoteWeighted) Route() string { return routerKey } +func (msg MsgVoteWeighted) Route() string { return types.RouterKey } // Type implements Msg func (msg MsgVoteWeighted) Type() string { return TypeMsgVoteWeighted } @@ -224,25 +224,25 @@ func (msg MsgVoteWeighted) ValidateBasic() error { usedOptions := make(map[VoteOption]bool) for _, option := range msg.Options { if !option.IsValid() { - return sdkerrors.Wrap(govtypes.ErrInvalidVote, option.String()) + return sdkerrors.Wrap(types.ErrInvalidVote, option.String()) } weight, err := sdk.NewDecFromStr(option.Weight) if err != nil { - return sdkerrors.Wrapf(govtypes.ErrInvalidVote, "Invalid weight: %s", err) + return sdkerrors.Wrapf(types.ErrInvalidVote, "Invalid weight: %s", err) } totalWeight = totalWeight.Add(weight) if usedOptions[option.Option] { - return sdkerrors.Wrap(govtypes.ErrInvalidVote, "Duplicated vote option") + return sdkerrors.Wrap(types.ErrInvalidVote, "Duplicated vote option") } usedOptions[option.Option] = true } if totalWeight.GT(sdk.NewDec(1)) { - return sdkerrors.Wrap(govtypes.ErrInvalidVote, "Total weight overflow 1.00") + return sdkerrors.Wrap(types.ErrInvalidVote, "Total weight overflow 1.00") } if totalWeight.LT(sdk.NewDec(1)) { - return sdkerrors.Wrap(govtypes.ErrInvalidVote, "Total weight lower than 1.00") + return sdkerrors.Wrap(types.ErrInvalidVote, "Total weight lower than 1.00") } return nil @@ -250,7 +250,7 @@ func (msg MsgVoteWeighted) ValidateBasic() error { // GetSignBytes implements Msg func (msg MsgVoteWeighted) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&msg) + bz := types.ModuleCdc.MustMarshalJSON(&msg) return sdk.MustSortJSON(bz) } @@ -260,7 +260,7 @@ func (msg MsgVoteWeighted) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{voter} } -func NewMsgExecLegacyContent(content *types.Any, authority string) *MsgExecLegacyContent { +func NewMsgExecLegacyContent(content *codectypes.Any, authority string) *MsgExecLegacyContent { return &MsgExecLegacyContent{ Content: content, Authority: authority, @@ -282,7 +282,7 @@ func (c MsgExecLegacyContent) ValidateBasic() error { } // UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces -func (m MsgExecLegacyContent) UnpackInterfaces(unpacker types.AnyUnpacker) error { +func (m MsgExecLegacyContent) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { var content v1beta1.Content return unpacker.UnpackAny(m.Content, &content) } From b255adda89f5ed4aa9184dc7333d2317724ed614 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Fri, 14 Jan 2022 13:08:22 +0100 Subject: [PATCH 19/39] Revert proto lints --- proto/cosmos/gov/v1beta1/gov.proto | 30 ++++++++++++++++------ proto/cosmos/staking/v1beta1/staking.proto | 4 +-- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/proto/cosmos/gov/v1beta1/gov.proto b/proto/cosmos/gov/v1beta1/gov.proto index 214a5bd0ce8d..8cec3086020e 100644 --- a/proto/cosmos/gov/v1beta1/gov.proto +++ b/proto/cosmos/gov/v1beta1/gov.proto @@ -149,31 +149,45 @@ message Vote { // DepositParams defines the params for deposits on governance proposals. message DepositParams { // Minimum deposit for a proposal to enter voting period. - repeated cosmos.base.v1beta1.Coin min_deposit = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin min_deposit = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 // months. - google.protobuf.Duration max_deposit_period = 2 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + google.protobuf.Duration max_deposit_period = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true + ]; } // VotingParams defines the params for voting on governance proposals. message VotingParams { // Length of the voting period. - google.protobuf.Duration voting_period = 1 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + google.protobuf.Duration voting_period = 1 + [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; } // TallyParams defines the params for tallying votes on governance proposals. message TallyParams { // Minimum percentage of total stake needed to vote for a result to be // considered valid. - bytes quorum = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + bytes quorum = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - bytes threshold = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + bytes threshold = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // Minimum value of Veto votes to Total votes ratio for proposal to be // vetoed. Default value: 1/3. - bytes veto_threshold = 3 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + bytes veto_threshold = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } diff --git a/proto/cosmos/staking/v1beta1/staking.proto b/proto/cosmos/staking/v1beta1/staking.proto index 5ce8ab13cf3b..b41fb0fd27ef 100644 --- a/proto/cosmos/staking/v1beta1/staking.proto +++ b/proto/cosmos/staking/v1beta1/staking.proto @@ -214,7 +214,7 @@ message UnbondingDelegation { // validator_address is the bech32-encoded address of the validator. string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // entries are the unbonding delegation entries. - repeated UnbondingDelegationEntry entries = 3 [(gogoproto.nullable) = false]; // unbonding delegation entries + repeated UnbondingDelegationEntry entries = 3 [(gogoproto.nullable) = false]; // unbonding delegation entries } // UnbondingDelegationEntry defines an unbonding object with relevant metadata. @@ -277,7 +277,7 @@ message Redelegation { // validator_dst_address is the validator redelegation destination operator address. string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // entries are the redelegation entries. - repeated RedelegationEntry entries = 4 [(gogoproto.nullable) = false]; // redelegation entries + repeated RedelegationEntry entries = 4 [(gogoproto.nullable) = false]; // redelegation entries } // Params defines the parameters for the staking module. From d6d24d397cda6dd048c498b18329d7bf9f09b680 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Fri, 14 Jan 2022 13:08:48 +0100 Subject: [PATCH 20/39] revert orm changes --- orm/internal/testpb/testschema.proto | 106 +++++++++++++-------------- 1 file changed, 50 insertions(+), 56 deletions(-) diff --git a/orm/internal/testpb/testschema.proto b/orm/internal/testpb/testschema.proto index 503f1389dffc..565bc539e369 100644 --- a/orm/internal/testpb/testschema.proto +++ b/orm/internal/testpb/testschema.proto @@ -11,78 +11,72 @@ option go_package = "github.com/cosmos/cosmos-sdk/orm/internal/testpb"; message A { option (cosmos.orm.v1alpha1.table) = { id: 1; -primary_key: { -fields: - "u32,u64,str" -} -index: { -id: - 1; -fields: - "u64,str" -} -index: { -id: - 2; -fields: - "str,u32" -} -index: { -id: - 3; -fields: - "bz,str" -} -}; + primary_key: { + fields: "u32,u64,str" + } + index:{ + id: 1; + fields:"u64,str" + } + index:{ + id: 2; + fields:"str,u32" + } + index:{ + id: 3; + fields:"bz,str" + } + }; -// Valid key fields: -uint32 u32 = 1; -uint64 u64 = 2; -string str = 3; -bytes bz = 4; -google.protobuf.Timestamp ts = 5; -google.protobuf.Duration dur = 6; -int32 i32 = 7; -sint32 s32 = 8; -sfixed32 sf32 = 9; -int64 i64 = 10; -sint64 s64 = 11; -sfixed64 sf64 = 12; -fixed32 f32 = 13; -fixed64 f64 = 14; -bool b = 15; -Enum e = 16; + // Valid key fields: + uint32 u32 = 1; + uint64 u64 = 2; + string str = 3; + bytes bz = 4; + google.protobuf.Timestamp ts = 5; + google.protobuf.Duration dur = 6; + int32 i32 = 7; + sint32 s32 = 8; + sfixed32 sf32 = 9; + int64 i64 = 10; + sint64 s64 = 11; + sfixed64 sf64 = 12; + fixed32 f32 = 13; + fixed64 f64 = 14; + bool b = 15; + Enum e = 16; -// Invalid key fields: -repeated uint32 repeated = 17; -map map = 18; -B msg = 19; -oneof sum { - uint32 oneof = 20; -} + // Invalid key fields: + repeated uint32 repeated = 17; + map map = 18; + B msg = 19; + oneof sum { + uint32 oneof = 20; + } } enum Enum { ENUM_UNSPECIFIED = 0; - ENUM_ONE = 1; - ENUM_TWO = 2; - ENUM_FIVE = 5; - ENUM_NEG_THREE = -3; + ENUM_ONE = 1; + ENUM_TWO = 2; + ENUM_FIVE = 5; + ENUM_NEG_THREE = -3; } message B { - option (cosmos.orm.v1alpha1.singleton) = { - id: 2 - }; + option (cosmos.orm.v1alpha1.singleton) = {id: 2}; string x = 1; } message C { option (cosmos.orm.v1alpha1.table) = { id: 3 - primary_key: {fields: "id" auto_increment: true} + primary_key:{ + fields:"id" + auto_increment: true + } }; uint64 id = 1; - string x = 2; + string x = 2; } From 06d26d3cfd92cb7cca8230f7fd0c9c285be0e9bc Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Fri, 14 Jan 2022 13:53:08 +0100 Subject: [PATCH 21/39] Fix proposal_handler test --- x/gov/client/cli/query.go | 6 ++--- x/gov/client/testutil/cli_test.go | 4 ++-- x/gov/client/testutil/grpc.go | 16 ++++++------- x/gov/keeper/grpc_query_test.go | 6 ++--- x/gov/keeper/vote.go | 2 +- x/gov/simulation/operations_test.go | 8 +++---- x/gov/types/v1beta1/msgs_test.go | 4 ++-- x/gov/types/v1beta2/genesis.go | 8 +++---- x/gov/types/v1beta2/msgs_test.go | 4 ++-- x/gov/types/v1beta2/params.go | 37 ++++++++++++++--------------- 10 files changed, 46 insertions(+), 49 deletions(-) diff --git a/x/gov/client/cli/query.go b/x/gov/client/cli/query.go index 2b4deee300cf..b37786a18016 100644 --- a/x/gov/client/cli/query.go +++ b/x/gov/client/cli/query.go @@ -561,9 +561,9 @@ $ %s query gov params } params := v1beta2.NewParams( - votingRes.GetVotingParams(), - tallyRes.GetTallyParams(), - depositRes.GetDepositParams(), + *votingRes.GetVotingParams(), + *tallyRes.GetTallyParams(), + *depositRes.GetDepositParams(), ) return clientCtx.PrintObjectLegacy(params) diff --git a/x/gov/client/testutil/cli_test.go b/x/gov/client/testutil/cli_test.go index 1304823ff2e9..94a102d1083b 100644 --- a/x/gov/client/testutil/cli_test.go +++ b/x/gov/client/testutil/cli_test.go @@ -20,8 +20,8 @@ func TestIntegrationTestSuite(t *testing.T) { dp := v1beta2.NewDepositParams(sdk.NewCoins(sdk.NewCoin(cfg.BondDenom, v1beta2.DefaultMinDepositTokens)), time.Duration(15)*time.Second) vp := v1beta2.NewVotingParams(time.Duration(5) * time.Second) genesisState := v1beta2.DefaultGenesisState() - genesisState.DepositParams = dp - genesisState.VotingParams = vp + genesisState.DepositParams = &dp + genesisState.VotingParams = &vp bz, err := cfg.Codec.MarshalJSON(genesisState) require.NoError(t, err) cfg.GenesisState["gov"] = bz diff --git a/x/gov/client/testutil/grpc.go b/x/gov/client/testutil/grpc.go index 6e71b5df0340..f7cdf8af0ba5 100644 --- a/x/gov/client/testutil/grpc.go +++ b/x/gov/client/testutil/grpc.go @@ -357,6 +357,10 @@ func (s *IntegrationTestSuite) TestGetTallyGRPC() { func (s *IntegrationTestSuite) TestGetParamsGRPC() { val := s.network.Validators[0] + dp := v1beta2.DefaultDepositParams() + vp := v1beta2.DefaultVotingParams() + tp := v1beta2.DefaultTallyParams() + testCases := []struct { name string url string @@ -374,27 +378,21 @@ func (s *IntegrationTestSuite) TestGetParamsGRPC() { fmt.Sprintf("%s/cosmos/gov/v1beta2/params/%s", val.APIAddress, v1beta2.ParamDeposit), false, &v1beta2.QueryParamsResponse{}, - &v1beta2.QueryParamsResponse{ - DepositParams: v1beta2.DefaultDepositParams(), - }, + &v1beta2.QueryParamsResponse{DepositParams: &dp}, }, { "get vote params", fmt.Sprintf("%s/cosmos/gov/v1beta2/params/%s", val.APIAddress, v1beta2.ParamVoting), false, &v1beta2.QueryParamsResponse{}, - &v1beta2.QueryParamsResponse{ - VotingParams: v1beta2.DefaultVotingParams(), - }, + &v1beta2.QueryParamsResponse{VotingParams: &vp}, }, { "get tally params", fmt.Sprintf("%s/cosmos/gov/v1beta2/params/%s", val.APIAddress, v1beta2.ParamTallying), false, &v1beta2.QueryParamsResponse{}, - &v1beta2.QueryParamsResponse{ - TallyParams: v1beta2.DefaultTallyParams(), - }, + &v1beta2.QueryParamsResponse{TallyParams: &tp}, }, } diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 789fe7f821c6..e8642b3869aa 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -460,7 +460,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { req = &v1beta2.QueryParamsRequest{ParamsType: v1beta2.ParamDeposit} depositParams := v1beta2.DefaultDepositParams() expRes = &v1beta2.QueryParamsResponse{ - DepositParams: depositParams, + DepositParams: &depositParams, } }, true, @@ -471,7 +471,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { req = &v1beta2.QueryParamsRequest{ParamsType: v1beta2.ParamVoting} votingParams := v1beta2.DefaultVotingParams() expRes = &v1beta2.QueryParamsResponse{ - VotingParams: votingParams, + VotingParams: &votingParams, } }, true, @@ -482,7 +482,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { req = &v1beta2.QueryParamsRequest{ParamsType: v1beta2.ParamTallying} tallyParams := v1beta2.DefaultTallyParams() expRes = &v1beta2.QueryParamsResponse{ - TallyParams: tallyParams, + TallyParams: &tallyParams, } }, true, diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index aada8a1bdd43..dd18950dc40a 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -135,7 +135,7 @@ func (keeper Keeper) deleteVote(ctx sdk.Context, proposalID uint64, voterAddr sd // populateLegacyOption adds graceful fallback of deprecated `Option` field, in case // there's only 1 VoteOption. func populateLegacyOption(vote *v1beta2.Vote) { - if len(vote.Options) == 1 && vote.Options[0].Weight == "1.0" { + if len(vote.Options) == 1 && sdk.MustNewDecFromStr(vote.Options[0].Weight).Equal(sdk.MustNewDecFromStr("1.0")) { vote.Option = vote.Options[0].Option // nolint } } diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index 43cf9963b0c6..5e39e23c8790 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -116,7 +116,7 @@ func TestSimulateMsgSubmitProposal(t *testing.T) { require.NoError(t, err) var msg v1beta1.MsgSubmitProposal - v1beta1.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) require.True(t, operationMsg.OK) require.Equal(t, "cosmos1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7u4x9a0", msg.Proposer) @@ -161,7 +161,7 @@ func TestSimulateMsgDeposit(t *testing.T) { require.NoError(t, err) var msg v1beta1.MsgDeposit - v1beta1.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) require.True(t, operationMsg.OK) require.Equal(t, uint64(1), msg.ProposalId) @@ -205,7 +205,7 @@ func TestSimulateMsgVote(t *testing.T) { require.NoError(t, err) var msg v1beta1.MsgVote - v1beta1.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) require.True(t, operationMsg.OK) require.Equal(t, uint64(1), msg.ProposalId) @@ -248,7 +248,7 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { require.NoError(t, err) var msg v1beta1.MsgVoteWeighted - v1beta1.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) require.True(t, operationMsg.OK) require.Equal(t, uint64(1), msg.ProposalId) diff --git a/x/gov/types/v1beta1/msgs_test.go b/x/gov/types/v1beta1/msgs_test.go index 3d3a606889d0..5637b5c40bd5 100644 --- a/x/gov/types/v1beta1/msgs_test.go +++ b/x/gov/types/v1beta1/msgs_test.go @@ -61,10 +61,10 @@ func TestMsgSubmitProposal(t *testing.T) { func TestMsgDepositGetSignBytes(t *testing.T) { addr := sdk.AccAddress("addr1") - msg := NewMsgDeposit(addr, 1, coinsPos) + msg := NewMsgDeposit(addr, 0, coinsPos) res := msg.GetSignBytes() - expected := `{"type":"cosmos-sdk/MsgDeposit","value":{"amount":[{"amount":"1000","denom":"stake"}],"depositor":"cosmos1v9jxgu33kfsgr5","proposal_id":"1"}}` + expected := `{"type":"cosmos-sdk/MsgDeposit","value":{"amount":[{"amount":"1000","denom":"stake"}],"depositor":"cosmos1v9jxgu33kfsgr5"}}` require.Equal(t, expected, string(res)) } diff --git a/x/gov/types/v1beta2/genesis.go b/x/gov/types/v1beta2/genesis.go index 91ee6ad4f612..693082b3f581 100644 --- a/x/gov/types/v1beta2/genesis.go +++ b/x/gov/types/v1beta2/genesis.go @@ -8,12 +8,12 @@ import ( ) // NewGenesisState creates a new genesis state for the governance module -func NewGenesisState(startingProposalID uint64, dp *DepositParams, vp *VotingParams, tp *TallyParams) *GenesisState { +func NewGenesisState(startingProposalID uint64, dp DepositParams, vp VotingParams, tp TallyParams) *GenesisState { return &GenesisState{ StartingProposalId: startingProposalID, - DepositParams: dp, - VotingParams: vp, - TallyParams: tp, + DepositParams: &dp, + VotingParams: &vp, + TallyParams: &tp, } } diff --git a/x/gov/types/v1beta2/msgs_test.go b/x/gov/types/v1beta2/msgs_test.go index 654487bd4ccc..f6102bf7d2e8 100644 --- a/x/gov/types/v1beta2/msgs_test.go +++ b/x/gov/types/v1beta2/msgs_test.go @@ -129,12 +129,12 @@ func TestMsgVoteWeighted(t *testing.T) { // this tests that Amino JSON MsgSubmitProposal.GetSignBytes() still works with Content as Any using the ModuleCdc func TestMsgSubmitProposal_GetSignBytes(t *testing.T) { proposal := []sdk.Msg{v1beta2.NewMsgVote(addrs[0], 1, v1beta2.OptionYes)} - msg, err := v1beta2.NewMsgSubmitProposal(proposal, sdk.NewCoins(), addrs[1].String()) + msg, err := v1beta2.NewMsgSubmitProposal(proposal, sdk.NewCoins(), sdk.AccAddress{}.String()) require.NoError(t, err) var bz []byte require.NotPanics(t, func() { bz = msg.GetSignBytes() }) - require.Equal(t, `{"type":"cosmos-sdk/v1beta2/MsgSubmitProposal","value":{"initial_deposit":[],"messages":[{"type":"cosmos-sdk/v1beta2/MsgVote","value":{"option":1,"proposal_id":"1","voter":"cosmos1w3jhxap3gempvr"}}],"proposer":"cosmos1w3jhxapjx2whzu"}}`, + require.Equal(t, "{\"type\":\"cosmos-sdk/v1beta2/MsgSubmitProposal\",\"value\":{\"initial_deposit\":[],\"messages\":[{\"type\":\"cosmos-sdk/v1beta2/MsgVote\",\"value\":{\"option\":1,\"proposal_id\":\"1\",\"voter\":\"cosmos1w3jhxap3gempvr\"}}]}}", string(bz)) } diff --git a/x/gov/types/v1beta2/params.go b/x/gov/types/v1beta2/params.go index 86feccfeed08..9883daabefb0 100644 --- a/x/gov/types/v1beta2/params.go +++ b/x/gov/types/v1beta2/params.go @@ -39,15 +39,15 @@ func ParamKeyTable() paramtypes.KeyTable { } // NewDepositParams creates a new DepositParams object -func NewDepositParams(minDeposit sdk.Coins, maxDepositPeriod time.Duration) *DepositParams { - return &DepositParams{ +func NewDepositParams(minDeposit sdk.Coins, maxDepositPeriod time.Duration) DepositParams { + return DepositParams{ MinDeposit: minDeposit, MaxDepositPeriod: &maxDepositPeriod, } } // DefaultDepositParams default parameters for deposits -func DefaultDepositParams() *DepositParams { +func DefaultDepositParams() DepositParams { return NewDepositParams( sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, DefaultMinDepositTokens)), DefaultPeriod, @@ -56,17 +56,16 @@ func DefaultDepositParams() *DepositParams { // Equal checks equality of DepositParams func (dp DepositParams) Equal(dp2 DepositParams) bool { - return sdk.NewCoins(dp.MinDeposit...).IsEqual(sdk.NewCoins(dp2.MinDeposit...)) && dp.MaxDepositPeriod == dp2.MaxDepositPeriod + return sdk.Coins(dp.MinDeposit).IsEqual(dp2.MinDeposit) && dp.MaxDepositPeriod == dp2.MaxDepositPeriod } func validateDepositParams(i interface{}) error { - v, ok := i.(*DepositParams) + v, ok := i.(DepositParams) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } - minDeposit := sdk.NewCoins(v.MinDeposit...) - if !minDeposit.IsValid() { + if !sdk.Coins(v.MinDeposit).IsValid() { return fmt.Errorf("invalid minimum deposit: %s", v.MinDeposit) } if v.MaxDepositPeriod == nil || v.MaxDepositPeriod.Seconds() <= 0 { @@ -77,8 +76,8 @@ func validateDepositParams(i interface{}) error { } // NewTallyParams creates a new TallyParams object -func NewTallyParams(quorum, threshold, vetoThreshold sdk.Dec) *TallyParams { - return &TallyParams{ +func NewTallyParams(quorum, threshold, vetoThreshold sdk.Dec) TallyParams { + return TallyParams{ Quorum: quorum.String(), Threshold: threshold.String(), VetoThreshold: vetoThreshold.String(), @@ -86,7 +85,7 @@ func NewTallyParams(quorum, threshold, vetoThreshold sdk.Dec) *TallyParams { } // DefaultTallyParams default parameters for tallying -func DefaultTallyParams() *TallyParams { +func DefaultTallyParams() TallyParams { return NewTallyParams(DefaultQuorum, DefaultThreshold, DefaultVetoThreshold) } @@ -96,7 +95,7 @@ func (tp TallyParams) Equal(other TallyParams) bool { } func validateTallyParams(i interface{}) error { - v, ok := i.(*TallyParams) + v, ok := i.(TallyParams) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } @@ -138,14 +137,14 @@ func validateTallyParams(i interface{}) error { } // NewVotingParams creates a new VotingParams object -func NewVotingParams(votingPeriod time.Duration) *VotingParams { - return &VotingParams{ +func NewVotingParams(votingPeriod time.Duration) VotingParams { + return VotingParams{ VotingPeriod: &votingPeriod, } } // DefaultVotingParams default parameters for voting -func DefaultVotingParams() *VotingParams { +func DefaultVotingParams() VotingParams { return NewVotingParams(DefaultPeriod) } @@ -155,7 +154,7 @@ func (vp VotingParams) Equal(other VotingParams) bool { } func validateVotingParams(i interface{}) error { - v, ok := i.(*VotingParams) + v, ok := i.(VotingParams) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } @@ -173,9 +172,9 @@ func validateVotingParams(i interface{}) error { // Params returns all of the governance params type Params struct { - VotingParams *VotingParams `json:"voting_params" yaml:"voting_params"` - TallyParams *TallyParams `json:"tally_params" yaml:"tally_params"` - DepositParams *DepositParams `json:"deposit_params" yaml:"deposit_params"` + VotingParams VotingParams `json:"voting_params" yaml:"voting_params"` + TallyParams TallyParams `json:"tally_params" yaml:"tally_params"` + DepositParams DepositParams `json:"deposit_params" yaml:"deposit_params"` } func (gp Params) String() string { @@ -184,7 +183,7 @@ func (gp Params) String() string { } // NewParams creates a new gov Params instance -func NewParams(vp *VotingParams, tp *TallyParams, dp *DepositParams) Params { +func NewParams(vp VotingParams, tp TallyParams, dp DepositParams) Params { return Params{ VotingParams: vp, DepositParams: dp, From a0a4e55a5cb2d604400456a2d98118cbd97d2d94 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Fri, 14 Jan 2022 14:01:40 +0100 Subject: [PATCH 22/39] Revert some changes --- x/authz/client/testutil/tx.go | 5 ++--- x/distribution/client/cli/tx.go | 4 ++-- x/distribution/types/codec.go | 4 ++-- x/feegrant/filtered_fee_test.go | 3 +-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/x/authz/client/testutil/tx.go b/x/authz/client/testutil/tx.go index d16faf1608bb..e883aa6fe848 100644 --- a/x/authz/client/testutil/tx.go +++ b/x/authz/client/testutil/tx.go @@ -54,11 +54,10 @@ func (s *IntegrationTestSuite) SetupSuite() { s.Require().NoError(err) // create a proposal with deposit - out, err := govtestutil.MsgSubmitProposal(val.ClientCtx, val.Address.String(), + _, err = govtestutil.MsgSubmitProposal(val.ClientCtx, val.Address.String(), "Text Proposal 1", "Where is the title!?", govv1beta1.ProposalTypeText, fmt.Sprintf("--%s=%s", govcli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, govv1beta2.DefaultMinDepositTokens).String())) s.Require().NoError(err) - s.Require().Contains(out.String(), `"code":0`) // Create new account in the keyring. s.grantee[1] = s.createAccount("grantee2") @@ -66,7 +65,7 @@ func (s *IntegrationTestSuite) SetupSuite() { s.msgSendExec(s.grantee[1]) // grant send authorization to grantee2 - out, err = ExecGrant(val, []string{ + out, err := ExecGrant(val, []string{ s.grantee[1].String(), "send", fmt.Sprintf("--%s=100steak", cli.FlagSpendLimit), diff --git a/x/distribution/client/cli/tx.go b/x/distribution/client/cli/tx.go index 37db59cfc908..d9ec9feeebbc 100644 --- a/x/distribution/client/cli/tx.go +++ b/x/distribution/client/cli/tx.go @@ -13,7 +13,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/distribution/types" - govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // Transaction flags for the x/distribution module @@ -312,7 +312,7 @@ Where proposal.json contains: } content := types.NewCommunityPoolSpendProposal(proposal.Title, proposal.Description, recpAddr, amount) - msg, err := govv1beta1.NewMsgSubmitProposal(content, deposit, from) + msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) if err != nil { return err } diff --git a/x/distribution/types/codec.go b/x/distribution/types/codec.go index 19a3fac27408..0e1d1df42be3 100644 --- a/x/distribution/types/codec.go +++ b/x/distribution/types/codec.go @@ -6,7 +6,7 @@ import ( cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" - govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // RegisterLegacyAminoCodec registers the necessary x/distribution interfaces and concrete types @@ -28,7 +28,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &MsgFundCommunityPool{}, ) registry.RegisterImplementations( - (*govv1beta1.Content)(nil), + (*govtypes.Content)(nil), &CommunityPoolSpendProposal{}, ) diff --git a/x/feegrant/filtered_fee_test.go b/x/feegrant/filtered_fee_test.go index f754d88bd871..8d7935665766 100644 --- a/x/feegrant/filtered_fee_test.go +++ b/x/feegrant/filtered_fee_test.go @@ -4,15 +4,14 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/x/feegrant" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ocproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/feegrant" ) func TestFilteredFeeValidAllow(t *testing.T) { From b78b0534f1223df2c218750bb5fdcba70be2f19f Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Fri, 14 Jan 2022 14:28:53 +0100 Subject: [PATCH 23/39] Move legacy stuff into ExecLegacyContent --- proto/cosmos/gov/v1beta2/tx.proto | 4 +- x/gov/abci.go | 14 ++-- x/gov/keeper/msg_server.go | 27 ++++++- x/gov/keeper/proposal.go | 28 +------ x/gov/keeper/proposal_test.go | 6 +- x/gov/types/v1beta2/content.go | 8 +- x/gov/types/v1beta2/tx.pb.go | 119 +++++++++++------------------- 7 files changed, 87 insertions(+), 119 deletions(-) diff --git a/proto/cosmos/gov/v1beta2/tx.proto b/proto/cosmos/gov/v1beta2/tx.proto index 35226c9bc5e9..83d5d2d0aaf5 100644 --- a/proto/cosmos/gov/v1beta2/tx.proto +++ b/proto/cosmos/gov/v1beta2/tx.proto @@ -53,9 +53,7 @@ message MsgExecLegacyContent { } // MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. -message MsgExecLegacyContentResponse { - uint64 proposal_id = 1; -} +message MsgExecLegacyContentResponse {} // MsgVote defines a message to cast a vote. message MsgVote { diff --git a/x/gov/abci.go b/x/gov/abci.go index 62c72d0257e9..36fea6f2c0e9 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -57,10 +57,8 @@ func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) { if passes { var ( - messages []sdk.Msg - err error - idx int - msg sdk.Msg + idx int + msg sdk.Msg ) // attempt to execute all messages within the passed proposal @@ -68,8 +66,8 @@ func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) { // the handlers fails, no state mutation is written and the error // message is logged. cacheCtx, writeCache := ctx.CacheContext() - messages, err = proposal.GetMsgs() - if err != nil { + messages, err := proposal.GetMsgs() + if err == nil { for idx, msg = range messages { handler := keeper.Router().Handler(msg) _, err = handler(cacheCtx, msg) @@ -79,6 +77,8 @@ func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) { } } + // `err == nil` when all handlers passed. + // Or else, `idx` and `err` are populated with the msg index and error. if err == nil { proposal.Status = v1beta2.StatusPassed tagValue = types.AttributeValueProposalPassed @@ -95,7 +95,7 @@ func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) { } else { proposal.Status = v1beta2.StatusFailed tagValue = types.AttributeValueProposalFailed - logMsg = fmt.Sprintf("passed, but msg %d failed on execution: %s", idx, err) + logMsg = fmt.Sprintf("passed, but msg %d (%s) failed on execution: %s", idx, sdk.MsgTypeURL(msg), err) } } else { proposal.Status = v1beta2.StatusRejected diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 62e661be1c65..71f2e0f87143 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -10,6 +10,7 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" @@ -20,7 +21,7 @@ type msgServer struct { } // NewMsgServerImpl returns an implementation of the gov MsgServer interface -// for the provided Keeper. +// for the provided k.Keeper. func NewMsgServerImpl(keeper Keeper) v1beta2.MsgServer { return &msgServer{Keeper: keeper} } @@ -81,7 +82,29 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1beta2.MsgSubmitP } func (k msgServer) ExecLegacyContent(goCtx context.Context, msg *v1beta2.MsgExecLegacyContent) (*v1beta2.MsgExecLegacyContentResponse, error) { - panic("todo") + ctx := sdk.UnwrapSDKContext(goCtx) + + content, err := v1beta2.LegacyContentFromMessage(msg) + if err != nil { + return nil, sdkerrors.Wrapf(v1beta1.ErrInvalidProposalContent, "%+v", err) + } + + // if so ensure that the content has a respective handler + if !k.Keeper.legacyRouter.HasRoute(content.ProposalRoute()) { + return nil, sdkerrors.Wrap(types.ErrNoProposalHandlerExists, content.ProposalRoute()) + } + + // Execute the proposal content in a new context branch (with branched store) + // to validate the actual parameter changes before the proposal proceeds + // through the governance process. State is not persisted. + cacheCtx, _ := ctx.CacheContext() + handler := k.Keeper.legacyRouter.GetRoute(content.ProposalRoute()) + if err := handler(cacheCtx, content); err != nil { + return nil, sdkerrors.Wrapf(v1beta1.ErrInvalidProposalContent, "failed to run legacy handler %s, %+v", content.ProposalRoute(), err) + } + + return &v1beta2.MsgExecLegacyContentResponse{}, nil + } func (k msgServer) Vote(goCtx context.Context, msg *v1beta2.MsgVote) (*v1beta2.MsgVoteResponse, error) { diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 615db5134bce..9da623c7e332 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -7,7 +7,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) @@ -31,30 +30,9 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg) (v1beta return v1beta2.Proposal{}, sdkerrors.Wrap(types.ErrInvalidSigner, signers[0].String()) } - // check if the message wraps the legacy content type - if contentMsg, ok := msg.(*v1beta2.MsgExecLegacyContent); ok { - content := v1beta2.LegacyContentFromMessage(contentMsg) - if content == nil { - return v1beta2.Proposal{}, sdkerrors.Wrap(v1beta1.ErrInvalidProposalContent, "content is nil") - } - - // if so ensure that the content has a respective handler - if !keeper.legacyRouter.HasRoute(content.ProposalRoute()) { - return v1beta2.Proposal{}, sdkerrors.Wrap(types.ErrNoProposalHandlerExists, content.ProposalRoute()) - } - - // Execute the proposal content in a new context branch (with branched store) - // to validate the actual parameter changes before the proposal proceeds - // through the governance process. State is not persisted. - cacheCtx, _ := ctx.CacheContext() - handler := keeper.legacyRouter.GetRoute(content.ProposalRoute()) - if err := handler(cacheCtx, content); err != nil { - return v1beta2.Proposal{}, sdkerrors.Wrap(v1beta1.ErrInvalidProposalContent, err.Error()) - } - - // for all other message types use the msg service router to see that there is a valid route for that - // message. NOTE: we do not verify the proposal messages any further. They may fail upon execution - } else if keeper.router.Handler(msg) == nil { + // for all other message types use the msg service router to see that there is a valid route for that + // message. NOTE: we do not verify the proposal messages any further. They may fail upon execution. + if keeper.router.Handler(msg) == nil { return v1beta2.Proposal{}, sdkerrors.Wrap(types.ErrUnroutableProposalMsg, sdk.MsgTypeURL(msg)) } } diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index fbd72dae44f7..848d66d8fc00 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -136,6 +136,8 @@ func TestMigrateProposalMessages(t *testing.T) { content := v1beta1.NewTextProposal("Test", "description") contentMsg, err := v1beta2.NewLegacyContent(content, sdk.AccAddress("test1").String()) require.NoError(t, err) - content = v1beta2.LegacyContentFromMessage(contentMsg) - require.NotNil(t, content) + content, err = v1beta2.LegacyContentFromMessage(contentMsg) + require.NoError(t, err) + require.Equal(t, "Test", content.GetTitle()) + require.Equal(t, "description", content.GetDescription()) } diff --git a/x/gov/types/v1beta2/content.go b/x/gov/types/v1beta2/content.go index c74612114551..59d6db8b394c 100644 --- a/x/gov/types/v1beta2/content.go +++ b/x/gov/types/v1beta2/content.go @@ -6,6 +6,7 @@ import ( "github.com/gogo/protobuf/proto" codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -27,10 +28,11 @@ func NewLegacyContent(content v1beta1.Content, authority string) (*MsgExecLegacy // LegacyContentFromMessage extracts the legacy Content interface from a // MsgExecLegacyContent. -func LegacyContentFromMessage(msg *MsgExecLegacyContent) v1beta1.Content { +func LegacyContentFromMessage(msg *MsgExecLegacyContent) (v1beta1.Content, error) { content, ok := msg.Content.GetCachedValue().(v1beta1.Content) if !ok { - return nil + return nil, sdkerrors.ErrInvalidType.Wrapf("expected %T, got %T", (*v1beta1.Content)(nil), msg.Content.GetCachedValue()) } - return content + + return content, nil } diff --git a/x/gov/types/v1beta2/tx.pb.go b/x/gov/types/v1beta2/tx.pb.go index 15a37cb792ce..6c0363f21276 100644 --- a/x/gov/types/v1beta2/tx.pb.go +++ b/x/gov/types/v1beta2/tx.pb.go @@ -196,7 +196,6 @@ func (m *MsgExecLegacyContent) GetAuthority() string { // MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. type MsgExecLegacyContentResponse struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` } func (m *MsgExecLegacyContentResponse) Reset() { *m = MsgExecLegacyContentResponse{} } @@ -232,13 +231,6 @@ func (m *MsgExecLegacyContentResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgExecLegacyContentResponse proto.InternalMessageInfo -func (m *MsgExecLegacyContentResponse) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - // MsgVote defines a message to cast a vote. type MsgVote struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` @@ -554,48 +546,48 @@ func init() { proto.RegisterFile("cosmos/gov/v1beta2/tx.proto", fileDescriptor_4 var fileDescriptor_4214261f6b3f9ed4 = []byte{ // 667 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xdd, 0x4e, 0x13, 0x41, - 0x14, 0xee, 0x52, 0xa4, 0x70, 0x30, 0x10, 0x26, 0x4d, 0xdc, 0x2e, 0x64, 0x21, 0x6b, 0x24, 0x4d, - 0x4c, 0x77, 0xa1, 0x1a, 0xbc, 0xd0, 0x44, 0x29, 0x9a, 0xa0, 0xb1, 0x51, 0x97, 0x44, 0x13, 0x6f, - 0x70, 0xdb, 0x1d, 0x86, 0x89, 0x74, 0xcf, 0xba, 0x33, 0x6d, 0xe8, 0x5b, 0x18, 0x1f, 0xc0, 0x2b, - 0x1f, 0x81, 0x57, 0x30, 0x21, 0x5e, 0x11, 0xaf,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0xee, 0xed, 0x06, 0xe3, 0xf2, - 0xb0, 0xdd, 0xb0, 0x9b, 0xd8, 0x52, 0x0f, 0x81, 0xfa, 0xa8, 0x08, 0xff, 0xbd, 0x73, 0x1c, 0x3f, - 0x2b, 0xb2, 0x1b, 0x52, 0x91, 0x3e, 0x2e, 0x8d, 0x99, 0xf8, 0xff, 0xec, 0xce, 0x9f, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x10, 0x5f, 0xaf, 0xf2, 0xca, 0x06, 0x00, 0x00, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcf, 0x6e, 0xd3, 0x4e, + 0x10, 0x8e, 0x9b, 0xfe, 0x9a, 0x76, 0xfa, 0x53, 0xab, 0xae, 0x22, 0xe1, 0xb8, 0x95, 0x5b, 0x19, + 0x51, 0x45, 0x42, 0xb1, 0xdb, 0x80, 0xca, 0x01, 0x0e, 0x34, 0x05, 0xa9, 0x20, 0x22, 0xc0, 0x95, + 0x40, 0xe2, 0x52, 0x9c, 0x78, 0xbb, 0x5d, 0xd1, 0x78, 0x8c, 0x77, 0x13, 0x35, 0x6f, 0x81, 0x78, + 0x00, 0x4e, 0x3c, 0x42, 0x5f, 0x01, 0xa9, 0xe2, 0x54, 0x71, 0xe2, 0x02, 0x42, 0xed, 0x8b, 0x20, + 0xdb, 0x6b, 0x17, 0x9a, 0x7f, 0x3d, 0x70, 0x8a, 0x33, 0xdf, 0xf7, 0xcd, 0x7c, 0x33, 0x9a, 0xb1, + 0x61, 0xb9, 0x8d, 0xa2, 0x83, 0xc2, 0x61, 0xd8, 0x73, 0x7a, 0x9b, 0x2d, 0x2a, 0xbd, 0xba, 0x23, + 0x8f, 0xed, 0x30, 0x42, 0x89, 0x84, 0xa4, 0xa0, 0xcd, 0xb0, 0x67, 0x2b, 0xd0, 0x30, 0x95, 0xa0, + 0xe5, 0x09, 0xaa, 0x14, 0x9b, 0x4e, 0x1b, 0x79, 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xc3, 0xc4, 0xcb, 0x50, 0x74, 0xab, 0x0c, 0xe4, 0xd2, 0x5f, 0x66, 0xbb, + 0xfe, 0xa3, 0x08, 0xc5, 0xa6, 0x60, 0xe4, 0x00, 0x16, 0xae, 0x5c, 0xef, 0xad, 0x61, 0xc3, 0x19, + 0xb8, 0x0e, 0xa3, 0x76, 0x2d, 0x5a, 0x7e, 0x44, 0x08, 0x4b, 0x83, 0x07, 0x52, 0x1d, 0x91, 0x63, + 0x80, 0x69, 0x6c, 0x5c, 0x97, 0x99, 0x17, 0xdc, 0x85, 0xe9, 0x64, 0xfb, 0x97, 0x47, 0x28, 0x63, + 0xd0, 0xb8, 0x39, 0x06, 0xcc, 0x33, 0xbd, 0x85, 0xff, 0xff, 0xda, 0xcf, 0x71, 0xa2, 0x8c, 0x64, + 0xdc, 0xbe, 0x06, 0x29, 0xaf, 0xf0, 0x12, 0x4a, 0xd9, 0xfe, 0x98, 0x23, 0x74, 0x0a, 0x37, 0xd6, + 0xc7, 0xe3, 0x59, 0xca, 0xc6, 0xd3, 0xd3, 0x73, 0x53, 0x3b, 0x3b, 0x37, 0xb5, 0x5f, 0xe7, 0xa6, + 0xf6, 0xe1, 0xc2, 0x2c, 0x9c, 0x5d, 0x98, 0x85, 0xef, 0x17, 0x66, 0xe1, 0xcd, 0x06, 0xe3, 0xf2, + 0xb0, 0xdb, 0xb2, 0xdb, 0xd8, 0x51, 0xef, 0x79, 0xf5, 0x53, 0x13, 0xfe, 0x3b, 0xe7, 0x38, 0xf9, + 0x6a, 0xc8, 0x7e, 0x48, 0x45, 0xf6, 0xed, 0x68, 0xcd, 0x24, 0xaf, 0xab, 0x3b, 0xbf, 0x03, 0x00, + 0x00, 0xff, 0xff, 0x4b, 0xd7, 0x81, 0xb1, 0xa9, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -986,11 +978,6 @@ func (m *MsgExecLegacyContentResponse) MarshalToSizedBuffer(dAtA []byte) (int, e _ = i var l int _ = l - if m.ProposalId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } return len(dAtA) - i, nil } @@ -1272,9 +1259,6 @@ func (m *MsgExecLegacyContentResponse) Size() (n int) { } var l int _ = l - if m.ProposalId != 0 { - n += 1 + sovTx(uint64(m.ProposalId)) - } return n } @@ -1740,25 +1724,6 @@ func (m *MsgExecLegacyContentResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgExecLegacyContentResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) From a7e06f6fc660223450eb67eed080c7b9ea94c18d Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Fri, 14 Jan 2022 15:01:37 +0100 Subject: [PATCH 24/39] don't leave any empty []sdk.Msg{} --- x/auth/client/testutil/suite.go | 6 +++--- x/auth/middleware/tips_test.go | 3 ++- x/gov/abci_test.go | 14 +++++++------- x/gov/client/cli/tx.go | 2 ++ x/gov/common_test.go | 15 ++++++++++++++- x/gov/genesis_test.go | 5 ++--- x/gov/keeper/common_test.go | 8 +++++++- x/gov/keeper/grpc_query_test.go | 6 +++++- x/gov/keeper/vote_test.go | 2 +- x/gov/module.go | 2 ++ 10 files changed, 45 insertions(+), 18 deletions(-) diff --git a/x/auth/client/testutil/suite.go b/x/auth/client/testutil/suite.go index b1c0a1f0b3a1..9120e21a5539 100644 --- a/x/auth/client/testutil/suite.go +++ b/x/auth/client/testutil/suite.go @@ -35,7 +35,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" govtestutil "github.com/cosmos/cosmos-sdk/x/gov/client/testutil" - v1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) type IntegrationTestSuite struct { @@ -1508,7 +1508,7 @@ func (s *IntegrationTestSuite) TestAuxSigner() { val.Address.String(), "test", "test desc", - v1beta1.ProposalTypeText, + govtypes.ProposalTypeText, tc.args..., ) if tc.expectErr { @@ -1752,7 +1752,7 @@ func (s *IntegrationTestSuite) TestAuxToFee() { tipper.String(), "test", "test desc", - v1beta1.ProposalTypeText, + govtypes.ProposalTypeText, tc.tipperArgs..., ) diff --git a/x/auth/middleware/tips_test.go b/x/auth/middleware/tips_test.go index 136c393de93c..7169fbf76f09 100644 --- a/x/auth/middleware/tips_test.go +++ b/x/auth/middleware/tips_test.go @@ -13,6 +13,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) @@ -32,7 +33,7 @@ func (s *MWTestSuite) setupAcctsForTips(ctx sdk.Context) (sdk.Context, []testAcc s.Require().NoError(err) // Create dummy proposal for tipper to vote on. - prop, err := govtypes.NewProposal([]sdk.Msg{}, 1, time.Now(), time.Now().Add(time.Hour)) + prop, err := govtypes.NewProposal([]sdk.Msg{banktypes.NewMsgSend(accts[0].acc.GetAddress(), accts[0].acc.GetAddress(), initialRegens)}, 1, time.Now(), time.Now().Add(time.Hour)) s.Require().NoError(err) s.app.GovKeeper.SetProposal(ctx, prop) s.app.GovKeeper.ActivateVotingPeriod(ctx, prop) diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 77fbf0a01912..9b14f1a6455f 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -34,7 +34,7 @@ func TestTickExpiredDepositPeriod(t *testing.T) { inactiveQueue.Close() newProposalMsg, err := v1beta2.NewMsgSubmitProposal( - []sdk.Msg{}, + []sdk.Msg{mkTestLegacyContent(t)}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0].String(), ) @@ -86,7 +86,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { inactiveQueue.Close() newProposalMsg, err := v1beta2.NewMsgSubmitProposal( - []sdk.Msg{}, + []sdk.Msg{mkTestLegacyContent(t)}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0].String(), ) @@ -109,7 +109,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { inactiveQueue.Close() newProposalMsg2, err := v1beta2.NewMsgSubmitProposal( - []sdk.Msg{}, + []sdk.Msg{mkTestLegacyContent(t)}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0].String(), ) @@ -166,7 +166,7 @@ func TestTickPassedDepositPeriod(t *testing.T) { activeQueue.Close() newProposalMsg, err := v1beta2.NewMsgSubmitProposal( - []sdk.Msg{}, + []sdk.Msg{mkTestLegacyContent(t)}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0].String(), ) @@ -221,7 +221,7 @@ func TestTickPassedVotingPeriod(t *testing.T) { activeQueue.Close() proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 5))} - newProposalMsg, err := v1beta2.NewMsgSubmitProposal([]sdk.Msg{}, proposalCoins, addrs[0].String()) + newProposalMsg, err := v1beta2.NewMsgSubmitProposal([]sdk.Msg{mkTestLegacyContent(t)}, proposalCoins, addrs[0].String()) require.NoError(t, err) wrapCtx := sdk.WrapSDKContext(ctx) @@ -289,7 +289,7 @@ func TestProposalPassedEndblocker(t *testing.T) { require.NotNil(t, macc) initialModuleAccCoins := app.BankKeeper.GetAllBalances(ctx, macc.GetAddress()) - proposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{}) + proposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}) require.NoError(t, err) proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 10))} @@ -339,7 +339,7 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) { // Create a proposal where the handler will pass for the test proposal // because the value of contextKeyBadProposal is true. ctx = ctx.WithValue(contextKeyBadProposal, true) - proposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{}) + proposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}) require.NoError(t, err) proposalCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 10))) diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index 304d18b5466a..ecec13bd6cd9 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -61,6 +61,8 @@ func NewTxCmd(propCmds []*cobra.Command) *cobra.Command { RunE: client.ValidateCmd, } + // TODO Add CLI for new submit proposal + // https://github.com/cosmos/cosmos-sdk/issues/10952 cmdSubmitProp := NewCmdSubmitProposal() for _, propCmd := range propCmds { flags.AddTxFlagsToCmd(propCmd) diff --git a/x/gov/common_test.go b/x/gov/common_test.go index b7134cd1859e..a6a57ce90148 100644 --- a/x/gov/common_test.go +++ b/x/gov/common_test.go @@ -4,21 +4,34 @@ import ( "bytes" "log" "sort" + "testing" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/stretchr/testify/require" ) var ( valTokens = sdk.TokensFromConsensusPower(42, sdk.DefaultPowerReduction) - TestLegacyProposal = v1beta1.NewTextProposal("Test", "description") + TestProposal = v1beta1.NewTextProposal("Test", "description") TestDescription = stakingtypes.NewDescription("T", "E", "S", "T", "Z") TestCommissionRates = stakingtypes.NewCommissionRates(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()) ) +// mkTestLegacyContent creates a MsgExecLegacyContent for testing purposes. +func mkTestLegacyContent(t *testing.T) *v1beta2.MsgExecLegacyContent { + msgContent, err := v1beta2.NewLegacyContent(TestProposal, authtypes.NewModuleAddress(types.ModuleName).String()) + require.NoError(t, err) + + return msgContent +} + // SortAddresses - Sorts Addresses func SortAddresses(addrs []sdk.AccAddress) { byteAddrs := make([][]byte, len(addrs)) diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index c450889484f8..2ef487a64910 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -34,13 +34,12 @@ func TestImportExportQueues(t *testing.T) { app.BeginBlock(abci.RequestBeginBlock{Header: header}) ctx = app.BaseApp.NewContext(false, tmproto.Header{}) - // Create two proposals, put the second into the voting period - proposal1, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{}) + proposal1, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}) require.NoError(t, err) proposalID1 := proposal1.ProposalId - proposal2, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{}) + proposal2, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}) require.NoError(t, err) proposalID2 := proposal2.ProposalId diff --git a/x/gov/keeper/common_test.go b/x/gov/keeper/common_test.go index 4531fe3e1e60..abb4d8624338 100644 --- a/x/gov/keeper/common_test.go +++ b/x/gov/keeper/common_test.go @@ -6,14 +6,20 @@ import ( "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) var ( - TestProposal = []sdk.Msg{} + _, _, addr = testdata.KeyTestPubAddr() + govAcct = authtypes.NewModuleAddress(types.ModuleName) + TestProposal = []sdk.Msg{banktypes.NewMsgSend(govAcct, addr, sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(1000))))} ) func createValidators(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers []int64) ([]sdk.AccAddress, []sdk.ValAddress) { diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index e8642b3869aa..a0d4b26fdfa5 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -7,6 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) @@ -48,7 +49,10 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposal() { "valid request", func() { req = &v1beta2.QueryProposalRequest{ProposalId: 1} - submittedProposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{}) + testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") + msgContent, err := v1beta2.NewLegacyContent(testProposal, govAcct.String()) + suite.Require().NoError(err) + submittedProposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}) suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) diff --git a/x/gov/keeper/vote_test.go b/x/gov/keeper/vote_test.go index b4d17fd93198..1ca73f64d2e0 100644 --- a/x/gov/keeper/vote_test.go +++ b/x/gov/keeper/vote_test.go @@ -17,7 +17,7 @@ func TestVotes(t *testing.T) { addrs := simapp.AddTestAddrsIncremental(app, ctx, 5, sdk.NewInt(30000000)) - tp := []sdk.Msg{} + tp := TestProposal proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) require.NoError(t, err) proposalID := proposal.ProposalId diff --git a/x/gov/module.go b/x/gov/module.go index d93cad4b1df2..3e2002efe342 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -160,6 +160,8 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { v1beta1.RegisterMsgServer(cfg.MsgServer(), keeper.NewLegacyMsgServerImpl(am.accountKeeper.GetModuleAddress(types.ModuleName).String(), msgServer)) v1beta2.RegisterMsgServer(cfg.MsgServer(), msgServer) + // TODO Register v1beta1 query server. + // https://github.com/cosmos/cosmos-sdk/issues/10951 v1beta2.RegisterQueryServer(cfg.QueryServer(), am.keeper) m := keeper.NewMigrator(am.keeper) From e6f2e7c4caaf3b3563f74a91e83f893d4f02eeee Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Fri, 14 Jan 2022 17:02:34 +0100 Subject: [PATCH 25/39] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54a6b6c18a68..db36350b0623 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -116,6 +116,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#10748](https://github.com/cosmos/cosmos-sdk/pull/10748) Move legacy `x/gov` api to `v1beta1` directory. * [\#10816](https://github.com/cosmos/cosmos-sdk/pull/10816) Reuse blocked addresses from the bank module. No need to pass them to distribution. * [\#10852](https://github.com/cosmos/cosmos-sdk/pull/10852) Move `x/gov/types` to `x/gov/types/v1beta2`. +* [\#10868](https://github.com/cosmos/cosmos-sdk/pull/10868) The Gov keeper accepts now a mandatory last argument, the ServiceMsgRouter. ### Client Breaking Changes @@ -207,6 +208,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#10725](https://github.com/cosmos/cosmos-sdk/pull/10725) populate `ctx.ConsensusParams` for begin/end blockers. * [#10763](https://github.com/cosmos/cosmos-sdk/pull/10763) modify the fields in `TallyParams` to use `string` instead of `bytes` * [#10770](https://github.com/cosmos/cosmos-sdk/pull/10770) revert tx when block gas limit exceeded +* [\#10868](https://github.com/cosmos/cosmos-sdk/pull/10868) Bump gov to v1beta2. Both v1beta1 and v1beta2 queries and Msgs are accepted. ### Deprecated From cf89ee0bfba3122a1757a960c59bc8fbd122cb2a Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Mon, 17 Jan 2022 14:55:35 +0100 Subject: [PATCH 26/39] Make proto-gen --- api/cosmos/gov/v1beta2/tx.pulsar.go | 1222 +++++++++++++++++++--- api/cosmos/gov/v1beta2/tx_grpc.pb.go | 40 + api/cosmos/slashing/v1beta1/tx.pulsar.go | 54 +- x/gov/types/v1beta1/gov.pb.go | 89 -- 4 files changed, 1165 insertions(+), 240 deletions(-) diff --git a/api/cosmos/gov/v1beta2/tx.pulsar.go b/api/cosmos/gov/v1beta2/tx.pulsar.go index d51bd32924d4..44d117caaf29 100644 --- a/api/cosmos/gov/v1beta2/tx.pulsar.go +++ b/api/cosmos/gov/v1beta2/tx.pulsar.go @@ -1115,6 +1115,861 @@ func (x *fastReflection_MsgSubmitProposalResponse) ProtoMethods() *protoiface.Me } } +var ( + md_MsgExecLegacyContent protoreflect.MessageDescriptor + fd_MsgExecLegacyContent_content protoreflect.FieldDescriptor + fd_MsgExecLegacyContent_authority protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_gov_v1beta2_tx_proto_init() + md_MsgExecLegacyContent = File_cosmos_gov_v1beta2_tx_proto.Messages().ByName("MsgExecLegacyContent") + fd_MsgExecLegacyContent_content = md_MsgExecLegacyContent.Fields().ByName("content") + fd_MsgExecLegacyContent_authority = md_MsgExecLegacyContent.Fields().ByName("authority") +} + +var _ protoreflect.Message = (*fastReflection_MsgExecLegacyContent)(nil) + +type fastReflection_MsgExecLegacyContent MsgExecLegacyContent + +func (x *MsgExecLegacyContent) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgExecLegacyContent)(x) +} + +func (x *MsgExecLegacyContent) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgExecLegacyContent_messageType fastReflection_MsgExecLegacyContent_messageType +var _ protoreflect.MessageType = fastReflection_MsgExecLegacyContent_messageType{} + +type fastReflection_MsgExecLegacyContent_messageType struct{} + +func (x fastReflection_MsgExecLegacyContent_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgExecLegacyContent)(nil) +} +func (x fastReflection_MsgExecLegacyContent_messageType) New() protoreflect.Message { + return new(fastReflection_MsgExecLegacyContent) +} +func (x fastReflection_MsgExecLegacyContent_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgExecLegacyContent +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgExecLegacyContent) Descriptor() protoreflect.MessageDescriptor { + return md_MsgExecLegacyContent +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgExecLegacyContent) Type() protoreflect.MessageType { + return _fastReflection_MsgExecLegacyContent_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgExecLegacyContent) New() protoreflect.Message { + return new(fastReflection_MsgExecLegacyContent) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgExecLegacyContent) Interface() protoreflect.ProtoMessage { + return (*MsgExecLegacyContent)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgExecLegacyContent) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Content != nil { + value := protoreflect.ValueOfMessage(x.Content.ProtoReflect()) + if !f(fd_MsgExecLegacyContent_content, value) { + return + } + } + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgExecLegacyContent_authority, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgExecLegacyContent) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.gov.v1beta2.MsgExecLegacyContent.content": + return x.Content != nil + case "cosmos.gov.v1beta2.MsgExecLegacyContent.authority": + return x.Authority != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.MsgExecLegacyContent")) + } + panic(fmt.Errorf("message cosmos.gov.v1beta2.MsgExecLegacyContent does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgExecLegacyContent) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.gov.v1beta2.MsgExecLegacyContent.content": + x.Content = nil + case "cosmos.gov.v1beta2.MsgExecLegacyContent.authority": + x.Authority = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.MsgExecLegacyContent")) + } + panic(fmt.Errorf("message cosmos.gov.v1beta2.MsgExecLegacyContent does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgExecLegacyContent) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.gov.v1beta2.MsgExecLegacyContent.content": + value := x.Content + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.gov.v1beta2.MsgExecLegacyContent.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.MsgExecLegacyContent")) + } + panic(fmt.Errorf("message cosmos.gov.v1beta2.MsgExecLegacyContent does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgExecLegacyContent) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.gov.v1beta2.MsgExecLegacyContent.content": + x.Content = value.Message().Interface().(*anypb.Any) + case "cosmos.gov.v1beta2.MsgExecLegacyContent.authority": + x.Authority = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.MsgExecLegacyContent")) + } + panic(fmt.Errorf("message cosmos.gov.v1beta2.MsgExecLegacyContent does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgExecLegacyContent) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.gov.v1beta2.MsgExecLegacyContent.content": + if x.Content == nil { + x.Content = new(anypb.Any) + } + return protoreflect.ValueOfMessage(x.Content.ProtoReflect()) + case "cosmos.gov.v1beta2.MsgExecLegacyContent.authority": + panic(fmt.Errorf("field authority of message cosmos.gov.v1beta2.MsgExecLegacyContent is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.MsgExecLegacyContent")) + } + panic(fmt.Errorf("message cosmos.gov.v1beta2.MsgExecLegacyContent does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgExecLegacyContent) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.gov.v1beta2.MsgExecLegacyContent.content": + m := new(anypb.Any) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.gov.v1beta2.MsgExecLegacyContent.authority": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.MsgExecLegacyContent")) + } + panic(fmt.Errorf("message cosmos.gov.v1beta2.MsgExecLegacyContent does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgExecLegacyContent) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.gov.v1beta2.MsgExecLegacyContent", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgExecLegacyContent) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgExecLegacyContent) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgExecLegacyContent) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgExecLegacyContent) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgExecLegacyContent) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Content != nil { + l = options.Size(x.Content) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgExecLegacyContent) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0x12 + } + if x.Content != nil { + encoded, err := options.Marshal(x.Content) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgExecLegacyContent) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgExecLegacyContent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgExecLegacyContent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Content == nil { + x.Content = &anypb.Any{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Content); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgExecLegacyContentResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_gov_v1beta2_tx_proto_init() + md_MsgExecLegacyContentResponse = File_cosmos_gov_v1beta2_tx_proto.Messages().ByName("MsgExecLegacyContentResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgExecLegacyContentResponse)(nil) + +type fastReflection_MsgExecLegacyContentResponse MsgExecLegacyContentResponse + +func (x *MsgExecLegacyContentResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgExecLegacyContentResponse)(x) +} + +func (x *MsgExecLegacyContentResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgExecLegacyContentResponse_messageType fastReflection_MsgExecLegacyContentResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgExecLegacyContentResponse_messageType{} + +type fastReflection_MsgExecLegacyContentResponse_messageType struct{} + +func (x fastReflection_MsgExecLegacyContentResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgExecLegacyContentResponse)(nil) +} +func (x fastReflection_MsgExecLegacyContentResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgExecLegacyContentResponse) +} +func (x fastReflection_MsgExecLegacyContentResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgExecLegacyContentResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgExecLegacyContentResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgExecLegacyContentResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgExecLegacyContentResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgExecLegacyContentResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgExecLegacyContentResponse) New() protoreflect.Message { + return new(fastReflection_MsgExecLegacyContentResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgExecLegacyContentResponse) Interface() protoreflect.ProtoMessage { + return (*MsgExecLegacyContentResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgExecLegacyContentResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgExecLegacyContentResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.MsgExecLegacyContentResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1beta2.MsgExecLegacyContentResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgExecLegacyContentResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.MsgExecLegacyContentResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1beta2.MsgExecLegacyContentResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgExecLegacyContentResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.MsgExecLegacyContentResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1beta2.MsgExecLegacyContentResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgExecLegacyContentResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.MsgExecLegacyContentResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1beta2.MsgExecLegacyContentResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgExecLegacyContentResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.MsgExecLegacyContentResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1beta2.MsgExecLegacyContentResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgExecLegacyContentResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1beta2.MsgExecLegacyContentResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1beta2.MsgExecLegacyContentResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgExecLegacyContentResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.gov.v1beta2.MsgExecLegacyContentResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgExecLegacyContentResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgExecLegacyContentResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgExecLegacyContentResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgExecLegacyContentResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgExecLegacyContentResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgExecLegacyContentResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgExecLegacyContentResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgExecLegacyContentResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgExecLegacyContentResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + var ( md_MsgVote protoreflect.MessageDescriptor fd_MsgVote_proposal_id protoreflect.FieldDescriptor @@ -1139,7 +1994,7 @@ func (x *MsgVote) ProtoReflect() protoreflect.Message { } func (x *MsgVote) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[2] + mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1649,7 +2504,7 @@ func (x *MsgVoteResponse) ProtoReflect() protoreflect.Message { } func (x *MsgVoteResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[3] + mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2062,7 +2917,7 @@ func (x *MsgVoteWeighted) ProtoReflect() protoreflect.Message { } func (x *MsgVoteWeighted) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[4] + mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2611,7 +3466,7 @@ func (x *MsgVoteWeightedResponse) ProtoReflect() protoreflect.Message { } func (x *MsgVoteWeightedResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[5] + mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3024,7 +3879,7 @@ func (x *MsgDeposit) ProtoReflect() protoreflect.Message { } func (x *MsgDeposit) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[6] + mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3573,7 +4428,7 @@ func (x *MsgDepositResponse) ProtoReflect() protoreflect.Message { } func (x *MsgDepositResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[7] + mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4013,6 +4868,80 @@ func (x *MsgSubmitProposalResponse) GetProposalId() uint64 { return 0 } +// MsgExecLegacyContent is used to wrap the legacy content field into a message. +// This ensures backwards compatibility with v1beta1.MsgSubmitProposal. +type MsgExecLegacyContent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // content is the proposal's content. + Content *anypb.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` + // authority must be the gov module address. + Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (x *MsgExecLegacyContent) Reset() { + *x = MsgExecLegacyContent{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgExecLegacyContent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgExecLegacyContent) ProtoMessage() {} + +// Deprecated: Use MsgExecLegacyContent.ProtoReflect.Descriptor instead. +func (*MsgExecLegacyContent) Descriptor() ([]byte, []int) { + return file_cosmos_gov_v1beta2_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgExecLegacyContent) GetContent() *anypb.Any { + if x != nil { + return x.Content + } + return nil +} + +func (x *MsgExecLegacyContent) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. +type MsgExecLegacyContentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgExecLegacyContentResponse) Reset() { + *x = MsgExecLegacyContentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgExecLegacyContentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgExecLegacyContentResponse) ProtoMessage() {} + +// Deprecated: Use MsgExecLegacyContentResponse.ProtoReflect.Descriptor instead. +func (*MsgExecLegacyContentResponse) Descriptor() ([]byte, []int) { + return file_cosmos_gov_v1beta2_tx_proto_rawDescGZIP(), []int{3} +} + // MsgVote defines a message to cast a vote. type MsgVote struct { state protoimpl.MessageState @@ -4027,7 +4956,7 @@ type MsgVote struct { func (x *MsgVote) Reset() { *x = MsgVote{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[2] + mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4041,7 +4970,7 @@ func (*MsgVote) ProtoMessage() {} // Deprecated: Use MsgVote.ProtoReflect.Descriptor instead. func (*MsgVote) Descriptor() ([]byte, []int) { - return file_cosmos_gov_v1beta2_tx_proto_rawDescGZIP(), []int{2} + return file_cosmos_gov_v1beta2_tx_proto_rawDescGZIP(), []int{4} } func (x *MsgVote) GetProposalId() uint64 { @@ -4075,7 +5004,7 @@ type MsgVoteResponse struct { func (x *MsgVoteResponse) Reset() { *x = MsgVoteResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[3] + mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4089,7 +5018,7 @@ func (*MsgVoteResponse) ProtoMessage() {} // Deprecated: Use MsgVoteResponse.ProtoReflect.Descriptor instead. func (*MsgVoteResponse) Descriptor() ([]byte, []int) { - return file_cosmos_gov_v1beta2_tx_proto_rawDescGZIP(), []int{3} + return file_cosmos_gov_v1beta2_tx_proto_rawDescGZIP(), []int{5} } // MsgVoteWeighted defines a message to cast a vote. @@ -4108,7 +5037,7 @@ type MsgVoteWeighted struct { func (x *MsgVoteWeighted) Reset() { *x = MsgVoteWeighted{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[4] + mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4122,7 +5051,7 @@ func (*MsgVoteWeighted) ProtoMessage() {} // Deprecated: Use MsgVoteWeighted.ProtoReflect.Descriptor instead. func (*MsgVoteWeighted) Descriptor() ([]byte, []int) { - return file_cosmos_gov_v1beta2_tx_proto_rawDescGZIP(), []int{4} + return file_cosmos_gov_v1beta2_tx_proto_rawDescGZIP(), []int{6} } func (x *MsgVoteWeighted) GetProposalId() uint64 { @@ -4158,7 +5087,7 @@ type MsgVoteWeightedResponse struct { func (x *MsgVoteWeightedResponse) Reset() { *x = MsgVoteWeightedResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[5] + mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4172,7 +5101,7 @@ func (*MsgVoteWeightedResponse) ProtoMessage() {} // Deprecated: Use MsgVoteWeightedResponse.ProtoReflect.Descriptor instead. func (*MsgVoteWeightedResponse) Descriptor() ([]byte, []int) { - return file_cosmos_gov_v1beta2_tx_proto_rawDescGZIP(), []int{5} + return file_cosmos_gov_v1beta2_tx_proto_rawDescGZIP(), []int{7} } // MsgDeposit defines a message to submit a deposit to an existing proposal. @@ -4189,7 +5118,7 @@ type MsgDeposit struct { func (x *MsgDeposit) Reset() { *x = MsgDeposit{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[6] + mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4203,7 +5132,7 @@ func (*MsgDeposit) ProtoMessage() {} // Deprecated: Use MsgDeposit.ProtoReflect.Descriptor instead. func (*MsgDeposit) Descriptor() ([]byte, []int) { - return file_cosmos_gov_v1beta2_tx_proto_rawDescGZIP(), []int{6} + return file_cosmos_gov_v1beta2_tx_proto_rawDescGZIP(), []int{8} } func (x *MsgDeposit) GetProposalId() uint64 { @@ -4237,7 +5166,7 @@ type MsgDepositResponse struct { func (x *MsgDepositResponse) Reset() { *x = MsgDepositResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[7] + mi := &file_cosmos_gov_v1beta2_tx_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4251,7 +5180,7 @@ func (*MsgDepositResponse) ProtoMessage() {} // Deprecated: Use MsgDepositResponse.ProtoReflect.Descriptor instead. func (*MsgDepositResponse) Descriptor() ([]byte, []int) { - return file_cosmos_gov_v1beta2_tx_proto_rawDescGZIP(), []int{7} + return file_cosmos_gov_v1beta2_tx_proto_rawDescGZIP(), []int{9} } var File_cosmos_gov_v1beta2_tx_proto protoreflect.FileDescriptor @@ -4285,77 +5214,93 @@ var file_cosmos_gov_v1beta2_tx_proto_rawDesc = []byte{ 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, - 0x64, 0x22, 0x92, 0x01, 0x0a, 0x07, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x1f, 0x0a, - 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x2e, - 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, - 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x36, - 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x32, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x11, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa4, 0x01, 0x0a, 0x0f, 0x4d, 0x73, - 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x12, 0x1f, 0x0a, + 0x64, 0x22, 0x71, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, + 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, + 0x42, 0x0b, 0xca, 0xb4, 0x2d, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x22, 0x1e, 0x0a, 0x1c, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, + 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x92, 0x01, 0x0a, 0x07, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, + 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, + 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, + 0x72, 0x12, 0x36, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x11, 0x0a, 0x0f, 0x4d, 0x73, 0x67, + 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa4, 0x01, 0x0a, + 0x0f, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, + 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, + 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, + 0x72, 0x12, 0x40, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, + 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9e, + 0x01, 0x0a, 0x0a, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x2e, - 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, - 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x40, - 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x32, 0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, - 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, - 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x0a, - 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x09, 0x64, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, - 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x12, 0x37, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, - 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x14, 0x0a, 0x12, - 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x32, 0xec, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x66, 0x0a, 0x0e, 0x53, 0x75, - 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x25, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x61, 0x6c, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, - 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x48, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x1b, 0x2e, 0x63, 0x6f, 0x73, + 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x36, + 0x0a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x64, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x37, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, + 0x14, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xdd, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x66, 0x0a, + 0x0e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, + 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x53, + 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x11, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, + 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, - 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, - 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x0c, - 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x12, 0x23, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, - 0x64, 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, - 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, - 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, - 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x42, 0xcb, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x42, 0x07, 0x54, 0x78, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x3b, 0x67, 0x6f, 0x76, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x12, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x32, 0xca, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0xe2, 0x02, 0x1e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, + 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, + 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x1b, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x1a, 0x23, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, + 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x60, 0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, + 0x12, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x65, 0x64, 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, + 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, + 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x51, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1e, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x1a, 0x26, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xcb, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, + 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, + 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0xa2, 0x02, 0x03, 0x43, 0x47, + 0x58, 0xaa, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0xca, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0xe2, 0x02, 0x1e, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4370,40 +5315,45 @@ func file_cosmos_gov_v1beta2_tx_proto_rawDescGZIP() []byte { return file_cosmos_gov_v1beta2_tx_proto_rawDescData } -var file_cosmos_gov_v1beta2_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_cosmos_gov_v1beta2_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_cosmos_gov_v1beta2_tx_proto_goTypes = []interface{}{ - (*MsgSubmitProposal)(nil), // 0: cosmos.gov.v1beta2.MsgSubmitProposal - (*MsgSubmitProposalResponse)(nil), // 1: cosmos.gov.v1beta2.MsgSubmitProposalResponse - (*MsgVote)(nil), // 2: cosmos.gov.v1beta2.MsgVote - (*MsgVoteResponse)(nil), // 3: cosmos.gov.v1beta2.MsgVoteResponse - (*MsgVoteWeighted)(nil), // 4: cosmos.gov.v1beta2.MsgVoteWeighted - (*MsgVoteWeightedResponse)(nil), // 5: cosmos.gov.v1beta2.MsgVoteWeightedResponse - (*MsgDeposit)(nil), // 6: cosmos.gov.v1beta2.MsgDeposit - (*MsgDepositResponse)(nil), // 7: cosmos.gov.v1beta2.MsgDepositResponse - (*anypb.Any)(nil), // 8: google.protobuf.Any - (*v1beta1.Coin)(nil), // 9: cosmos.base.v1beta1.Coin - (VoteOption)(0), // 10: cosmos.gov.v1beta2.VoteOption - (*WeightedVoteOption)(nil), // 11: cosmos.gov.v1beta2.WeightedVoteOption + (*MsgSubmitProposal)(nil), // 0: cosmos.gov.v1beta2.MsgSubmitProposal + (*MsgSubmitProposalResponse)(nil), // 1: cosmos.gov.v1beta2.MsgSubmitProposalResponse + (*MsgExecLegacyContent)(nil), // 2: cosmos.gov.v1beta2.MsgExecLegacyContent + (*MsgExecLegacyContentResponse)(nil), // 3: cosmos.gov.v1beta2.MsgExecLegacyContentResponse + (*MsgVote)(nil), // 4: cosmos.gov.v1beta2.MsgVote + (*MsgVoteResponse)(nil), // 5: cosmos.gov.v1beta2.MsgVoteResponse + (*MsgVoteWeighted)(nil), // 6: cosmos.gov.v1beta2.MsgVoteWeighted + (*MsgVoteWeightedResponse)(nil), // 7: cosmos.gov.v1beta2.MsgVoteWeightedResponse + (*MsgDeposit)(nil), // 8: cosmos.gov.v1beta2.MsgDeposit + (*MsgDepositResponse)(nil), // 9: cosmos.gov.v1beta2.MsgDepositResponse + (*anypb.Any)(nil), // 10: google.protobuf.Any + (*v1beta1.Coin)(nil), // 11: cosmos.base.v1beta1.Coin + (VoteOption)(0), // 12: cosmos.gov.v1beta2.VoteOption + (*WeightedVoteOption)(nil), // 13: cosmos.gov.v1beta2.WeightedVoteOption } var file_cosmos_gov_v1beta2_tx_proto_depIdxs = []int32{ - 8, // 0: cosmos.gov.v1beta2.MsgSubmitProposal.messages:type_name -> google.protobuf.Any - 9, // 1: cosmos.gov.v1beta2.MsgSubmitProposal.initial_deposit:type_name -> cosmos.base.v1beta1.Coin - 10, // 2: cosmos.gov.v1beta2.MsgVote.option:type_name -> cosmos.gov.v1beta2.VoteOption - 11, // 3: cosmos.gov.v1beta2.MsgVoteWeighted.options:type_name -> cosmos.gov.v1beta2.WeightedVoteOption - 9, // 4: cosmos.gov.v1beta2.MsgDeposit.amount:type_name -> cosmos.base.v1beta1.Coin - 0, // 5: cosmos.gov.v1beta2.Msg.SubmitProposal:input_type -> cosmos.gov.v1beta2.MsgSubmitProposal - 2, // 6: cosmos.gov.v1beta2.Msg.Vote:input_type -> cosmos.gov.v1beta2.MsgVote - 4, // 7: cosmos.gov.v1beta2.Msg.VoteWeighted:input_type -> cosmos.gov.v1beta2.MsgVoteWeighted - 6, // 8: cosmos.gov.v1beta2.Msg.Deposit:input_type -> cosmos.gov.v1beta2.MsgDeposit - 1, // 9: cosmos.gov.v1beta2.Msg.SubmitProposal:output_type -> cosmos.gov.v1beta2.MsgSubmitProposalResponse - 3, // 10: cosmos.gov.v1beta2.Msg.Vote:output_type -> cosmos.gov.v1beta2.MsgVoteResponse - 5, // 11: cosmos.gov.v1beta2.Msg.VoteWeighted:output_type -> cosmos.gov.v1beta2.MsgVoteWeightedResponse - 7, // 12: cosmos.gov.v1beta2.Msg.Deposit:output_type -> cosmos.gov.v1beta2.MsgDepositResponse - 9, // [9:13] is the sub-list for method output_type - 5, // [5:9] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 10, // 0: cosmos.gov.v1beta2.MsgSubmitProposal.messages:type_name -> google.protobuf.Any + 11, // 1: cosmos.gov.v1beta2.MsgSubmitProposal.initial_deposit:type_name -> cosmos.base.v1beta1.Coin + 10, // 2: cosmos.gov.v1beta2.MsgExecLegacyContent.content:type_name -> google.protobuf.Any + 12, // 3: cosmos.gov.v1beta2.MsgVote.option:type_name -> cosmos.gov.v1beta2.VoteOption + 13, // 4: cosmos.gov.v1beta2.MsgVoteWeighted.options:type_name -> cosmos.gov.v1beta2.WeightedVoteOption + 11, // 5: cosmos.gov.v1beta2.MsgDeposit.amount:type_name -> cosmos.base.v1beta1.Coin + 0, // 6: cosmos.gov.v1beta2.Msg.SubmitProposal:input_type -> cosmos.gov.v1beta2.MsgSubmitProposal + 2, // 7: cosmos.gov.v1beta2.Msg.ExecLegacyContent:input_type -> cosmos.gov.v1beta2.MsgExecLegacyContent + 4, // 8: cosmos.gov.v1beta2.Msg.Vote:input_type -> cosmos.gov.v1beta2.MsgVote + 6, // 9: cosmos.gov.v1beta2.Msg.VoteWeighted:input_type -> cosmos.gov.v1beta2.MsgVoteWeighted + 8, // 10: cosmos.gov.v1beta2.Msg.Deposit:input_type -> cosmos.gov.v1beta2.MsgDeposit + 1, // 11: cosmos.gov.v1beta2.Msg.SubmitProposal:output_type -> cosmos.gov.v1beta2.MsgSubmitProposalResponse + 3, // 12: cosmos.gov.v1beta2.Msg.ExecLegacyContent:output_type -> cosmos.gov.v1beta2.MsgExecLegacyContentResponse + 5, // 13: cosmos.gov.v1beta2.Msg.Vote:output_type -> cosmos.gov.v1beta2.MsgVoteResponse + 7, // 14: cosmos.gov.v1beta2.Msg.VoteWeighted:output_type -> cosmos.gov.v1beta2.MsgVoteWeightedResponse + 9, // 15: cosmos.gov.v1beta2.Msg.Deposit:output_type -> cosmos.gov.v1beta2.MsgDepositResponse + 11, // [11:16] is the sub-list for method output_type + 6, // [6:11] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_cosmos_gov_v1beta2_tx_proto_init() } @@ -4438,7 +5388,7 @@ func file_cosmos_gov_v1beta2_tx_proto_init() { } } file_cosmos_gov_v1beta2_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgVote); i { + switch v := v.(*MsgExecLegacyContent); i { case 0: return &v.state case 1: @@ -4450,7 +5400,7 @@ func file_cosmos_gov_v1beta2_tx_proto_init() { } } file_cosmos_gov_v1beta2_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgVoteResponse); i { + switch v := v.(*MsgExecLegacyContentResponse); i { case 0: return &v.state case 1: @@ -4462,7 +5412,7 @@ func file_cosmos_gov_v1beta2_tx_proto_init() { } } file_cosmos_gov_v1beta2_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgVoteWeighted); i { + switch v := v.(*MsgVote); i { case 0: return &v.state case 1: @@ -4474,7 +5424,7 @@ func file_cosmos_gov_v1beta2_tx_proto_init() { } } file_cosmos_gov_v1beta2_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgVoteWeightedResponse); i { + switch v := v.(*MsgVoteResponse); i { case 0: return &v.state case 1: @@ -4486,7 +5436,7 @@ func file_cosmos_gov_v1beta2_tx_proto_init() { } } file_cosmos_gov_v1beta2_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgDeposit); i { + switch v := v.(*MsgVoteWeighted); i { case 0: return &v.state case 1: @@ -4498,6 +5448,30 @@ func file_cosmos_gov_v1beta2_tx_proto_init() { } } file_cosmos_gov_v1beta2_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgVoteWeightedResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_gov_v1beta2_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgDeposit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_gov_v1beta2_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgDepositResponse); i { case 0: return &v.state @@ -4516,7 +5490,7 @@ func file_cosmos_gov_v1beta2_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_gov_v1beta2_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 8, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/gov/v1beta2/tx_grpc.pb.go b/api/cosmos/gov/v1beta2/tx_grpc.pb.go index 85f97c4ec933..f3529ba6e953 100644 --- a/api/cosmos/gov/v1beta2/tx_grpc.pb.go +++ b/api/cosmos/gov/v1beta2/tx_grpc.pb.go @@ -24,6 +24,9 @@ const _ = grpc.SupportPackageIsVersion7 type MsgClient interface { // SubmitProposal defines a method to create new proposal given a content. SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) + // ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal + // to execute a legacy content-based proposal. + ExecLegacyContent(ctx context.Context, in *MsgExecLegacyContent, opts ...grpc.CallOption) (*MsgExecLegacyContentResponse, error) // Vote defines a method to add a vote on a specific proposal. Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) // VoteWeighted defines a method to add a weighted vote on a specific proposal. @@ -51,6 +54,15 @@ func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, o return out, nil } +func (c *msgClient) ExecLegacyContent(ctx context.Context, in *MsgExecLegacyContent, opts ...grpc.CallOption) (*MsgExecLegacyContentResponse, error) { + out := new(MsgExecLegacyContentResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Msg/ExecLegacyContent", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) { out := new(MsgVoteResponse) err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta2.Msg/Vote", in, out, opts...) @@ -84,6 +96,9 @@ func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.Ca type MsgServer interface { // SubmitProposal defines a method to create new proposal given a content. SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) + // ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal + // to execute a legacy content-based proposal. + ExecLegacyContent(context.Context, *MsgExecLegacyContent) (*MsgExecLegacyContentResponse, error) // Vote defines a method to add a vote on a specific proposal. Vote(context.Context, *MsgVote) (*MsgVoteResponse, error) // VoteWeighted defines a method to add a weighted vote on a specific proposal. @@ -102,6 +117,9 @@ type UnimplementedMsgServer struct { func (UnimplementedMsgServer) SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitProposal not implemented") } +func (UnimplementedMsgServer) ExecLegacyContent(context.Context, *MsgExecLegacyContent) (*MsgExecLegacyContentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExecLegacyContent not implemented") +} func (UnimplementedMsgServer) Vote(context.Context, *MsgVote) (*MsgVoteResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Vote not implemented") } @@ -142,6 +160,24 @@ func _Msg_SubmitProposal_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _Msg_ExecLegacyContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgExecLegacyContent) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ExecLegacyContent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta2.Msg/ExecLegacyContent", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ExecLegacyContent(ctx, req.(*MsgExecLegacyContent)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgVote) if err := dec(in); err != nil { @@ -207,6 +243,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "SubmitProposal", Handler: _Msg_SubmitProposal_Handler, }, + { + MethodName: "ExecLegacyContent", + Handler: _Msg_ExecLegacyContent_Handler, + }, { MethodName: "Vote", Handler: _Msg_Vote_Handler, diff --git a/api/cosmos/slashing/v1beta1/tx.pulsar.go b/api/cosmos/slashing/v1beta1/tx.pulsar.go index d0b342b0e6db..7eed758e4323 100644 --- a/api/cosmos/slashing/v1beta1/tx.pulsar.go +++ b/api/cosmos/slashing/v1beta1/tx.pulsar.go @@ -808,7 +808,7 @@ type MsgUnjail struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ValidatorAddr string `protobuf:"bytes,1,opt,name=validator_addr,json=validatorAddr,proto3" json:"validator_addr,omitempty"` + ValidatorAddr string `protobuf:"bytes,1,opt,name=validator_addr,json=address,proto3" json:"validator_addr,omitempty"` } func (x *MsgUnjail) Reset() { @@ -874,36 +874,36 @@ var file_cosmos_slashing_v1beta1_tx_proto_rawDesc = []byte{ 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x56, 0x0a, 0x09, - 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x12, 0x3f, 0x0a, 0x0e, 0x76, 0x61, 0x6c, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x50, 0x0a, 0x09, + 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x12, 0x39, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, - 0x98, 0xa0, 0x1f, 0x01, 0x22, 0x13, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6a, 0x61, 0x69, - 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x5f, 0x0a, 0x03, 0x4d, 0x73, 0x67, - 0x12, 0x58, 0x0a, 0x06, 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x73, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0x98, 0xa0, 0x1f, 0x01, 0x22, 0x13, + 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x32, 0x5f, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x58, 0x0a, 0x06, 0x55, 0x6e, + 0x6a, 0x61, 0x69, 0x6c, 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, + 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x1a, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xf2, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x1a, 0x2a, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6a, 0x61, - 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xf2, 0x01, 0x0a, 0x1b, 0x63, - 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, - 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, - 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, - 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, - 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, - 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, - 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, - 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, - 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x23, 0x43, 0x6f, 0x73, 0x6d, + 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x48, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, + 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, + 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, + 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, - 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa8, 0xe2, 0x1e, 0x01, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x61, 0x31, 0xe2, 0x02, 0x23, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xa8, 0xe2, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/x/gov/types/v1beta1/gov.pb.go b/x/gov/types/v1beta1/gov.pb.go index 9b5acca021e1..b17cc188ef18 100644 --- a/x/gov/types/v1beta1/gov.pb.go +++ b/x/gov/types/v1beta1/gov.pb.go @@ -376,11 +376,7 @@ type DepositParams struct { MinDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=min_deposit,json=minDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"min_deposit"` // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 // months. -<<<<<<< HEAD MaxDepositPeriod time.Duration `protobuf:"bytes,2,opt,name=max_deposit_period,json=maxDepositPeriod,proto3,stdduration" json:"max_deposit_period"` -======= - MaxDepositPeriod time.Duration `protobuf:"bytes,2,opt,name=max_deposit_period,json=max_deposit_period,omitempty,proto3,stdduration" json:"max_deposit_period"` ->>>>>>> 5631c16a77e016a78e530745487e65acdec93781 } func (m *DepositParams) Reset() { *m = DepositParams{} } @@ -514,7 +510,6 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1beta1/gov.proto", fileDescriptor_6e82113c1a9a4b7c) } var fileDescriptor_6e82113c1a9a4b7c = []byte{ -<<<<<<< HEAD // 1284 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xc1, 0x6f, 0x13, 0xc7, 0x17, 0xf6, 0xda, 0x8e, 0x93, 0x3c, 0x3b, 0xc9, 0x32, 0x44, 0xe0, 0xf8, 0xf7, 0xeb, 0x7a, 0xe5, @@ -597,90 +592,6 @@ var fileDescriptor_6e82113c1a9a4b7c = []byte{ 0xbd, 0x52, 0x62, 0x5f, 0x5d, 0xfd, 0xcf, 0xa2, 0xdc, 0x63, 0xdf, 0x13, 0xac, 0x34, 0xa3, 0x4f, 0x84, 0x76, 0x8a, 0xf9, 0xf6, 0xe3, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xf2, 0xac, 0xb7, 0x42, 0x72, 0x0c, 0x00, 0x00, -======= - // 1292 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xc1, 0x6f, 0x13, 0xc7, - 0x17, 0xf6, 0xda, 0x8e, 0x93, 0x3c, 0x3b, 0x89, 0x19, 0x22, 0x70, 0xfc, 0xe3, 0xb7, 0x5e, 0xf9, - 0x80, 0x22, 0x44, 0x1c, 0x48, 0x25, 0xa4, 0x86, 0x5e, 0xec, 0x78, 0x53, 0x5c, 0x45, 0xb6, 0xb5, - 0xbb, 0x38, 0xa5, 0x52, 0xbb, 0x5a, 0x7b, 0x07, 0x67, 0x5b, 0xef, 0x8e, 0xbb, 0x3b, 0x0e, 0xe4, - 0xd6, 0x23, 0xf2, 0x89, 0x23, 0x17, 0x4b, 0xa8, 0xbd, 0x54, 0x3d, 0xf3, 0x47, 0xa0, 0x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 0x82, 0x74, 0x85, 0x84, 0x40, 0x13, 0xd2, - 0xeb, 0x33, 0xf7, 0x1e, 0x16, 0x62, 0xaf, 0x1f, 0x16, 0x62, 0xc5, 0x1f, 0xa7, 0x60, 0xe6, 0x20, - 0x53, 0x6f, 0x0d, 0xea, 0x3a, 0x4c, 0x77, 0x78, 0x32, 0x58, 0x48, 0xe9, 0xb5, 0xc5, 0x12, 0x2f, - 0xa6, 0x52, 0x54, 0x4c, 0xa5, 0xb2, 0xb7, 0x57, 0x49, 0x8f, 0x65, 0x4d, 0x8b, 0x18, 0x68, 0x1d, - 0x52, 0x01, 0xb5, 0xe8, 0x20, 0xc8, 0x25, 0x58, 0x95, 0x14, 0x8f, 0xab, 0x92, 0xe8, 0x2c, 0x3a, - 0x43, 0x6a, 0x82, 0x81, 0x74, 0x40, 0xb7, 0x1d, 0xcf, 0xea, 0x99, 0xd4, 0xea, 0xf5, 0xf6, 0x4c, - 0x1f, 0x07, 0x83, 0x1e, 0xcd, 0x25, 0xd9, 0x19, 0x0a, 0xc7, 0xe9, 0x18, 0x21, 0x4e, 0x63, 0xb0, - 0x4a, 0x32, 0xcc, 0x93, 0x96, 0x65, 0x02, 0x63, 0xf3, 0x48, 0x85, 0x74, 0x30, 0x68, 0xbb, 0x0e, - 0x35, 0x43, 0xf7, 0xe4, 0xa6, 0x98, 0x5a, 0xfe, 0x48, 0x44, 0x46, 0x64, 0xad, 0xca, 0x4c, 0x28, - 0x74, 0xff, 0x45, 0x41, 0xd2, 0x80, 0x13, 0xc3, 0x25, 0x54, 0x87, 0xac, 0x78, 0x7d, 0x26, 0xf6, - 0x6c, 0xae, 0x95, 0x3a, 0x85, 0xd6, 0xbc, 0x60, 0xab, 0x9e, 0xcd, 0xf4, 0xfa, 0x30, 0x47, 0x09, - 0xb5, 0x7a, 0xa6, 0x98, 0xcf, 0x4d, 0x7f, 0xf8, 0x42, 0xc8, 0xb0, 0x1d, 0xa2, 0x62, 0x6e, 0xc2, - 0x99, 0x5d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0x39, 0x4d, 0x2b, 0x08, 0xb0, 0x8d, 0xae, 0x40, 0x6e, 0x12, 0xad, - 0xa9, 0x9f, 0xa9, 0x1b, 0x86, 0x5a, 0xcd, 0x26, 0xf3, 0x68, 0x38, 0x52, 0xe6, 0xc5, 0x3f, 0x12, - 0xfc, 0x35, 0xee, 0x50, 0x7c, 0xac, 0xfe, 0x66, 0xb9, 0xb6, 0xa5, 0x56, 0xb3, 0x53, 0xe3, 0xfa, - 0x9b, 0x96, 0xd3, 0xc3, 0x36, 0x4f, 0x67, 0xa5, 0xf5, 0xf8, 0xa5, 0x1c, 0x7b, 0xf6, 0x52, 0x8e, - 0x7d, 0xb7, 0x2f, 0xc7, 0x1e, 0xef, 0xcb, 0xd2, 0x93, 0x7d, 0x59, 0xfa, 0x63, 0x5f, 0x96, 0xee, - 0xbf, 0x92, 0x63, 0x4f, 0x5e, 0xc9, 0xb1, 0x67, 0xaf, 0xe4, 0xd8, 0x17, 0x57, 0xfe, 0xb3, 0x28, - 0xef, 0xb2, 0x6f, 0x0b, 0x56, 0x9a, 0xd1, 0xe7, 0x42, 0x3b, 0xc5, 0x7c, 0xfb, 0xd1, 0xbf, 0x01, - 0x00, 0x00, 0xff, 0xff, 0xc1, 0xbf, 0xbc, 0x1a, 0x7e, 0x0c, 0x00, 0x00, ->>>>>>> 5631c16a77e016a78e530745487e65acdec93781 } func (this *TextProposal) Equal(that interface{}) bool { From 24f9a9d11456d545698f86dce3c1a8dacfdb90a0 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Mon, 17 Jan 2022 16:56:22 +0100 Subject: [PATCH 27/39] Fix genesis tests --- x/gov/types/v1beta2/params.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x/gov/types/v1beta2/params.go b/x/gov/types/v1beta2/params.go index 9883daabefb0..954ca353cc68 100644 --- a/x/gov/types/v1beta2/params.go +++ b/x/gov/types/v1beta2/params.go @@ -60,7 +60,7 @@ func (dp DepositParams) Equal(dp2 DepositParams) bool { } func validateDepositParams(i interface{}) error { - v, ok := i.(DepositParams) + v, ok := i.(*DepositParams) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } @@ -95,7 +95,7 @@ func (tp TallyParams) Equal(other TallyParams) bool { } func validateTallyParams(i interface{}) error { - v, ok := i.(TallyParams) + v, ok := i.(*TallyParams) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } @@ -154,7 +154,7 @@ func (vp VotingParams) Equal(other VotingParams) bool { } func validateVotingParams(i interface{}) error { - v, ok := i.(VotingParams) + v, ok := i.(*VotingParams) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } From 11ba488b4a3300f66bf239fb79f4729cfe866ce0 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Mon, 17 Jan 2022 17:27:12 +0100 Subject: [PATCH 28/39] Fix genesis state --- x/gov/types/v1beta2/genesis.go | 6 +++--- x/gov/types/v1beta2/params.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/x/gov/types/v1beta2/genesis.go b/x/gov/types/v1beta2/genesis.go index 693082b3f581..117e66968099 100644 --- a/x/gov/types/v1beta2/genesis.go +++ b/x/gov/types/v1beta2/genesis.go @@ -41,15 +41,15 @@ func ValidateGenesis(data *GenesisState) error { return errors.New("Starting proposal id must be greater than 0") } - if err := validateTallyParams(data.TallyParams); err != nil { + if err := validateTallyParams(*data.TallyParams); err != nil { return fmt.Errorf("invalid tally params: %w", err) } - if err := validateVotingParams(data.VotingParams); err != nil { + if err := validateVotingParams(*data.VotingParams); err != nil { return fmt.Errorf("invalid voting params: %w", err) } - if err := validateDepositParams(data.DepositParams); err != nil { + if err := validateDepositParams(*data.DepositParams); err != nil { return fmt.Errorf("invalid deposit params: %w", err) } diff --git a/x/gov/types/v1beta2/params.go b/x/gov/types/v1beta2/params.go index 954ca353cc68..9883daabefb0 100644 --- a/x/gov/types/v1beta2/params.go +++ b/x/gov/types/v1beta2/params.go @@ -60,7 +60,7 @@ func (dp DepositParams) Equal(dp2 DepositParams) bool { } func validateDepositParams(i interface{}) error { - v, ok := i.(*DepositParams) + v, ok := i.(DepositParams) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } @@ -95,7 +95,7 @@ func (tp TallyParams) Equal(other TallyParams) bool { } func validateTallyParams(i interface{}) error { - v, ok := i.(*TallyParams) + v, ok := i.(TallyParams) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } @@ -154,7 +154,7 @@ func (vp VotingParams) Equal(other VotingParams) bool { } func validateVotingParams(i interface{}) error { - v, ok := i.(*VotingParams) + v, ok := i.(VotingParams) if !ok { return fmt.Errorf("invalid parameter type: %T", i) } From 8f13e992c18cadf4af426e63d41919ba8474cb6b Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Mon, 17 Jan 2022 18:23:13 +0100 Subject: [PATCH 29/39] Add test with nested anys --- x/gov/types/v1beta2/proposals_test.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/x/gov/types/v1beta2/proposals_test.go b/x/gov/types/v1beta2/proposals_test.go index f038ebfaf663..8055c5cac9dc 100644 --- a/x/gov/types/v1beta2/proposals_test.go +++ b/x/gov/types/v1beta2/proposals_test.go @@ -3,9 +3,13 @@ package v1beta2_test import ( "fmt" "testing" + "time" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) func TestProposalStatus_Format(t *testing.T) { @@ -23,3 +27,16 @@ func TestProposalStatus_Format(t *testing.T) { require.Equal(t, tt.expectedStringOutput, got) } } + +// TestNestedAnys tests that we can call .String() on a struct with nested Anys. +// Here, we're creating a proposal which has a Msg (1st any) with a legacy +// content (2nd any). +func TestNestedAnys(t *testing.T) { + testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") + msgContent, err := v1beta2.NewLegacyContent(testProposal, "cosmos1govacct") + require.NoError(t, err) + proposal, err := v1beta2.NewProposal([]sdk.Msg{msgContent}, 1, time.Now(), time.Now()) + require.NoError(t, err) + + require.Equal(t, "TODO Fix panic here", proposal.String()) +} From e910dbfc7702b65224964869b5ac7bb990a276ec Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Tue, 18 Jan 2022 16:49:09 +0100 Subject: [PATCH 30/39] Fix all tests? --- x/gov/keeper/grpc_query_test.go | 22 +++++++-- x/gov/keeper/keeper_test.go | 9 ++++ x/gov/keeper/proposal.go | 18 ++++++- x/gov/keeper/querier_test.go | 71 +++++++++++++++++++++++---- x/gov/types/v1beta2/proposal.go | 1 - x/gov/types/v1beta2/proposals_test.go | 2 + 6 files changed, 107 insertions(+), 16 deletions(-) diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index a0d4b26fdfa5..5143cf1ea105 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -70,7 +70,13 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposal() { if testCase.expPass { suite.Require().NoError(err) - suite.Require().Equal(expProposal.String(), proposalRes.Proposal.String()) + // Instead of using MashalJSON, we could compare .String() output too. + // https://github.com/cosmos/cosmos-sdk/issues/10965 + expJSON, err := suite.app.AppCodec().MarshalJSON(&expProposal) + suite.Require().NoError(err) + actualJSON, err := suite.app.AppCodec().MarshalJSON(proposalRes.Proposal) + suite.Require().NoError(err) + suite.Require().Equal(expJSON, actualJSON) } else { suite.Require().Error(err) suite.Require().Nil(proposalRes) @@ -212,7 +218,14 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { suite.Require().Len(proposals.GetProposals(), len(expRes.GetProposals())) for i := 0; i < len(proposals.GetProposals()); i++ { - suite.Require().Equal(proposals.GetProposals()[i].String(), expRes.GetProposals()[i].String()) + // Instead of using MashalJSON, we could compare .String() output too. + // https://github.com/cosmos/cosmos-sdk/issues/10965 + expJSON, err := suite.app.AppCodec().MarshalJSON(expRes.GetProposals()[i]) + suite.Require().NoError(err) + actualJSON, err := suite.app.AppCodec().MarshalJSON(proposals.GetProposals()[i]) + suite.Require().NoError(err) + + suite.Require().Equal(expJSON, actualJSON) } } else { @@ -783,7 +796,10 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() { expRes = &v1beta2.QueryTallyResultResponse{ Tally: &v1beta2.TallyResult{ - Yes: sdk.NewInt(3 * 5 * 1000000).String(), + Yes: sdk.NewInt(3 * 5 * 1000000).String(), + No: "0", + Abstain: "0", + NoWithVeto: "0", }, } }, diff --git a/x/gov/keeper/keeper_test.go b/x/gov/keeper/keeper_test.go index b775beb8d26c..1f455813597a 100644 --- a/x/gov/keeper/keeper_test.go +++ b/x/gov/keeper/keeper_test.go @@ -12,6 +12,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) type KeeperTestSuite struct { @@ -27,6 +28,14 @@ func (suite *KeeperTestSuite) SetupTest() { app := simapp.Setup(suite.T(), false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + // Populate the gov account with some coins, as the TestProposal we have + // is a MsgSend from the gov account. + coins := sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100000))) + err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, coins) + suite.NoError(err) + err = app.BankKeeper.SendCoinsFromModuleToModule(ctx, minttypes.ModuleName, types.ModuleName, coins) + suite.NoError(err) + queryHelper := baseapp.NewQueryServerTestHelper(ctx, app.InterfaceRegistry()) v1beta2.RegisterQueryServer(queryHelper, app.GovKeeper) queryClient := v1beta2.NewQueryClient(queryHelper) diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 9da623c7e332..eaefc2908bf4 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -31,10 +31,24 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg) (v1beta } // for all other message types use the msg service router to see that there is a valid route for that - // message. NOTE: we do not verify the proposal messages any further. They may fail upon execution. - if keeper.router.Handler(msg) == nil { + // message. + handler := keeper.router.Handler(msg) + if handler == nil { return v1beta2.Proposal{}, sdkerrors.Wrap(types.ErrUnroutableProposalMsg, sdk.MsgTypeURL(msg)) } + + // Only if it's a MsgExecLegacyContent do we try to execute the + // proposal in a cached context. + // For other Msgs, we do not verify the proposal messages any further. + // They may fail upon execution. + // ref: https://github.com/cosmos/cosmos-sdk/pull/10868#discussion_r784872842 + if msg, ok := msg.(*v1beta2.MsgExecLegacyContent); ok { + cacheCtx, _ := ctx.CacheContext() + if _, err := handler(cacheCtx, msg); err != nil { + return v1beta2.Proposal{}, sdkerrors.Wrap(types.ErrNoProposalHandlerExists, err.Error()) + } + } + } proposalID, err := keeper.GetProposalID(ctx) diff --git a/x/gov/keeper/querier_test.go b/x/gov/keeper/querier_test.go index eb42486bd400..58a9d00530f5 100644 --- a/x/gov/keeper/querier_test.go +++ b/x/gov/keeper/querier_test.go @@ -20,6 +20,8 @@ import ( const custom = "custom" +var encCfg = simapp.MakeTestEncodingConfig() + func getQueriedParams(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier) (v1beta2.DepositParams, v1beta2.VotingParams, v1beta2.TallyParams) { query := abci.RequestQuery{ Path: strings.Join([]string{custom, types.QuerierRoute, v1beta2.QueryParams, v1beta2.ParamDeposit}, "/"), @@ -202,7 +204,7 @@ func TestQueries(t *testing.T) { proposal2.TotalDeposit = sdk.NewCoins(proposal2.TotalDeposit...).Add(deposit4.Amount...) proposal2.Status = v1beta2.StatusVotingPeriod - votingEndTime := proposal2.VotingEndTime.Add(v1beta2.DefaultPeriod) + votingEndTime := time.Now().Add(v1beta2.DefaultPeriod) proposal2.VotingEndTime = &votingEndTime deposit5 := v1beta2.NewDeposit(proposal3.ProposalId, TestAddrs[1], depositParams.MinDeposit) @@ -213,7 +215,7 @@ func TestQueries(t *testing.T) { proposal3.TotalDeposit = sdk.NewCoins(proposal3.TotalDeposit...).Add(deposit5.Amount...) proposal3.Status = v1beta2.StatusVotingPeriod - votingEndTime = proposal3.VotingEndTime.Add(v1beta2.DefaultPeriod) + votingEndTime = time.Now().Add(v1beta2.DefaultPeriod) proposal3.VotingEndTime = &votingEndTime // total deposit of TestAddrs[1] on proposal #3 is worth the proposal deposit + individual deposit deposit5.Amount = sdk.NewCoins(deposit5.Amount...).Add(deposit3.Amount...) @@ -245,13 +247,13 @@ func TestQueries(t *testing.T) { // Only proposal #1 should be in v1beta2.Deposit Period proposals := getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, nil, v1beta2.StatusDepositPeriod, 1, 0) require.Len(t, proposals, 1) - require.Equal(t, proposal1, proposals[0]) + require.Equal(t, proposal1, *proposals[0]) // Only proposals #2 and #3 should be in Voting Period proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, nil, v1beta2.StatusVotingPeriod, 1, 0) require.Len(t, proposals, 2) - require.Equal(t, proposal2, proposals[0]) - require.Equal(t, proposal3, proposals[1]) + checkEqualProposal(t, proposal2, *proposals[0]) + checkEqualProposal(t, proposal3, *proposals[1]) // Addrs[0] votes on proposals #2 & #3 vote1 := v1beta2.NewVote(proposal2.ProposalId, TestAddrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)) @@ -265,8 +267,8 @@ func TestQueries(t *testing.T) { // Test query voted by TestAddrs[0] proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, TestAddrs[0], v1beta2.StatusNil, 1, 0) - require.Equal(t, proposal2, proposals[0]) - require.Equal(t, proposal3, proposals[1]) + checkEqualProposal(t, proposal2, *proposals[0]) + checkEqualProposal(t, proposal3, *proposals[1]) // Test query votes on v1beta2.Proposal 2 votes := getQueriedVotes(t, ctx, legacyQuerierCdc, querier, proposal2.ProposalId, 1, 0) @@ -284,9 +286,9 @@ func TestQueries(t *testing.T) { // Test query all proposals proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, nil, v1beta2.StatusNil, 1, 0) - require.Equal(t, proposal1, proposals[0]) - require.Equal(t, proposal2, proposals[1]) - require.Equal(t, proposal3, proposals[2]) + checkEqualProposal(t, proposal1, *proposals[0]) + checkEqualProposal(t, proposal2, *proposals[1]) + checkEqualProposal(t, proposal3, *proposals[2]) // Test query voted by TestAddrs[1] proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, TestAddrs[1], v1beta2.StatusNil, 1, 0) @@ -398,3 +400,52 @@ func checkEqualVotes(t *testing.T, vote1, vote2 v1beta2.Vote) { require.Equal(t, vote1.Voter, vote2.Voter) require.Equal(t, vote1.ProposalId, vote2.ProposalId) } + +// checkEqualProposal checks that 2 proposals are equal by checking their JSON +// encoding. +// When decoding with Amino, there are weird cases where the voting times +// are actually equal, but `require.Equal()` says they are not: +// +// Diff: +// --- Expected +// +++ Actual +// @@ -68,15 +68,11 @@ +// }, +// - VotingStartTime: (*time.Time)(), +// + VotingStartTime: (*time.Time)({ +// + wall: (uint64) 0, +// + ext: (int64) 0, +// + loc: (*time.Location)() +// + }), +// VotingEndTime: (*time.Time)({ +// - wall: (uint64) 13867285062520661648, +// - ext: (int64) 172800395941069, +// - loc: (*time.Location)({ +// - name: (string) "", +// - zone: ([]time.zone) , +// - tx: ([]time.zoneTrans) , +// - extend: (string) "", +// - cacheStart: (int64) 0, +// - cacheEnd: (int64) 0, +// - cacheZone: (*time.zone)() +// - }) +// + wall: (uint64) 0, +// + ext: (int64) 172800, +// + loc: (*time.Location)() +// }) +func checkEqualProposal(t *testing.T, p1, p2 v1beta2.Proposal) { + bz1, err := encCfg.Codec.MarshalJSON(&p1) + require.NoError(t, err) + bz2, err := encCfg.Codec.MarshalJSON(&p1) + require.NoError(t, err) + require.Equal(t, bz1, bz2) + // require.Equal(t, p1.ProposalId, p2.ProposalId) + // require.Equal(t, p1.Messages, p2.Messages) + // require.Equal(t, p1.Status, p2.Status) + // require.Equal(t, p1.FinalTallyResult, p2.FinalTallyResult) + // require.Equal(t, p1.SubmitTime, p2.SubmitTime) + // require.Equal(t, p1.DepositEndTime, p2.DepositEndTime) + // require.Equal(t, p1.TotalDeposit, p2.TotalDeposit) + // require.Equal(t, p1.VotingStartTime, p2.VotingStartTime.String()) + // require.Equal(t, p1.VotingEndTime, p2.VotingEndTime) +} diff --git a/x/gov/types/v1beta2/proposal.go b/x/gov/types/v1beta2/proposal.go index 5f2b76a66a4d..22c2cb84c1fd 100644 --- a/x/gov/types/v1beta2/proposal.go +++ b/x/gov/types/v1beta2/proposal.go @@ -37,7 +37,6 @@ func NewProposal(messages []sdk.Msg, id uint64, submitTime, depositEndTime time. Messages: msgs, Status: StatusDepositPeriod, FinalTallyResult: &tally, - TotalDeposit: sdk.NewCoins(), SubmitTime: &submitTime, DepositEndTime: &depositEndTime, } diff --git a/x/gov/types/v1beta2/proposals_test.go b/x/gov/types/v1beta2/proposals_test.go index 8055c5cac9dc..a49a3e14958e 100644 --- a/x/gov/types/v1beta2/proposals_test.go +++ b/x/gov/types/v1beta2/proposals_test.go @@ -32,6 +32,8 @@ func TestProposalStatus_Format(t *testing.T) { // Here, we're creating a proposal which has a Msg (1st any) with a legacy // content (2nd any). func TestNestedAnys(t *testing.T) { + // TODO https://github.com/cosmos/cosmos-sdk/issues/10965 + t.Skip() testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") msgContent, err := v1beta2.NewLegacyContent(testProposal, "cosmos1govacct") require.NoError(t, err) From 3acea89db03678873c5d2cc67002c882600e7d17 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Tue, 18 Jan 2022 18:37:09 +0100 Subject: [PATCH 31/39] Fix feegrant tests with more gas --- x/feegrant/client/testutil/suite.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/x/feegrant/client/testutil/suite.go b/x/feegrant/client/testutil/suite.go index 9a0bcde9f6c2..1439b73558f4 100644 --- a/x/feegrant/client/testutil/suite.go +++ b/x/feegrant/client/testutil/suite.go @@ -83,7 +83,7 @@ func (s *IntegrationTestSuite) createGrant(granter, grantee sdk.Address) { commonFlags := []string{ fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(100))).String()), } fee := sdk.NewCoin("stake", sdk.NewInt(100)) @@ -722,11 +722,11 @@ func (s *IntegrationTestSuite) TestFilteredFeeAllowance() { commonFlags := []string{ fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(100))).String()), } spendLimit := sdk.NewCoin("stake", sdk.NewInt(1000)) - allowMsgs := strings.Join([]string{sdk.MsgTypeURL(&govv1beta2.MsgSubmitProposal{}), sdk.MsgTypeURL(&govv1beta2.MsgVoteWeighted{})}, ",") + allowMsgs := strings.Join([]string{sdk.MsgTypeURL(&govv1beta1.MsgSubmitProposal{}), sdk.MsgTypeURL(&govv1beta2.MsgVoteWeighted{})}, ",") testCases := []struct { name string @@ -839,6 +839,7 @@ func (s *IntegrationTestSuite) TestFilteredFeeAllowance() { return govtestutil.MsgSubmitProposal(val.ClientCtx, grantee.String(), "Text Proposal", "No desc", govv1beta1.ProposalTypeText, fmt.Sprintf("--%s=%s", flags.FlagFeeGranter, granter.String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(100))).String()), ) }, &sdk.TxResponse{}, @@ -849,6 +850,7 @@ func (s *IntegrationTestSuite) TestFilteredFeeAllowance() { func() (testutil.BufferWriter, error) { return govtestutil.MsgVote(val.ClientCtx, grantee.String(), "0", "yes", fmt.Sprintf("--%s=%s", flags.FlagFeeGranter, granter.String()), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(100))).String()), ) }, &sdk.TxResponse{}, From be045bd8ab746d20bcdd7edf628ecfe59d046587 Mon Sep 17 00:00:00 2001 From: Amaury <1293565+amaurym@users.noreply.github.com> Date: Thu, 20 Jan 2022 12:36:18 +0100 Subject: [PATCH 32/39] Update x/gov/keeper/msg_server.go Co-authored-by: Marie Gauthier --- x/gov/keeper/msg_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 71f2e0f87143..6f598fb9aaf9 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -21,7 +21,7 @@ type msgServer struct { } // NewMsgServerImpl returns an implementation of the gov MsgServer interface -// for the provided k.Keeper. +// for the provided Keeper. func NewMsgServerImpl(keeper Keeper) v1beta2.MsgServer { return &msgServer{Keeper: keeper} } From 43e18e5b84f779f1419bc33d1a57ca26b96a2d37 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Thu, 20 Jan 2022 13:11:23 +0100 Subject: [PATCH 33/39] Address reviews --- x/gov/keeper/msg_server.go | 6 ++-- x/gov/keeper/proposal.go | 6 ++++ x/gov/keeper/querier_test.go | 65 ++++-------------------------------- x/gov/types/events.go | 1 + x/gov/types/v1beta2/msgs.go | 27 +++------------ 5 files changed, 22 insertions(+), 83 deletions(-) diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 6f598fb9aaf9..5948898222ff 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -68,14 +68,14 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1beta2.MsgSubmitP ), ) - submitEvent := sdk.NewEvent(types.EventTypeSubmitProposal) if votingStarted { - submitEvent = submitEvent.AppendAttributes( + submitEvent := sdk.NewEvent(types.EventTypeSubmitProposal, sdk.NewAttribute(types.AttributeKeyVotingPeriodStart, fmt.Sprintf("%d", proposal.ProposalId)), ) + + ctx.EventManager().EmitEvent(submitEvent) } - ctx.EventManager().EmitEvent(submitEvent) return &v1beta2.MsgSubmitProposalResponse{ ProposalId: proposal.ProposalId, }, nil diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index eaefc2908bf4..c00a4317e633 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -12,9 +12,14 @@ import ( // SubmitProposal create new proposal given an array of messages func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg) (v1beta2.Proposal, error) { + // Will hold a comma-separated string of all Msg type URLs. + msgsStr := "" + // Loop through all messages and confirm that each has a handler and the gov module account // as the only signer for _, msg := range messages { + msgsStr += fmt.Sprintf(",%s", sdk.MsgTypeURL(msg)) + // perform a basic validation of the message if err := msg.ValidateBasic(); err != nil { return v1beta2.Proposal{}, sdkerrors.Wrap(types.ErrInvalidProposalMsg, err.Error()) @@ -75,6 +80,7 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg) (v1beta sdk.NewEvent( types.EventTypeSubmitProposal, sdk.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposalID)), + sdk.NewAttribute(types.AttributeKeyProposalMessages, msgsStr), ), ) diff --git a/x/gov/keeper/querier_test.go b/x/gov/keeper/querier_test.go index 58a9d00530f5..3190fe20be4d 100644 --- a/x/gov/keeper/querier_test.go +++ b/x/gov/keeper/querier_test.go @@ -20,8 +20,6 @@ import ( const custom = "custom" -var encCfg = simapp.MakeTestEncodingConfig() - func getQueriedParams(t *testing.T, ctx sdk.Context, cdc *codec.LegacyAmino, querier sdk.Querier) (v1beta2.DepositParams, v1beta2.VotingParams, v1beta2.TallyParams) { query := abci.RequestQuery{ Path: strings.Join([]string{custom, types.QuerierRoute, v1beta2.QueryParams, v1beta2.ParamDeposit}, "/"), @@ -252,8 +250,8 @@ func TestQueries(t *testing.T) { // Only proposals #2 and #3 should be in Voting Period proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, nil, v1beta2.StatusVotingPeriod, 1, 0) require.Len(t, proposals, 2) - checkEqualProposal(t, proposal2, *proposals[0]) - checkEqualProposal(t, proposal3, *proposals[1]) + require.Equal(t, proposal2, *proposals[0]) + require.Equal(t, proposal3, *proposals[1]) // Addrs[0] votes on proposals #2 & #3 vote1 := v1beta2.NewVote(proposal2.ProposalId, TestAddrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)) @@ -267,8 +265,8 @@ func TestQueries(t *testing.T) { // Test query voted by TestAddrs[0] proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, TestAddrs[0], v1beta2.StatusNil, 1, 0) - checkEqualProposal(t, proposal2, *proposals[0]) - checkEqualProposal(t, proposal3, *proposals[1]) + require.Equal(t, proposal2, *proposals[0]) + require.Equal(t, proposal3, *proposals[1]) // Test query votes on v1beta2.Proposal 2 votes := getQueriedVotes(t, ctx, legacyQuerierCdc, querier, proposal2.ProposalId, 1, 0) @@ -286,9 +284,9 @@ func TestQueries(t *testing.T) { // Test query all proposals proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, nil, v1beta2.StatusNil, 1, 0) - checkEqualProposal(t, proposal1, *proposals[0]) - checkEqualProposal(t, proposal2, *proposals[1]) - checkEqualProposal(t, proposal3, *proposals[2]) + require.Equal(t, proposal1, *proposals[0]) + require.Equal(t, proposal2, *proposals[1]) + require.Equal(t, proposal3, *proposals[2]) // Test query voted by TestAddrs[1] proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, TestAddrs[1], v1beta2.StatusNil, 1, 0) @@ -400,52 +398,3 @@ func checkEqualVotes(t *testing.T, vote1, vote2 v1beta2.Vote) { require.Equal(t, vote1.Voter, vote2.Voter) require.Equal(t, vote1.ProposalId, vote2.ProposalId) } - -// checkEqualProposal checks that 2 proposals are equal by checking their JSON -// encoding. -// When decoding with Amino, there are weird cases where the voting times -// are actually equal, but `require.Equal()` says they are not: -// -// Diff: -// --- Expected -// +++ Actual -// @@ -68,15 +68,11 @@ -// }, -// - VotingStartTime: (*time.Time)(), -// + VotingStartTime: (*time.Time)({ -// + wall: (uint64) 0, -// + ext: (int64) 0, -// + loc: (*time.Location)() -// + }), -// VotingEndTime: (*time.Time)({ -// - wall: (uint64) 13867285062520661648, -// - ext: (int64) 172800395941069, -// - loc: (*time.Location)({ -// - name: (string) "", -// - zone: ([]time.zone) , -// - tx: ([]time.zoneTrans) , -// - extend: (string) "", -// - cacheStart: (int64) 0, -// - cacheEnd: (int64) 0, -// - cacheZone: (*time.zone)() -// - }) -// + wall: (uint64) 0, -// + ext: (int64) 172800, -// + loc: (*time.Location)() -// }) -func checkEqualProposal(t *testing.T, p1, p2 v1beta2.Proposal) { - bz1, err := encCfg.Codec.MarshalJSON(&p1) - require.NoError(t, err) - bz2, err := encCfg.Codec.MarshalJSON(&p1) - require.NoError(t, err) - require.Equal(t, bz1, bz2) - // require.Equal(t, p1.ProposalId, p2.ProposalId) - // require.Equal(t, p1.Messages, p2.Messages) - // require.Equal(t, p1.Status, p2.Status) - // require.Equal(t, p1.FinalTallyResult, p2.FinalTallyResult) - // require.Equal(t, p1.SubmitTime, p2.SubmitTime) - // require.Equal(t, p1.DepositEndTime, p2.DepositEndTime) - // require.Equal(t, p1.TotalDeposit, p2.TotalDeposit) - // require.Equal(t, p1.VotingStartTime, p2.VotingStartTime.String()) - // require.Equal(t, p1.VotingEndTime, p2.VotingEndTime) -} diff --git a/x/gov/types/events.go b/x/gov/types/events.go index b34c48ac99af..7217e7e38793 100644 --- a/x/gov/types/events.go +++ b/x/gov/types/events.go @@ -12,6 +12,7 @@ const ( AttributeKeyProposalResult = "proposal_result" AttributeKeyOption = "option" AttributeKeyProposalID = "proposal_id" + AttributeKeyProposalMessages = "proposal_messages" // Msg type_urls in the proposal AttributeKeyVotingPeriodStart = "voting_period_start" AttributeValueCategory = "governance" AttributeValueProposalDropped = "proposal_dropped" // didn't meet min deposit diff --git a/x/gov/types/v1beta2/msgs.go b/x/gov/types/v1beta2/msgs.go index 7e0edd2663d5..c228a16881f1 100644 --- a/x/gov/types/v1beta2/msgs.go +++ b/x/gov/types/v1beta2/msgs.go @@ -3,8 +3,6 @@ package v1beta2 import ( "fmt" - "github.com/gogo/protobuf/proto" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -35,10 +33,13 @@ func NewMsgSubmitProposal(messages []sdk.Msg, initialDeposit sdk.Coins, proposer Proposer: proposer, } - if err := m.setMessages(messages); err != nil { - return &MsgSubmitProposal{}, err + anys, err := sdktx.SetMsgs(messages) + if err != nil { + return nil, err } + m.Messages = anys + return m, nil } @@ -46,24 +47,6 @@ func (m *MsgSubmitProposal) GetMsgs() ([]sdk.Msg, error) { return sdktx.GetMsgs(m.Messages, "sdk.MsgProposal") } -func (m *MsgSubmitProposal) setMessages(messages []sdk.Msg) error { - msgs := make([]*codectypes.Any, len(messages)) - for i, msg := range messages { - m, ok := msg.(proto.Message) - if !ok { - return fmt.Errorf("can't proto marshal %T", msg) - } - any, err := codectypes.NewAnyWithValue(m) - if err != nil { - return err - } - - msgs[i] = any - } - m.Messages = msgs - return nil -} - // Route implements Msg func (m MsgSubmitProposal) Route() string { return types.RouterKey } From 175ffadedc149c9d456f60826ccad29440651fc5 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Thu, 20 Jan 2022 13:38:13 +0100 Subject: [PATCH 34/39] Fix querier test --- x/gov/keeper/querier_test.go | 60 ++++++++++++++++++++++++++++++------ 1 file changed, 51 insertions(+), 9 deletions(-) diff --git a/x/gov/keeper/querier_test.go b/x/gov/keeper/querier_test.go index 3190fe20be4d..c7a05a0bf7fe 100644 --- a/x/gov/keeper/querier_test.go +++ b/x/gov/keeper/querier_test.go @@ -202,7 +202,7 @@ func TestQueries(t *testing.T) { proposal2.TotalDeposit = sdk.NewCoins(proposal2.TotalDeposit...).Add(deposit4.Amount...) proposal2.Status = v1beta2.StatusVotingPeriod - votingEndTime := time.Now().Add(v1beta2.DefaultPeriod) + votingEndTime := ctx.BlockTime().Add(v1beta2.DefaultPeriod) proposal2.VotingEndTime = &votingEndTime deposit5 := v1beta2.NewDeposit(proposal3.ProposalId, TestAddrs[1], depositParams.MinDeposit) @@ -213,7 +213,7 @@ func TestQueries(t *testing.T) { proposal3.TotalDeposit = sdk.NewCoins(proposal3.TotalDeposit...).Add(deposit5.Amount...) proposal3.Status = v1beta2.StatusVotingPeriod - votingEndTime = time.Now().Add(v1beta2.DefaultPeriod) + votingEndTime = ctx.BlockTime().Add(v1beta2.DefaultPeriod) proposal3.VotingEndTime = &votingEndTime // total deposit of TestAddrs[1] on proposal #3 is worth the proposal deposit + individual deposit deposit5.Amount = sdk.NewCoins(deposit5.Amount...).Add(deposit3.Amount...) @@ -250,8 +250,8 @@ func TestQueries(t *testing.T) { // Only proposals #2 and #3 should be in Voting Period proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, nil, v1beta2.StatusVotingPeriod, 1, 0) require.Len(t, proposals, 2) - require.Equal(t, proposal2, *proposals[0]) - require.Equal(t, proposal3, *proposals[1]) + checkEqualProposal(t, proposal2, *proposals[0]) + checkEqualProposal(t, proposal3, *proposals[1]) // Addrs[0] votes on proposals #2 & #3 vote1 := v1beta2.NewVote(proposal2.ProposalId, TestAddrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes)) @@ -265,8 +265,8 @@ func TestQueries(t *testing.T) { // Test query voted by TestAddrs[0] proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, TestAddrs[0], v1beta2.StatusNil, 1, 0) - require.Equal(t, proposal2, *proposals[0]) - require.Equal(t, proposal3, *proposals[1]) + checkEqualProposal(t, proposal2, *proposals[0]) + checkEqualProposal(t, proposal3, *proposals[1]) // Test query votes on v1beta2.Proposal 2 votes := getQueriedVotes(t, ctx, legacyQuerierCdc, querier, proposal2.ProposalId, 1, 0) @@ -284,9 +284,9 @@ func TestQueries(t *testing.T) { // Test query all proposals proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, nil, v1beta2.StatusNil, 1, 0) - require.Equal(t, proposal1, *proposals[0]) - require.Equal(t, proposal2, *proposals[1]) - require.Equal(t, proposal3, *proposals[2]) + checkEqualProposal(t, proposal1, *proposals[0]) + checkEqualProposal(t, proposal2, *proposals[1]) + checkEqualProposal(t, proposal3, *proposals[2]) // Test query voted by TestAddrs[1] proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, TestAddrs[1], v1beta2.StatusNil, 1, 0) @@ -398,3 +398,45 @@ func checkEqualVotes(t *testing.T, vote1, vote2 v1beta2.Vote) { require.Equal(t, vote1.Voter, vote2.Voter) require.Equal(t, vote1.ProposalId, vote2.ProposalId) } + +// checkEqualProposal checks that 2 proposals are equal by checking their JSON +// encoding. +// When decoding with Amino, there are weird cases where the voting times +// are actually equal, but `require.Equal()` says they are not: +// +// Diff: +// --- Expected +// +++ Actual +// @@ -68,3 +68,7 @@ +// }, +// - VotingStartTime: (*time.Time)(), +// + VotingStartTime: (*time.Time)({ +// + wall: (uint64) 0, +// + ext: (int64) 0, +// + loc: (*time.Location)() +// + }), +func checkEqualProposal(t *testing.T, p1, p2 v1beta2.Proposal) { + require.Equal(t, p1.ProposalId, p2.ProposalId) + require.Equal(t, p1.Messages, p2.Messages) + require.Equal(t, p1.Status, p2.Status) + require.Equal(t, p1.FinalTallyResult, p2.FinalTallyResult) + require.Equal(t, p1.SubmitTime, p2.SubmitTime) + require.Equal(t, p1.DepositEndTime, p2.DepositEndTime) + require.Equal(t, p1.TotalDeposit, p2.TotalDeposit) + require.Equal(t, convertNilToDefault(p1.VotingStartTime), convertNilToDefault(p2.VotingStartTime)) + require.Equal(t, convertNilToDefault(p1.VotingEndTime), convertNilToDefault(p2.VotingEndTime)) +} + +// convertNilToDefault converts a (*time.Time)() into a (*time.Time)()). +// In proto structs dealing with time, we use *time.Time, which can be nil. +// However, when using Amino, a nil time is unmarshalled into +// (*time.Time)()), which is Jan 1st 1970. +// This function converts a nil time to a default time, to check that they are +// actually equal. +func convertNilToDefault(t *time.Time) *time.Time { + if t == nil { + return &time.Time{} + } + + return t +} From d16e29059dbf3e5719dab37fa9bee48a565185ec Mon Sep 17 00:00:00 2001 From: Amaury <1293565+amaurym@users.noreply.github.com> Date: Thu, 20 Jan 2022 13:42:15 +0100 Subject: [PATCH 35/39] Update x/gov/keeper/querier_test.go --- x/gov/keeper/querier_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x/gov/keeper/querier_test.go b/x/gov/keeper/querier_test.go index c7a05a0bf7fe..7fd1b268de28 100644 --- a/x/gov/keeper/querier_test.go +++ b/x/gov/keeper/querier_test.go @@ -399,8 +399,7 @@ func checkEqualVotes(t *testing.T, vote1, vote2 v1beta2.Vote) { require.Equal(t, vote1.ProposalId, vote2.ProposalId) } -// checkEqualProposal checks that 2 proposals are equal by checking their JSON -// encoding. +// checkEqualProposal checks that 2 proposals are equal. // When decoding with Amino, there are weird cases where the voting times // are actually equal, but `require.Equal()` says they are not: // From 9ef5dadff4ec4f71feb0057c42db0fc8e0509e27 Mon Sep 17 00:00:00 2001 From: Amaury <1293565+amaurym@users.noreply.github.com> Date: Thu, 20 Jan 2022 16:40:19 +0100 Subject: [PATCH 36/39] Update x/gov/keeper/proposal.go Co-authored-by: Callum Waters --- x/gov/keeper/proposal.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index c00a4317e633..7f88de0167cb 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -35,8 +35,7 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg) (v1beta return v1beta2.Proposal{}, sdkerrors.Wrap(types.ErrInvalidSigner, signers[0].String()) } - // for all other message types use the msg service router to see that there is a valid route for that - // message. + // use the msg service router to see that there is a valid route for that message. handler := keeper.router.Handler(msg) if handler == nil { return v1beta2.Proposal{}, sdkerrors.Wrap(types.ErrUnroutableProposalMsg, sdk.MsgTypeURL(msg)) From 4bad0770edbecad2ac2c98c063dcc291d7192019 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Thu, 20 Jan 2022 16:53:22 +0100 Subject: [PATCH 37/39] Address reviews --- x/gov/keeper/common_test.go | 16 +++++++++++++++- x/gov/keeper/msg_server.go | 13 +++++++------ x/gov/keeper/proposal.go | 2 +- x/gov/keeper/proposal_test.go | 21 ++++++++++++++------- 4 files changed, 37 insertions(+), 15 deletions(-) diff --git a/x/gov/keeper/common_test.go b/x/gov/keeper/common_test.go index abb4d8624338..a276842204c9 100644 --- a/x/gov/keeper/common_test.go +++ b/x/gov/keeper/common_test.go @@ -11,6 +11,8 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -19,9 +21,21 @@ import ( var ( _, _, addr = testdata.KeyTestPubAddr() govAcct = authtypes.NewModuleAddress(types.ModuleName) - TestProposal = []sdk.Msg{banktypes.NewMsgSend(govAcct, addr, sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(1000))))} + TestProposal = getTestProposal() ) +func getTestProposal() []sdk.Msg { + legacyProposalMsg, err := v1beta2.NewLegacyContent(v1beta1.NewTextProposal("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, + } +} + func createValidators(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers []int64) ([]sdk.AccAddress, []sdk.ValAddress) { addrs := simapp.AddTestAddrsIncremental(app, ctx, 5, sdk.NewInt(30000000)) valAddrs := simapp.ConvertAddrsToValAddrs(addrs) diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 5948898222ff..00751e2aaaed 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -84,22 +84,23 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1beta2.MsgSubmitP func (k msgServer) ExecLegacyContent(goCtx context.Context, msg *v1beta2.MsgExecLegacyContent) (*v1beta2.MsgExecLegacyContentResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) + govAcct := k.GetGovernanceAccount(ctx).GetAddress().String() + if govAcct != msg.Authority { + return nil, sdkerrors.Wrapf(types.ErrInvalidSigner, "expected %s got %s", govAcct, msg.Authority) + } + content, err := v1beta2.LegacyContentFromMessage(msg) if err != nil { return nil, sdkerrors.Wrapf(v1beta1.ErrInvalidProposalContent, "%+v", err) } - // if so ensure that the content has a respective handler + // Ensure that the content has a respective handler if !k.Keeper.legacyRouter.HasRoute(content.ProposalRoute()) { return nil, sdkerrors.Wrap(types.ErrNoProposalHandlerExists, content.ProposalRoute()) } - // Execute the proposal content in a new context branch (with branched store) - // to validate the actual parameter changes before the proposal proceeds - // through the governance process. State is not persisted. - cacheCtx, _ := ctx.CacheContext() handler := k.Keeper.legacyRouter.GetRoute(content.ProposalRoute()) - if err := handler(cacheCtx, content); err != nil { + if err := handler(ctx, content); err != nil { return nil, sdkerrors.Wrapf(v1beta1.ErrInvalidProposalContent, "failed to run legacy handler %s, %+v", content.ProposalRoute(), err) } diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index c00a4317e633..97bb0475e6e5 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -32,7 +32,7 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg) (v1beta // assert that the governance module account is the only signer of the messages if !signers[0].Equals(keeper.GetGovernanceAccount(ctx).GetAddress()) { - return v1beta2.Proposal{}, sdkerrors.Wrap(types.ErrInvalidSigner, signers[0].String()) + return v1beta2.Proposal{}, sdkerrors.Wrapf(types.ErrInvalidSigner, signers[0].String()) } // for all other message types use the msg service router to see that there is a valid route for that diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index 848d66d8fc00..82d12e3150c7 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" @@ -53,22 +54,28 @@ type invalidProposalRoute struct{ v1beta1.TextProposal } func (invalidProposalRoute) ProposalRoute() string { return "nonexistingroute" } func (suite *KeeperTestSuite) TestSubmitProposal() { + govAcct := suite.app.GovKeeper.GetGovernanceAccount(suite.ctx).GetAddress().String() + _, _, randomAddr := testdata.KeyTestPubAddr() + testCases := []struct { content v1beta1.Content + authority string expectedErr error }{ - {&v1beta1.TextProposal{Title: "title", Description: "description"}, nil}, + {&v1beta1.TextProposal{Title: "title", Description: "description"}, govAcct, nil}, // Keeper does not check the validity of title and description, no error - {&v1beta1.TextProposal{Title: "", Description: "description"}, nil}, - {&v1beta1.TextProposal{Title: strings.Repeat("1234567890", 100), Description: "description"}, nil}, - {&v1beta1.TextProposal{Title: "title", Description: ""}, nil}, - {&v1beta1.TextProposal{Title: "title", Description: strings.Repeat("1234567890", 1000)}, nil}, + {&v1beta1.TextProposal{Title: "", Description: "description"}, govAcct, nil}, + {&v1beta1.TextProposal{Title: strings.Repeat("1234567890", 100), Description: "description"}, govAcct, nil}, + {&v1beta1.TextProposal{Title: "title", Description: ""}, govAcct, nil}, + {&v1beta1.TextProposal{Title: "title", Description: strings.Repeat("1234567890", 1000)}, govAcct, nil}, + // error when signer is not gov acct + {&v1beta1.TextProposal{Title: "title", Description: "description"}, randomAddr.String(), types.ErrInvalidSigner}, // error only when invalid route - {&invalidProposalRoute{}, types.ErrNoProposalHandlerExists}, + {&invalidProposalRoute{}, govAcct, types.ErrNoProposalHandlerExists}, } for i, tc := range testCases { - prop, err := v1beta2.NewLegacyContent(tc.content, suite.app.GovKeeper.GetGovernanceAccount(suite.ctx).GetAddress().String()) + prop, err := v1beta2.NewLegacyContent(tc.content, tc.authority) suite.Require().NoError(err) _, err = suite.app.GovKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}) suite.Require().True(errors.Is(tc.expectedErr, err), "tc #%d; got: %v, expected: %v", i, err, tc.expectedErr) From 69b2e66fe3bfd84c3c62f067e2b96e603bf14ce1 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Thu, 20 Jan 2022 17:02:24 +0100 Subject: [PATCH 38/39] Move all errors to types/errors.go --- x/gov/keeper/msg_server.go | 4 ++-- x/gov/types/errors.go | 7 ++++--- x/gov/types/v1beta1/errors.go | 12 ------------ x/gov/types/v1beta1/msgs.go | 14 +++++++------- x/gov/types/v1beta1/proposal.go | 8 ++++---- 5 files changed, 17 insertions(+), 28 deletions(-) delete mode 100644 x/gov/types/v1beta1/errors.go diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 00751e2aaaed..fc6fd126be74 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -91,7 +91,7 @@ func (k msgServer) ExecLegacyContent(goCtx context.Context, msg *v1beta2.MsgExec content, err := v1beta2.LegacyContentFromMessage(msg) if err != nil { - return nil, sdkerrors.Wrapf(v1beta1.ErrInvalidProposalContent, "%+v", err) + return nil, sdkerrors.Wrapf(types.ErrInvalidProposalContent, "%+v", err) } // Ensure that the content has a respective handler @@ -101,7 +101,7 @@ func (k msgServer) ExecLegacyContent(goCtx context.Context, msg *v1beta2.MsgExec handler := k.Keeper.legacyRouter.GetRoute(content.ProposalRoute()) if err := handler(ctx, content); err != nil { - return nil, sdkerrors.Wrapf(v1beta1.ErrInvalidProposalContent, "failed to run legacy handler %s, %+v", content.ProposalRoute(), err) + return nil, sdkerrors.Wrapf(types.ErrInvalidProposalContent, "failed to run legacy handler %s, %+v", content.ProposalRoute(), err) } return &v1beta2.MsgExecLegacyContentResponse{}, nil diff --git a/x/gov/types/errors.go b/x/gov/types/errors.go index 0f51ecf6f52b..18951b0606e2 100644 --- a/x/gov/types/errors.go +++ b/x/gov/types/errors.go @@ -9,8 +9,10 @@ var ( ErrUnknownProposal = sdkerrors.Register(ModuleName, 2, "unknown proposal") ErrInactiveProposal = sdkerrors.Register(ModuleName, 3, "inactive proposal") ErrAlreadyActiveProposal = sdkerrors.Register(ModuleName, 4, "proposal already active") - // Errors 5, 6 & 7 are reserved as legacy errors - // See x/gov/types/v1beta1/errors.go + // Errors 5 & 6 are legacy errors related to v1beta1.Proposal. + ErrInvalidProposalContent = sdkerrors.Register(ModuleName, 5, "invalid proposal content") + ErrInvalidProposalType = sdkerrors.Register(ModuleName, 6, "invalid proposal type") + 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") ErrUnroutableProposalMsg = sdkerrors.Register(ModuleName, 10, "proposal message not recognized by router") @@ -18,5 +20,4 @@ var ( ErrInvalidProposalMsg = sdkerrors.Register(ModuleName, 12, "invalid proposal message") ErrInvalidSigner = sdkerrors.Register(ModuleName, 13, "expected gov account as only signer for proposal message") ErrInvalidSignalMsg = sdkerrors.Register(ModuleName, 14, "signal message is invalid") - ErrInvalidVote = sdkerrors.Register(ModuleName, 15, "invalid vote option") ) diff --git a/x/gov/types/v1beta1/errors.go b/x/gov/types/v1beta1/errors.go deleted file mode 100644 index 43aa37410ec0..000000000000 --- a/x/gov/types/v1beta1/errors.go +++ /dev/null @@ -1,12 +0,0 @@ -package v1beta1 - -import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/gov/types" -) - -var ( - ErrInvalidProposalContent = sdkerrors.Register(types.ModuleName, 5, "invalid proposal content") - ErrInvalidProposalType = sdkerrors.Register(types.ModuleName, 6, "invalid proposal type") - ErrInvalidVote = sdkerrors.Register(types.ModuleName, 7, "invalid vote option") -) diff --git a/x/gov/types/v1beta1/msgs.go b/x/gov/types/v1beta1/msgs.go index 1883ce48fcd4..d111e5bc6bd0 100644 --- a/x/gov/types/v1beta1/msgs.go +++ b/x/gov/types/v1beta1/msgs.go @@ -95,10 +95,10 @@ func (m MsgSubmitProposal) ValidateBasic() error { content := m.GetContent() if content == nil { - return sdkerrors.Wrap(ErrInvalidProposalContent, "missing content") + return sdkerrors.Wrap(types.ErrInvalidProposalContent, "missing content") } if !IsValidProposalType(content.ProposalType()) { - return sdkerrors.Wrap(ErrInvalidProposalType, content.ProposalType()) + return sdkerrors.Wrap(types.ErrInvalidProposalType, content.ProposalType()) } if err := content.ValidateBasic(); err != nil { return err @@ -194,7 +194,7 @@ func (msg MsgVote) ValidateBasic() error { return sdkerrors.ErrInvalidAddress.Wrapf("invalid voter address: %s", err) } if !ValidVoteOption(msg.Option) { - return sdkerrors.Wrap(ErrInvalidVote, msg.Option.String()) + return sdkerrors.Wrap(types.ErrInvalidVote, msg.Option.String()) } return nil @@ -243,21 +243,21 @@ func (msg MsgVoteWeighted) ValidateBasic() error { usedOptions := make(map[VoteOption]bool) for _, option := range msg.Options { if !ValidWeightedVoteOption(option) { - return sdkerrors.Wrap(ErrInvalidVote, option.String()) + return sdkerrors.Wrap(types.ErrInvalidVote, option.String()) } totalWeight = totalWeight.Add(option.Weight) if usedOptions[option.Option] { - return sdkerrors.Wrap(ErrInvalidVote, "Duplicated vote option") + return sdkerrors.Wrap(types.ErrInvalidVote, "Duplicated vote option") } usedOptions[option.Option] = true } if totalWeight.GT(sdk.NewDec(1)) { - return sdkerrors.Wrap(ErrInvalidVote, "Total weight overflow 1.00") + return sdkerrors.Wrap(types.ErrInvalidVote, "Total weight overflow 1.00") } if totalWeight.LT(sdk.NewDec(1)) { - return sdkerrors.Wrap(ErrInvalidVote, "Total weight lower than 1.00") + return sdkerrors.Wrap(types.ErrInvalidVote, "Total weight lower than 1.00") } return nil diff --git a/x/gov/types/v1beta1/proposal.go b/x/gov/types/v1beta1/proposal.go index 609cf3902dba..bf735b276b29 100644 --- a/x/gov/types/v1beta1/proposal.go +++ b/x/gov/types/v1beta1/proposal.go @@ -214,18 +214,18 @@ func ValidProposalStatus(status ProposalStatus) bool { func ValidateAbstract(c Content) error { title := c.GetTitle() if len(strings.TrimSpace(title)) == 0 { - return sdkerrors.Wrap(ErrInvalidProposalContent, "proposal title cannot be blank") + return sdkerrors.Wrap(types.ErrInvalidProposalContent, "proposal title cannot be blank") } if len(title) > MaxTitleLength { - return sdkerrors.Wrapf(ErrInvalidProposalContent, "proposal title is longer than max length of %d", MaxTitleLength) + return sdkerrors.Wrapf(types.ErrInvalidProposalContent, "proposal title is longer than max length of %d", MaxTitleLength) } description := c.GetDescription() if len(description) == 0 { - return sdkerrors.Wrap(ErrInvalidProposalContent, "proposal description cannot be blank") + return sdkerrors.Wrap(types.ErrInvalidProposalContent, "proposal description cannot be blank") } if len(description) > MaxDescriptionLength { - return sdkerrors.Wrapf(ErrInvalidProposalContent, "proposal description is longer than max length of %d", MaxDescriptionLength) + return sdkerrors.Wrapf(types.ErrInvalidProposalContent, "proposal description is longer than max length of %d", MaxDescriptionLength) } return nil From d9e4067d89aa0d7b5801431c7603aa660a418300 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Fri, 21 Jan 2022 11:45:24 +0100 Subject: [PATCH 39/39] make proto-gen --- api/cosmos/gov/v1beta2/tx.pulsar.go | 167 +++++++++++---------- api/cosmos/group/v1beta1/genesis.pulsar.go | 7 +- api/cosmos/orm/v1alpha1/orm.pulsar.go | 3 +- api/cosmos/slashing/v1beta1/tx.pulsar.go | 9 +- x/gov/types/v1beta2/tx.pb.go | 83 +++++----- 5 files changed, 144 insertions(+), 125 deletions(-) diff --git a/api/cosmos/gov/v1beta2/tx.pulsar.go b/api/cosmos/gov/v1beta2/tx.pulsar.go index e983731a0a11..8a662a459d30 100644 --- a/api/cosmos/gov/v1beta2/tx.pulsar.go +++ b/api/cosmos/gov/v1beta2/tx.pulsar.go @@ -2,10 +2,6 @@ package govv1beta2 import ( fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" v1beta1 "github.com/cosmos/cosmos-sdk/api/cosmos/base/v1beta1" @@ -14,6 +10,9 @@ import ( protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" + io "io" + reflect "reflect" + sync "sync" ) var _ protoreflect.List = (*_MsgSubmitProposal_1_list)(nil) @@ -5215,80 +5214,96 @@ var file_cosmos_gov_v1beta2_tx_proto_rawDesc = []byte{ 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, - 0x64, 0x22, 0xa3, 0x01, 0x0a, 0x07, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x30, 0x0a, - 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x0f, 0xea, 0xde, 0x1f, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, - 0x5f, 0x69, 0x64, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, - 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, - 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, - 0x36, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x32, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x11, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x56, 0x6f, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb5, 0x01, 0x0a, 0x0f, 0x4d, - 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x12, 0x30, - 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x0f, 0xea, 0xde, 0x1f, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, - 0x6c, 0x5f, 0x69, 0x64, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, - 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, - 0x12, 0x40, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x56, - 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xaf, 0x01, - 0x0a, 0x0a, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x30, 0x0a, 0x0b, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x0f, 0xea, 0xde, 0x1f, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, - 0x69, 0x64, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x36, - 0x0a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x64, 0x22, 0x71, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, + 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, + 0x42, 0x0b, 0xca, 0xb4, 0x2d, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x22, 0x1e, 0x0a, 0x1c, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, + 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa3, 0x01, 0x0a, 0x07, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, + 0x12, 0x30, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0f, 0xea, 0xde, 0x1f, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x64, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x37, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, - 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, - 0x14, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xec, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x66, 0x0a, - 0x0e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, - 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x53, - 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x1b, 0x2e, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, 0x6f, 0x74, + 0x65, 0x72, 0x12, 0x36, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x11, 0x0a, 0x0f, 0x4d, 0x73, + 0x67, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb5, 0x01, + 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, + 0x64, 0x12, 0x30, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0f, 0xea, 0xde, 0x1f, 0x0b, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, 0x6f, + 0x74, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, + 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, + 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0xaf, 0x01, 0x0a, 0x0a, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, + 0x30, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x0f, 0xea, 0xde, 0x1f, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, + 0x64, 0x12, 0x36, 0x0a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x37, 0x0a, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x22, 0x14, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xdd, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, + 0x12, 0x66, 0x0a, 0x0e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x12, 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, + 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x1a, 0x2d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, + 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x11, 0x45, 0x78, 0x65, 0x63, + 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, - 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x60, 0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x12, - 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x65, 0x64, 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, - 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, - 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x51, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x1e, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x1a, 0x26, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xcb, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x42, - 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x3b, - 0x67, 0x6f, 0x76, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, - 0xaa, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x32, 0xca, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, - 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0xe2, 0x02, 0x1e, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, + 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x04, 0x56, 0x6f, 0x74, + 0x65, 0x12, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x1a, 0x23, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, + 0x74, 0x65, 0x64, 0x12, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, + 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, + 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x12, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x32, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xcb, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x32, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x32, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0xa2, 0x02, + 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, + 0x76, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0xca, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0xe2, 0x02, + 0x1e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/group/v1beta1/genesis.pulsar.go b/api/cosmos/group/v1beta1/genesis.pulsar.go index 1179d09b7c58..61749ede8929 100644 --- a/api/cosmos/group/v1beta1/genesis.pulsar.go +++ b/api/cosmos/group/v1beta1/genesis.pulsar.go @@ -2,14 +2,13 @@ package groupv1beta1 import ( fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - runtime "github.com/cosmos/cosmos-proto/runtime" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var _ protoreflect.List = (*_GenesisState_2_list)(nil) diff --git a/api/cosmos/orm/v1alpha1/orm.pulsar.go b/api/cosmos/orm/v1alpha1/orm.pulsar.go index 203a359f1140..11ff843144c8 100644 --- a/api/cosmos/orm/v1alpha1/orm.pulsar.go +++ b/api/cosmos/orm/v1alpha1/orm.pulsar.go @@ -2333,7 +2333,8 @@ type SecondaryIndexDescriptor struct { // store the remaining primary key fields in the value.. Fields string `protobuf:"bytes,1,opt,name=fields,proto3" json:"fields,omitempty"` // id is a non-zero integer ID that must be unique within the indexes for this - // table. It may be deprecated in the future when this can be auto-generated. + // table and less than 32768. It may be deprecated in the future when this can + // be auto-generated. Id uint32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` // unique specifies that this an unique index. Unique bool `protobuf:"varint,3,opt,name=unique,proto3" json:"unique,omitempty"` diff --git a/api/cosmos/slashing/v1beta1/tx.pulsar.go b/api/cosmos/slashing/v1beta1/tx.pulsar.go index cf9e29c56a32..3d62a0fa07e6 100644 --- a/api/cosmos/slashing/v1beta1/tx.pulsar.go +++ b/api/cosmos/slashing/v1beta1/tx.pulsar.go @@ -2,16 +2,15 @@ package slashingv1beta1 import ( fmt "fmt" - io "io" - reflect "reflect" - sync "sync" - _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/gogo/protobuf/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" ) var ( @@ -809,7 +808,7 @@ type MsgUnjail struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ValidatorAddr string `protobuf:"bytes,1,opt,name=validator_addr,json=address,proto3" json:"validator_addr,omitempty"` + ValidatorAddr string `protobuf:"bytes,1,opt,name=validator_addr,json=validatorAddr,proto3" json:"validator_addr,omitempty"` } func (x *MsgUnjail) Reset() { diff --git a/x/gov/types/v1beta2/tx.pb.go b/x/gov/types/v1beta2/tx.pb.go index 71434d197f90..c2d7b0b9a487 100644 --- a/x/gov/types/v1beta2/tx.pb.go +++ b/x/gov/types/v1beta2/tx.pb.go @@ -545,45 +545,50 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1beta2/tx.proto", fileDescriptor_4214261f6b3f9ed4) } var fileDescriptor_4214261f6b3f9ed4 = []byte{ - // 600 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0xcf, 0x6e, 0xd3, 0x4e, - 0x18, 0x8c, 0x9b, 0xfe, 0xfa, 0xe7, 0xeb, 0x4f, 0xad, 0xba, 0x8a, 0x84, 0xe3, 0x22, 0x37, 0x32, - 0xa2, 0x8a, 0x84, 0xb2, 0x4e, 0x02, 0x2a, 0x17, 0x0e, 0x34, 0x70, 0x28, 0x48, 0x11, 0xe0, 0x4a, - 0x20, 0x71, 0x09, 0x76, 0xbc, 0xdd, 0xae, 0x48, 0xbc, 0x96, 0x77, 0x13, 0x35, 0x6f, 0xc1, 0x3b, - 0xf0, 0x00, 0x5c, 0xe0, 0x11, 0x90, 0x7a, 0xac, 0x38, 0x71, 0xaa, 0x50, 0x72, 0x43, 0x3c, 0x04, - 0x8a, 0xbd, 0x76, 0x43, 0x93, 0x26, 0xe5, 0xc2, 0x29, 0xce, 0x37, 0x33, 0x9f, 0x67, 0xec, 0xf1, - 0xc2, 0x4e, 0x9b, 0x8b, 0x2e, 0x17, 0x36, 0xe5, 0x7d, 0xbb, 0x5f, 0xf3, 0x88, 0x74, 0xeb, 0xb6, - 0x3c, 0xc5, 0x61, 0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xa8, 0xdc, 0x88, 0x96, 0x95, 0xfc, 0x10, 0x96, 0xe3, 0xfe, 0xee, 0x5c, 0x23, 0x1b, 0x83, 0xc6, - 0x9d, 0x39, 0x60, 0xb6, 0xe9, 0x1d, 0xfc, 0xff, 0x47, 0xa1, 0xe6, 0x89, 0x52, 0x92, 0x71, 0xef, - 0x06, 0xa4, 0xec, 0x0e, 0xaf, 0x60, 0x35, 0x7d, 0xbf, 0xe6, 0x35, 0x3a, 0x85, 0x1b, 0x7b, 0xf3, - 0xf1, 0x74, 0x65, 0xe3, 0xf9, 0xd9, 0xd0, 0xd4, 0xce, 0x87, 0xa6, 0xf6, 0x63, 0x68, 0x6a, 0x1f, - 0x46, 0x66, 0xee, 0x7c, 0x64, 0xe6, 0xbe, 0x8f, 0xcc, 0xdc, 0xdb, 0x2a, 0x65, 0xf2, 0xa4, 0xe7, - 0xe1, 0x36, 0xef, 0xaa, 0x63, 0x51, 0xfd, 0x54, 0x84, 0xff, 0xde, 0x3e, 0x8d, 0x0f, 0x59, 0x39, - 0x08, 0x89, 0x48, 0x8f, 0x5a, 0x6f, 0x25, 0x3e, 0xe4, 0xee, 0xff, 0x0e, 0x00, 0x00, 0xff, 0xff, - 0x15, 0xe6, 0xf8, 0x9f, 0xd8, 0x05, 0x00, 0x00, + // 681 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x4f, 0x4f, 0x13, 0x4f, + 0x18, 0xee, 0x52, 0x7e, 0x14, 0x5e, 0x7e, 0x81, 0x30, 0x69, 0xe2, 0x76, 0x21, 0x0b, 0x59, 0x23, + 0x69, 0x62, 0xba, 0x5b, 0xaa, 0xc1, 0x83, 0x1e, 0xa4, 0x68, 0x82, 0xc6, 0x46, 0x5d, 0x12, 0x4d, + 0xbc, 0xe0, 0xb6, 0x3b, 0x0c, 0x13, 0xe9, 0xbe, 0xeb, 0xce, 0xb4, 0xa1, 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xd5, 0xf1, + 0x78, 0xda, 0xb2, 0xfe, 0xf4, 0xe8, 0xd4, 0xd4, 0x8e, 0x4f, 0x4d, 0xed, 0xe7, 0xa9, 0xa9, 0x7d, + 0x38, 0x33, 0x73, 0xc7, 0x67, 0x66, 0xee, 0xfb, 0x99, 0x99, 0x7b, 0x53, 0x65, 0x5c, 0xee, 0x75, + 0x9a, 0x76, 0x0b, 0xdb, 0xea, 0x69, 0x50, 0x3f, 0x15, 0xe1, 0xbf, 0x73, 0x0e, 0xe2, 0x87, 0x46, + 0xf6, 0x42, 0x2a, 0xd2, 0xe7, 0xa6, 0x39, 0x15, 0x7f, 0xe1, 0xee, 0xfc, 0x0e, 0x00, 0x00, 0xff, + 0xff, 0xfd, 0xa4, 0xe8, 0x04, 0xdc, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used.