refactor: move gov types to v1beta2 (#10852)

## Description

Closes: #10793 



---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
This commit is contained in:
atheeshp 2022-01-04 21:40:02 +05:30 committed by GitHub
parent 344be864de
commit bdee3337d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 329 additions and 322 deletions

View File

@ -114,6 +114,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [\#10692](https://github.com/cosmos/cosmos-sdk/pull/10612) `SignerData` takes 2 new fields, `Address` and `PubKey`, which need to get populated when using SIGN_MODE_DIRECT_AUX. * [\#10692](https://github.com/cosmos/cosmos-sdk/pull/10612) `SignerData` takes 2 new fields, `Address` and `PubKey`, which need to get populated when using SIGN_MODE_DIRECT_AUX.
* [\#10748](https://github.com/cosmos/cosmos-sdk/pull/10748) Move legacy `x/gov` api to `v1beta1` directory. * [\#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. * [\#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`.
### Client Breaking Changes ### Client Breaking Changes

View File

@ -4,7 +4,7 @@ package cosmos.gov.v1beta2;
import "cosmos/gov/v1beta2/gov.proto"; import "cosmos/gov/v1beta2/gov.proto";
option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2";
// GenesisState defines the gov module's genesis state. // GenesisState defines the gov module's genesis state.
message GenesisState { message GenesisState {

View File

@ -8,7 +8,7 @@ import "google/protobuf/any.proto";
import "google/protobuf/duration.proto"; import "google/protobuf/duration.proto";
import "cosmos_proto/cosmos.proto"; import "cosmos_proto/cosmos.proto";
option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2";
// VoteOption enumerates the valid vote options for a given governance proposal. // VoteOption enumerates the valid vote options for a given governance proposal.
enum VoteOption { enum VoteOption {

View File

@ -6,7 +6,7 @@ import "google/api/annotations.proto";
import "cosmos/gov/v1beta2/gov.proto"; import "cosmos/gov/v1beta2/gov.proto";
import "cosmos_proto/cosmos.proto"; import "cosmos_proto/cosmos.proto";
option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2";
// Query defines the gRPC querier service for gov module // Query defines the gRPC querier service for gov module
service Query { service Query {

View File

@ -7,7 +7,7 @@ import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto"; import "cosmos_proto/cosmos.proto";
import "google/protobuf/any.proto"; import "google/protobuf/any.proto";
option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2";
// Msg defines the gov Msg service. // Msg defines the gov Msg service.
service Msg { service Msg {

View File

@ -9,7 +9,7 @@ import (
simtypes "github.com/cosmos/cosmos-sdk/types/simulation" simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
"github.com/cosmos/cosmos-sdk/x/authz" "github.com/cosmos/cosmos-sdk/x/authz"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2"
) )
// genGrant returns a slice of authorization grants. // genGrant returns a slice of authorization grants.
@ -31,7 +31,7 @@ func genGrant(r *rand.Rand, accounts []simtypes.Account) []authz.GrantAuthorizat
func generateRandomGrant(r *rand.Rand) *codectypes.Any { func generateRandomGrant(r *rand.Rand) *codectypes.Any {
authorizations := make([]*codectypes.Any, 2) authorizations := make([]*codectypes.Any, 2)
authorizations[0] = newAnyAuthorization(banktypes.NewSendAuthorization(sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(1000))))) authorizations[0] = newAnyAuthorization(banktypes.NewSendAuthorization(sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(1000)))))
authorizations[1] = newAnyAuthorization(authz.NewGenericAuthorization(sdk.MsgTypeURL(&govtypes.MsgSubmitProposal{}))) authorizations[1] = newAnyAuthorization(authz.NewGenericAuthorization(sdk.MsgTypeURL(&v1beta2.MsgSubmitProposal{})))
return authorizations[r.Intn(len(authorizations))] return authorizations[r.Intn(len(authorizations))]
} }

View File

@ -6,7 +6,7 @@ import (
"github.com/cosmos/cosmos-sdk/testutil/network" "github.com/cosmos/cosmos-sdk/testutil/network"
sdk "github.com/cosmos/cosmos-sdk/types" 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/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite" "github.com/stretchr/testify/suite"
@ -17,9 +17,9 @@ func TestIntegrationTestSuite(t *testing.T) {
cfg.NumValidators = 1 cfg.NumValidators = 1
suite.Run(t, NewIntegrationTestSuite(cfg)) suite.Run(t, NewIntegrationTestSuite(cfg))
dp := types.NewDepositParams(sdk.NewCoins(sdk.NewCoin(cfg.BondDenom, types.DefaultMinDepositTokens)), time.Duration(15)*time.Second) dp := v1beta2.NewDepositParams(sdk.NewCoins(sdk.NewCoin(cfg.BondDenom, v1beta2.DefaultMinDepositTokens)), time.Duration(15)*time.Second)
vp := types.NewVotingParams(time.Duration(5) * time.Second) vp := v1beta2.NewVotingParams(time.Duration(5) * time.Second)
genesisState := types.DefaultGenesisState() genesisState := v1beta2.DefaultGenesisState()
genesisState.DepositParams = &dp genesisState.DepositParams = &dp
genesisState.VotingParams = &vp genesisState.VotingParams = &vp
bz, err := cfg.Codec.MarshalJSON(genesisState) bz, err := cfg.Codec.MarshalJSON(genesisState)

View File

@ -2,42 +2,42 @@ package keeper
import ( import (
sdk "github.com/cosmos/cosmos-sdk/types" 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/v1beta1"
"github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2"
) )
// GetDepositParams returns the current DepositParams from the global param store // GetDepositParams returns the current DepositParams from the global param store
func (keeper Keeper) GetDepositParams(ctx sdk.Context) v1beta1.DepositParams { func (keeper Keeper) GetDepositParams(ctx sdk.Context) v1beta1.DepositParams {
var depositParams v1beta1.DepositParams var depositParams v1beta1.DepositParams
keeper.paramSpace.Get(ctx, types.ParamStoreKeyDepositParams, &depositParams) keeper.paramSpace.Get(ctx, v1beta2.ParamStoreKeyDepositParams, &depositParams)
return depositParams return depositParams
} }
// GetVotingParams returns the current VotingParams from the global param store // GetVotingParams returns the current VotingParams from the global param store
func (keeper Keeper) GetVotingParams(ctx sdk.Context) v1beta1.VotingParams { func (keeper Keeper) GetVotingParams(ctx sdk.Context) v1beta1.VotingParams {
var votingParams v1beta1.VotingParams var votingParams v1beta1.VotingParams
keeper.paramSpace.Get(ctx, types.ParamStoreKeyVotingParams, &votingParams) keeper.paramSpace.Get(ctx, v1beta2.ParamStoreKeyVotingParams, &votingParams)
return votingParams return votingParams
} }
// GetTallyParams returns the current TallyParam from the global param store // GetTallyParams returns the current TallyParam from the global param store
func (keeper Keeper) GetTallyParams(ctx sdk.Context) v1beta1.TallyParams { func (keeper Keeper) GetTallyParams(ctx sdk.Context) v1beta1.TallyParams {
var tallyParams v1beta1.TallyParams var tallyParams v1beta1.TallyParams
keeper.paramSpace.Get(ctx, types.ParamStoreKeyTallyParams, &tallyParams) keeper.paramSpace.Get(ctx, v1beta2.ParamStoreKeyTallyParams, &tallyParams)
return tallyParams return tallyParams
} }
// SetDepositParams sets DepositParams to the global param store // 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 v1beta1.DepositParams) {
keeper.paramSpace.Set(ctx, types.ParamStoreKeyDepositParams, &depositParams) keeper.paramSpace.Set(ctx, v1beta2.ParamStoreKeyDepositParams, &depositParams)
} }
// SetVotingParams sets VotingParams to the global param store // 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 v1beta1.VotingParams) {
keeper.paramSpace.Set(ctx, types.ParamStoreKeyVotingParams, &votingParams) keeper.paramSpace.Set(ctx, v1beta2.ParamStoreKeyVotingParams, &votingParams)
} }
// SetTallyParams sets TallyParams to the global param store // 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 v1beta1.TallyParams) {
keeper.paramSpace.Set(ctx, types.ParamStoreKeyTallyParams, &tallyParams) keeper.paramSpace.Set(ctx, v1beta2.ParamStoreKeyTallyParams, &tallyParams)
} }

View File

@ -9,34 +9,35 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"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" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
"github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2"
) )
// NewQuerier creates a new gov Querier instance // NewQuerier creates a new gov Querier instance
func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier {
return func(ctx sdk.Context, path []string, req abci.RequestQuery) ([]byte, error) { return func(ctx sdk.Context, path []string, req abci.RequestQuery) ([]byte, error) {
switch path[0] { switch path[0] {
case types.QueryParams: case v1beta2.QueryParams:
return queryParams(ctx, path[1:], req, keeper, legacyQuerierCdc) return queryParams(ctx, path[1:], req, keeper, legacyQuerierCdc)
case types.QueryProposals: case v1beta2.QueryProposals:
return queryProposals(ctx, path[1:], req, keeper, legacyQuerierCdc) return queryProposals(ctx, path[1:], req, keeper, legacyQuerierCdc)
case types.QueryProposal: case v1beta2.QueryProposal:
return queryProposal(ctx, path[1:], req, keeper, legacyQuerierCdc) return queryProposal(ctx, path[1:], req, keeper, legacyQuerierCdc)
case types.QueryDeposits: case v1beta2.QueryDeposits:
return queryDeposits(ctx, path[1:], req, keeper, legacyQuerierCdc) return queryDeposits(ctx, path[1:], req, keeper, legacyQuerierCdc)
case types.QueryDeposit: case v1beta2.QueryDeposit:
return queryDeposit(ctx, path[1:], req, keeper, legacyQuerierCdc) return queryDeposit(ctx, path[1:], req, keeper, legacyQuerierCdc)
case types.QueryVotes: case v1beta2.QueryVotes:
return queryVotes(ctx, path[1:], req, keeper, legacyQuerierCdc) return queryVotes(ctx, path[1:], req, keeper, legacyQuerierCdc)
case types.QueryVote: case v1beta2.QueryVote:
return queryVote(ctx, path[1:], req, keeper, legacyQuerierCdc) return queryVote(ctx, path[1:], req, keeper, legacyQuerierCdc)
case types.QueryTally: case v1beta2.QueryTally:
return queryTally(ctx, path[1:], req, keeper, legacyQuerierCdc) return queryTally(ctx, path[1:], req, keeper, legacyQuerierCdc)
default: default:
@ -47,21 +48,21 @@ func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
func queryParams(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { func queryParams(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) {
switch path[0] { switch path[0] {
case types.ParamDeposit: case v1beta2.ParamDeposit:
bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, keeper.GetDepositParams(ctx)) bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, keeper.GetDepositParams(ctx))
if err != nil { if err != nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())
} }
return bz, nil return bz, nil
case types.ParamVoting: case v1beta2.ParamVoting:
bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, keeper.GetVotingParams(ctx)) bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, keeper.GetVotingParams(ctx))
if err != nil { if err != nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())
} }
return bz, nil return bz, nil
case types.ParamTallying: case v1beta2.ParamTallying:
bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, keeper.GetTallyParams(ctx)) bz, err := codec.MarshalJSONIndent(legacyQuerierCdc, keeper.GetTallyParams(ctx))
if err != nil { if err != nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error()) return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())
@ -75,7 +76,7 @@ func queryParams(ctx sdk.Context, path []string, req abci.RequestQuery, keeper K
// nolint: unparam // nolint: unparam
func queryProposal(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { func queryProposal(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) {
var params types.QueryProposalParams var params v1beta2.QueryProposalParams
err := legacyQuerierCdc.UnmarshalJSON(req.Data, &params) err := legacyQuerierCdc.UnmarshalJSON(req.Data, &params)
if err != nil { if err != nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error())
@ -96,7 +97,7 @@ func queryProposal(ctx sdk.Context, path []string, req abci.RequestQuery, keeper
// nolint: unparam // nolint: unparam
func queryDeposit(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { func queryDeposit(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) {
var params types.QueryDepositParams var params v1beta2.QueryDepositParams
err := legacyQuerierCdc.UnmarshalJSON(req.Data, &params) err := legacyQuerierCdc.UnmarshalJSON(req.Data, &params)
if err != nil { if err != nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error())
@ -113,7 +114,7 @@ func queryDeposit(ctx sdk.Context, path []string, req abci.RequestQuery, keeper
// nolint: unparam // nolint: unparam
func queryVote(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { func queryVote(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) {
var params types.QueryVoteParams var params v1beta2.QueryVoteParams
err := legacyQuerierCdc.UnmarshalJSON(req.Data, &params) err := legacyQuerierCdc.UnmarshalJSON(req.Data, &params)
if err != nil { if err != nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error())
@ -130,7 +131,7 @@ func queryVote(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Kee
// nolint: unparam // nolint: unparam
func queryDeposits(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { func queryDeposits(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) {
var params types.QueryProposalParams var params v1beta2.QueryProposalParams
err := legacyQuerierCdc.UnmarshalJSON(req.Data, &params) err := legacyQuerierCdc.UnmarshalJSON(req.Data, &params)
if err != nil { if err != nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error())
@ -151,7 +152,7 @@ func queryDeposits(ctx sdk.Context, path []string, req abci.RequestQuery, keeper
// nolint: unparam // nolint: unparam
func queryTally(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) { func queryTally(ctx sdk.Context, path []string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) {
var params types.QueryProposalParams var params v1beta2.QueryProposalParams
err := legacyQuerierCdc.UnmarshalJSON(req.Data, &params) err := legacyQuerierCdc.UnmarshalJSON(req.Data, &params)
if err != nil { if err != nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error())

View File

@ -16,6 +16,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/keeper"
"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" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
"github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2"
) )
const custom = "custom" const custom = "custom"
@ -202,7 +203,7 @@ func TestQueries(t *testing.T) {
proposal2.TotalDeposit = proposal2.TotalDeposit.Add(deposit4.Amount...) proposal2.TotalDeposit = proposal2.TotalDeposit.Add(deposit4.Amount...)
proposal2.Status = v1beta1.StatusVotingPeriod proposal2.Status = v1beta1.StatusVotingPeriod
proposal2.VotingEndTime = proposal2.VotingEndTime.Add(types.DefaultPeriod) proposal2.VotingEndTime = proposal2.VotingEndTime.Add(v1beta2.DefaultPeriod)
deposit5 := v1beta1.NewDeposit(proposal3.ProposalId, TestAddrs[1], depositParams.MinDeposit) deposit5 := v1beta1.NewDeposit(proposal3.ProposalId, TestAddrs[1], depositParams.MinDeposit)
depositer5, err := sdk.AccAddressFromBech32(deposit5.Depositor) depositer5, err := sdk.AccAddressFromBech32(deposit5.Depositor)
@ -212,7 +213,7 @@ func TestQueries(t *testing.T) {
proposal3.TotalDeposit = proposal3.TotalDeposit.Add(deposit5.Amount...) proposal3.TotalDeposit = proposal3.TotalDeposit.Add(deposit5.Amount...)
proposal3.Status = v1beta1.StatusVotingPeriod proposal3.Status = v1beta1.StatusVotingPeriod
proposal3.VotingEndTime = proposal3.VotingEndTime.Add(types.DefaultPeriod) proposal3.VotingEndTime = proposal3.VotingEndTime.Add(v1beta2.DefaultPeriod)
// total deposit of TestAddrs[1] on proposal #3 is worth the proposal deposit + individual deposit // total deposit of TestAddrs[1] on proposal #3 is worth the proposal deposit + individual deposit
deposit5.Amount = deposit5.Amount.Add(deposit3.Amount...) deposit5.Amount = deposit5.Amount.Add(deposit3.Amount...)

View File

@ -11,7 +11,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/types/simulation"
"github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2"
) )
// Simulation parameter constants // Simulation parameter constants
@ -94,11 +94,11 @@ func RandomizedGenState(simState *module.SimulationState) {
func(r *rand.Rand) { veto = GenTallyParamsVeto(r) }, func(r *rand.Rand) { veto = GenTallyParamsVeto(r) },
) )
govGenesis := types.NewGenesisState( govGenesis := v1beta2.NewGenesisState(
startingProposalID, startingProposalID,
types.NewDepositParams(minDeposit, depositPeriod), v1beta2.NewDepositParams(minDeposit, depositPeriod),
types.NewVotingParams(votingPeriod), v1beta2.NewVotingParams(votingPeriod),
types.NewTallyParams(quorum, threshold, veto), v1beta2.NewTallyParams(quorum, threshold, veto),
) )
bz, err := json.MarshalIndent(&govGenesis, "", " ") bz, err := json.MarshalIndent(&govGenesis, "", " ")
@ -106,5 +106,5 @@ func RandomizedGenState(simState *module.SimulationState) {
panic(err) panic(err)
} }
fmt.Printf("Selected randomly generated governance parameters:\n%s\n", bz) fmt.Printf("Selected randomly generated governance parameters:\n%s\n", bz)
simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(govGenesis) simState.GenState[v1beta2.ModuleName] = simState.Cdc.MustMarshalJSON(govGenesis)
} }

View File

@ -13,7 +13,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/types/module"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation" simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
"github.com/cosmos/cosmos-sdk/x/gov/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"
) )
// TestRandomizedGenState tests the normal scenario of applying RandomizedGenState. // TestRandomizedGenState tests the normal scenario of applying RandomizedGenState.
@ -37,8 +37,8 @@ func TestRandomizedGenState(t *testing.T) {
simulation.RandomizedGenState(&simState) simulation.RandomizedGenState(&simState)
var govGenesis types.GenesisState var govGenesis v1beta2.GenesisState
simState.Cdc.MustUnmarshalJSON(simState.GenState[types.ModuleName], &govGenesis) simState.Cdc.MustUnmarshalJSON(simState.GenState[v1beta2.ModuleName], &govGenesis)
dec1, _ := sdk.NewDecFromStr("0.361000000000000000") dec1, _ := sdk.NewDecFromStr("0.361000000000000000")
dec2, _ := sdk.NewDecFromStr("0.512000000000000000") dec2, _ := sdk.NewDecFromStr("0.512000000000000000")
@ -51,9 +51,9 @@ func TestRandomizedGenState(t *testing.T) {
require.Equal(t, dec2.String(), govGenesis.TallyParams.Threshold) require.Equal(t, dec2.String(), govGenesis.TallyParams.Threshold)
require.Equal(t, dec3.String(), govGenesis.TallyParams.VetoThreshold) require.Equal(t, dec3.String(), govGenesis.TallyParams.VetoThreshold)
require.Equal(t, uint64(0x28), govGenesis.StartingProposalId) require.Equal(t, uint64(0x28), govGenesis.StartingProposalId)
require.Equal(t, []*types.Deposit{}, govGenesis.Deposits) require.Equal(t, []*v1beta2.Deposit{}, govGenesis.Deposits)
require.Equal(t, []*types.Vote{}, govGenesis.Votes) require.Equal(t, []*v1beta2.Vote{}, govGenesis.Votes)
require.Equal(t, []*types.Proposal{}, govGenesis.Proposals) require.Equal(t, []*v1beta2.Proposal{}, govGenesis.Proposals)
} }
// TestRandomizedGenState tests abnormal scenarios of applying RandomizedGenState. // TestRandomizedGenState tests abnormal scenarios of applying RandomizedGenState.

View File

@ -1,4 +1,4 @@
package types package v1beta2
import ( import (
"github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec"

View File

@ -0,0 +1,27 @@
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

View File

@ -1,4 +1,4 @@
package types package v1beta2
import ( import (
"fmt" "fmt"

View File

@ -1,4 +1,4 @@
package types package v1beta2
import ( import (
"errors" "errors"

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT. // Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: cosmos/gov/v1beta2/genesis.proto // source: cosmos/gov/v1beta2/genesis.proto
package types package v1beta2
import ( import (
fmt "fmt" fmt "fmt"
@ -129,29 +129,29 @@ func init() {
func init() { proto.RegisterFile("cosmos/gov/v1beta2/genesis.proto", fileDescriptor_7915ab39bb5aa171) } func init() { proto.RegisterFile("cosmos/gov/v1beta2/genesis.proto", fileDescriptor_7915ab39bb5aa171) }
var fileDescriptor_7915ab39bb5aa171 = []byte{ var fileDescriptor_7915ab39bb5aa171 = []byte{
// 341 bytes of a gzipped FileDescriptorProto // 345 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00,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, 0xd4, 0x71, 0x35, 0xf4, 0x6e, 0x3f, 0x16, 0x8e, 0x35, 0x5f, 0x38, 0xd6, 0xd7, 0xc2,
0xde, 0x32, 0xa7, 0x32, 0xcf, 0x9c, 0xca, 0x67, 0xe6, 0x54, 0x1e, 0xbd, 0x28, 0xc6, 0xa7, 0x97, 0xb1, 0xde, 0x52, 0xa7, 0x34, 0x4f, 0x9d, 0xd2, 0x67, 0xea, 0x94, 0x1e, 0x3b, 0x61, 0x84, 0x4f,
0x21, 0x1b, 0xc1, 0xc4, 0xcf, 0xdf, 0xdf, 0x7c, 0x8e, 0x65, 0xf8, 0xec, 0xbf, 0xea, 0x65, 0xc0, 0x2f, 0x43, 0x36, 0x82, 0x89, 0x97, 0xbd, 0xbf, 0xf9, 0x1c, 0xcb, 0xe0, 0xd9, 0x7b, 0xd5, 0xcb,
0x59, 0x22, 0xe4, 0xb0, 0xa1, 0xf7, 0xe0, 0xec, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x5f, 0x73, 0x78, 0x80, 0xb3, 0x58, 0xc8, 0x7c, 0x25, 0x86, 0x35, 0xbd, 0x0f, 0xa7, 0xdf, 0x01, 0x00, 0x00, 0xff,
0xdf, 0x5d, 0x02, 0x00, 0x00, 0xff, 0xb6, 0x88, 0x7e, 0xc1, 0x65, 0x02, 0x00, 0x00,
} }
func (m *GenesisState) Marshal() (dAtA []byte, err error) { func (m *GenesisState) Marshal() (dAtA []byte, err error) {

View File

@ -1,15 +1,16 @@
package types package v1beta2_test
import ( import (
"testing" "testing"
"github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
func TestEmptyGenesis(t *testing.T) { func TestEmptyGenesis(t *testing.T) {
state1 := GenesisState{} state1 := v1beta2.GenesisState{}
require.True(t, state1.Empty()) require.True(t, state1.Empty())
state2 := DefaultGenesisState() state2 := v1beta2.DefaultGenesisState()
require.False(t, state2.Empty()) require.False(t, state2.Empty())
} }

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT. // Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: cosmos/gov/v1beta2/gov.proto // source: cosmos/gov/v1beta2/gov.proto
package types package v1beta2
import ( import (
fmt "fmt" fmt "fmt"
@ -671,71 +671,71 @@ func init() {
func init() { proto.RegisterFile("cosmos/gov/v1beta2/gov.proto", fileDescriptor_5abf7b8852811c49) } func init() { proto.RegisterFile("cosmos/gov/v1beta2/gov.proto", fileDescriptor_5abf7b8852811c49) }
var fileDescriptor_5abf7b8852811c49 = []byte{ var fileDescriptor_5abf7b8852811c49 = []byte{
// 1019 bytes of a gzipped FileDescriptorProto // 1022 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0xc1, 0x6e, 0xdb, 0x46, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0x41, 0x6f, 0xdb, 0x36,
0x10, 0x35, 0x25, 0x59, 0xb6, 0x47, 0xb6, 0xc2, 0x6e, 0x8c, 0x86, 0x76, 0x52, 0xca, 0xd5, 0xc1, 0x14, 0x8e, 0x6c, 0xc7, 0x49, 0x9e, 0x13, 0x57, 0x63, 0x83, 0x55, 0x49, 0x3b, 0x39, 0xf3, 0x21,
0x10, 0x82, 0x5a, 0x8a, 0x5d, 0x34, 0x05, 0x7a, 0x8a, 0x64, 0x32, 0x0d, 0x03, 0xc7, 0x14, 0x48, 0x08, 0x8a, 0xc5, 0x4e, 0x32, 0xac, 0x03, 0x76, 0xaa, 0x1d, 0xa9, 0xab, 0x82, 0x34, 0x32, 0x24,
0x46, 0x46, 0x7b, 0x21, 0x28, 0x73, 0x43, 0x11, 0x15, 0xb9, 0x2a, 0x77, 0xe5, 0xd8, 0x9f, 0xd0, 0xd5, 0xc1, 0x76, 0x11, 0xe4, 0x88, 0x95, 0x85, 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 0xf5, 0x47, 0xbd, 0xc6, 0x09, 0x89, 0xc4, 0xbb, 0x40, 0xfc, 0x6c, 0x53, 0xff, 0xa7,
0x3a, 0xe5, 0x5f, 0x3d, 0xec, 0x6c, 0x84, 0x69, 0xbf, 0xcc, 0x4d, 0xf6, 0xf5, 0xff, 0x01, 0x00, 0xe6, 0x19, 0x7f, 0xf5, 0xb0, 0xf3, 0x21, 0xa6, 0xf9, 0xdb, 0xa7, 0x57, 0xe6, 0x66, 0xfb, 0xfa,
0x00, 0xff, 0xff, 0xa4, 0x3d, 0x7c, 0xd7, 0x10, 0x09, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x59, 0x87, 0xaa, 0xdc, 0x18, 0x09, 0x00, 0x00,
} }
func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) {

View File

@ -1,4 +1,4 @@
package types package v1beta2
import ( import (
"fmt" "fmt"
@ -9,6 +9,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
sdktx "github.com/cosmos/cosmos-sdk/types/tx" sdktx "github.com/cosmos/cosmos-sdk/types/tx"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
) )
// Governance message types and routes // Governance message types and routes
@ -104,7 +105,7 @@ func (m MsgSubmitProposal) ValidateBasic() error {
for idx, msg := range msgs { for idx, msg := range msgs {
if err := msg.ValidateBasic(); err != nil { if err := msg.ValidateBasic(); err != nil {
return sdkerrors.Wrap(ErrInvalidProposalMsg, return sdkerrors.Wrap(govtypes.ErrInvalidProposalMsg,
fmt.Sprintf("msg: %d, err: %s", idx, err.Error())) fmt.Sprintf("msg: %d, err: %s", idx, err.Error()))
} }
} }
@ -187,7 +188,7 @@ func (msg MsgVote) ValidateBasic() error {
return sdkerrors.ErrInvalidAddress.Wrapf("invalid voter address: %s", err) return sdkerrors.ErrInvalidAddress.Wrapf("invalid voter address: %s", err)
} }
if !ValidVoteOption(msg.Option) { if !ValidVoteOption(msg.Option) {
return sdkerrors.Wrap(ErrInvalidVote, msg.Option.String()) return sdkerrors.Wrap(govtypes.ErrInvalidVote, msg.Option.String())
} }
return nil return nil
@ -230,25 +231,25 @@ func (msg MsgVoteWeighted) ValidateBasic() error {
usedOptions := make(map[VoteOption]bool) usedOptions := make(map[VoteOption]bool)
for _, option := range msg.Options { for _, option := range msg.Options {
if !option.IsValid() { if !option.IsValid() {
return sdkerrors.Wrap(ErrInvalidVote, option.String()) return sdkerrors.Wrap(govtypes.ErrInvalidVote, option.String())
} }
weight, err := sdk.NewDecFromStr(option.Weight) weight, err := sdk.NewDecFromStr(option.Weight)
if err != nil { if err != nil {
return sdkerrors.Wrapf(ErrInvalidVote, "Invalid weight: %s", err) return sdkerrors.Wrapf(govtypes.ErrInvalidVote, "Invalid weight: %s", err)
} }
totalWeight = totalWeight.Add(weight) totalWeight = totalWeight.Add(weight)
if usedOptions[option.Option] { if usedOptions[option.Option] {
return sdkerrors.Wrap(ErrInvalidVote, "Duplicated vote option") return sdkerrors.Wrap(govtypes.ErrInvalidVote, "Duplicated vote option")
} }
usedOptions[option.Option] = true usedOptions[option.Option] = true
} }
if totalWeight.GT(sdk.NewDec(1)) { if totalWeight.GT(sdk.NewDec(1)) {
return sdkerrors.Wrap(ErrInvalidVote, "Total weight overflow 1.00") return sdkerrors.Wrap(govtypes.ErrInvalidVote, "Total weight overflow 1.00")
} }
if totalWeight.LT(sdk.NewDec(1)) { if totalWeight.LT(sdk.NewDec(1)) {
return sdkerrors.Wrap(ErrInvalidVote, "Total weight lower than 1.00") return sdkerrors.Wrap(govtypes.ErrInvalidVote, "Total weight lower than 1.00")
} }
return nil return nil

View File

@ -1,4 +1,4 @@
package types package v1beta2_test
import ( import (
"testing" "testing"
@ -6,6 +6,7 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2"
) )
var ( var (
@ -24,7 +25,7 @@ func init() {
func TestMsgDepositGetSignBytes(t *testing.T) { func TestMsgDepositGetSignBytes(t *testing.T) {
addr := sdk.AccAddress("addr1") addr := sdk.AccAddress("addr1")
msg := NewMsgDeposit(addr, 0, coinsPos) msg := v1beta2.NewMsgDeposit(addr, 0, coinsPos)
res := msg.GetSignBytes() res := msg.GetSignBytes()
expected := `{"type":"cosmos-sdk/MsgDeposit","value":{"amount":[{"amount":"1000","denom":"stake"}],"depositor":"cosmos1v9jxgu33kfsgr5"}}` expected := `{"type":"cosmos-sdk/MsgDeposit","value":{"amount":[{"amount":"1000","denom":"stake"}],"depositor":"cosmos1v9jxgu33kfsgr5"}}`
@ -46,7 +47,7 @@ func TestMsgDeposit(t *testing.T) {
} }
for i, tc := range tests { for i, tc := range tests {
msg := NewMsgDeposit(tc.depositorAddr, tc.proposalID, tc.depositAmount) msg := v1beta2.NewMsgDeposit(tc.depositorAddr, tc.proposalID, tc.depositAmount)
if tc.expectPass { if tc.expectPass {
require.NoError(t, msg.ValidateBasic(), "test: %v", i) require.NoError(t, msg.ValidateBasic(), "test: %v", i)
} else { } else {
@ -60,19 +61,19 @@ func TestMsgVote(t *testing.T) {
tests := []struct { tests := []struct {
proposalID uint64 proposalID uint64
voterAddr sdk.AccAddress voterAddr sdk.AccAddress
option VoteOption option v1beta2.VoteOption
expectPass bool expectPass bool
}{ }{
{0, addrs[0], OptionYes, true}, {0, addrs[0], v1beta2.OptionYes, true},
{0, sdk.AccAddress{}, OptionYes, false}, {0, sdk.AccAddress{}, v1beta2.OptionYes, false},
{0, addrs[0], OptionNo, true}, {0, addrs[0], v1beta2.OptionNo, true},
{0, addrs[0], OptionNoWithVeto, true}, {0, addrs[0], v1beta2.OptionNoWithVeto, true},
{0, addrs[0], OptionAbstain, true}, {0, addrs[0], v1beta2.OptionAbstain, true},
{0, addrs[0], VoteOption(0x13), false}, {0, addrs[0], v1beta2.VoteOption(0x13), false},
} }
for i, tc := range tests { for i, tc := range tests {
msg := NewMsgVote(tc.voterAddr, tc.proposalID, tc.option) msg := v1beta2.NewMsgVote(tc.voterAddr, tc.proposalID, tc.option)
if tc.expectPass { if tc.expectPass {
require.Nil(t, msg.ValidateBasic(), "test: %v", i) require.Nil(t, msg.ValidateBasic(), "test: %v", i)
} else { } else {
@ -86,37 +87,37 @@ func TestMsgVoteWeighted(t *testing.T) {
tests := []struct { tests := []struct {
proposalID uint64 proposalID uint64
voterAddr sdk.AccAddress voterAddr sdk.AccAddress
options WeightedVoteOptions options v1beta2.WeightedVoteOptions
expectPass bool expectPass bool
}{ }{
{0, addrs[0], NewNonSplitVoteOption(OptionYes), true}, {0, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), true},
{0, sdk.AccAddress{}, NewNonSplitVoteOption(OptionYes), false}, {0, sdk.AccAddress{}, v1beta2.NewNonSplitVoteOption(v1beta2.OptionYes), false},
{0, addrs[0], NewNonSplitVoteOption(OptionNo), true}, {0, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionNo), true},
{0, addrs[0], NewNonSplitVoteOption(OptionNoWithVeto), true}, {0, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionNoWithVeto), true},
{0, addrs[0], NewNonSplitVoteOption(OptionAbstain), true}, {0, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.OptionAbstain), true},
{0, addrs[0], WeightedVoteOptions{ // weight sum > 1 {0, addrs[0], v1beta2.WeightedVoteOptions{ // weight sum > 1
NewWeightedVoteOption(OptionYes, sdk.NewDec(1)), v1beta2.NewWeightedVoteOption(v1beta2.OptionYes, sdk.NewDec(1)),
NewWeightedVoteOption(OptionAbstain, sdk.NewDec(1)), v1beta2.NewWeightedVoteOption(v1beta2.OptionAbstain, sdk.NewDec(1)),
}, false}, }, false},
{0, addrs[0], WeightedVoteOptions{ // duplicate option {0, addrs[0], v1beta2.WeightedVoteOptions{ // duplicate option
NewWeightedVoteOption(OptionYes, sdk.NewDecWithPrec(5, 1)), v1beta2.NewWeightedVoteOption(v1beta2.OptionYes, sdk.NewDecWithPrec(5, 1)),
NewWeightedVoteOption(OptionYes, sdk.NewDecWithPrec(5, 1)), v1beta2.NewWeightedVoteOption(v1beta2.OptionYes, sdk.NewDecWithPrec(5, 1)),
}, false}, }, false},
{0, addrs[0], WeightedVoteOptions{ // zero weight {0, addrs[0], v1beta2.WeightedVoteOptions{ // zero weight
NewWeightedVoteOption(OptionYes, sdk.NewDec(0)), v1beta2.NewWeightedVoteOption(v1beta2.OptionYes, sdk.NewDec(0)),
}, false}, }, false},
{0, addrs[0], WeightedVoteOptions{ // negative weight {0, addrs[0], v1beta2.WeightedVoteOptions{ // negative weight
NewWeightedVoteOption(OptionYes, sdk.NewDec(-1)), v1beta2.NewWeightedVoteOption(v1beta2.OptionYes, sdk.NewDec(-1)),
}, false}, }, false},
{0, addrs[0], WeightedVoteOptions{}, false}, {0, addrs[0], v1beta2.WeightedVoteOptions{}, false},
{0, addrs[0], NewNonSplitVoteOption(VoteOption(0x13)), false}, {0, addrs[0], v1beta2.NewNonSplitVoteOption(v1beta2.VoteOption(0x13)), false},
{0, addrs[0], WeightedVoteOptions{ // weight sum <1 {0, addrs[0], v1beta2.WeightedVoteOptions{ // weight sum <1
NewWeightedVoteOption(OptionYes, sdk.NewDecWithPrec(5, 1)), v1beta2.NewWeightedVoteOption(v1beta2.OptionYes, sdk.NewDecWithPrec(5, 1)),
}, false}, }, false},
} }
for i, tc := range tests { for i, tc := range tests {
msg := NewMsgVoteWeighted(tc.voterAddr, tc.proposalID, tc.options) msg := v1beta2.NewMsgVoteWeighted(tc.voterAddr, tc.proposalID, tc.options)
if tc.expectPass { if tc.expectPass {
require.Nil(t, msg.ValidateBasic(), "test: %v", i) require.Nil(t, msg.ValidateBasic(), "test: %v", i)
} else { } else {
@ -127,8 +128,8 @@ func TestMsgVoteWeighted(t *testing.T) {
// this tests that Amino JSON MsgSubmitProposal.GetSignBytes() still works with Content as Any using the ModuleCdc // this tests that Amino JSON MsgSubmitProposal.GetSignBytes() still works with Content as Any using the ModuleCdc
func TestMsgSubmitProposal_GetSignBytes(t *testing.T) { func TestMsgSubmitProposal_GetSignBytes(t *testing.T) {
proposal := []sdk.Msg{NewMsgVote(addrs[0], 1, OptionYes)} proposal := []sdk.Msg{v1beta2.NewMsgVote(addrs[0], 1, v1beta2.OptionYes)}
msg, err := NewMsgSubmitProposal(proposal, sdk.NewCoins(), sdk.AccAddress{}) msg, err := v1beta2.NewMsgSubmitProposal(proposal, sdk.NewCoins(), sdk.AccAddress{})
require.NoError(t, err) require.NoError(t, err)
var bz []byte var bz []byte
require.NotPanics(t, func() { require.NotPanics(t, func() {

View File

@ -1,4 +1,4 @@
package types package v1beta2
import ( import (
"errors" "errors"

View File

@ -1,4 +1,4 @@
package types package v1beta2
import ( import (
"fmt" "fmt"

View File

@ -1,17 +1,17 @@
package types_test package v1beta2_test
import ( import (
"fmt" "fmt"
"testing" "testing"
"github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
func TestProposalStatus_Format(t *testing.T) { func TestProposalStatus_Format(t *testing.T) {
statusDepositPeriod, _ := types.ProposalStatusFromString("PROPOSAL_STATUS_DEPOSIT_PERIOD") statusDepositPeriod, _ := v1beta2.ProposalStatusFromString("PROPOSAL_STATUS_DEPOSIT_PERIOD")
tests := []struct { tests := []struct {
pt types.ProposalStatus pt v1beta2.ProposalStatus
sprintFArgs string sprintFArgs string
expectedStringOutput string expectedStringOutput string
}{ }{

View File

@ -1,4 +1,4 @@
package types package v1beta2
import ( import (
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT. // Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: cosmos/gov/v1beta2/query.proto // source: cosmos/gov/v1beta2/query.proto
package types package v1beta2
import ( import (
context "context" context "context"
@ -895,67 +895,67 @@ func init() {
func init() { proto.RegisterFile("cosmos/gov/v1beta2/query.proto", fileDescriptor_3efdc0c4615c3665) } func init() { proto.RegisterFile("cosmos/gov/v1beta2/query.proto", fileDescriptor_3efdc0c4615c3665) }
var fileDescriptor_3efdc0c4615c3665 = []byte{ var fileDescriptor_3efdc0c4615c3665 = []byte{
// 952 bytes of a gzipped FileDescriptorProto // 955 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4f, 0x6f, 0x1b, 0x45, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4f, 0x6f, 0x1b, 0x45,
0x14, 0xcf, 0x38, 0x49, 0x1b, 0xbf, 0xb4, 0x01, 0x1e, 0x05, 0x8c, 0x29, 0x4e, 0x58, 0xd1, 0xd6, 0x14, 0xcf, 0x38, 0x49, 0x1b, 0xbf, 0xb4, 0x01, 0x1e, 0x05, 0x8c, 0x29, 0x4e, 0x58, 0xd1, 0xd6,
0xa4, 0xcd, 0x2e, 0x49, 0x68, 0x4b, 0x0b, 0x07, 0x62, 0x41, 0x29, 0x42, 0x48, 0xa9, 0x5b, 0x71, 0xa4, 0xcd, 0x6e, 0x93, 0xd0, 0x96, 0x16, 0x0e, 0x24, 0x82, 0x52, 0x40, 0x48, 0xa9, 0x5b, 0x71,
0xe0, 0x12, 0x6d, 0xe2, 0xd5, 0xb2, 0xc2, 0xd9, 0xd9, 0x7a, 0xc6, 0x16, 0x51, 0x88, 0x90, 0xb8, 0xe0, 0x12, 0x6d, 0xe2, 0xd5, 0xb2, 0xc2, 0xd9, 0xd9, 0xee, 0x8c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0x59, 0x5b, 0xff, 0xe0, 0xb7, 0x83, 0x06, 0x7b, 0x78, 0xd0, 0x60, 0x7f, 0x1f, 0x34, 0xd8,
0x3b, 0xaa, 0x4d, 0x3d, 0x3a, 0xaa, 0x4d, 0xfd, 0x75, 0x54, 0x9b, 0xfa, 0xa4, 0xee, 0x07, 0xf2, 0x77, 0x87, 0x8d, 0x89, 0x87, 0x87, 0x8d, 0x89, 0xbf, 0x0e, 0x1b, 0x13, 0x9f, 0x5c, 0xf6, 0x03,
0xd3, 0xee, 0xb6, 0xbd, 0xc3, 0x77, 0x8d, 0x5b, 0xfd, 0x67, 0x45, 0xb4, 0x3e, 0x73, 0x3e, 0x57, 0xf9, 0x69, 0x77, 0xcb, 0xde, 0xe6, 0x3b, 0xc6, 0xad, 0xfe, 0xb3, 0x24, 0xda, 0x9f, 0x39, 0x9f,
0x31, 0xe2, 0x91, 0x11, 0xdb, 0xa7, 0xd4, 0x2f, 0x95, 0xf5, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xab, 0x18, 0xc9, 0xc8, 0x08, 0x13, 0x69, 0xeb, 0x84, 0xfa, 0xc5, 0xb2, 0xfa, 0x5f, 0x00, 0x00,
0x6d, 0xa1, 0x92, 0x20, 0x62, 0x0d, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb2, 0x31, 0x71, 0x47, 0x6a, 0x0d, 0x00, 0x00,
} }
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.

View File

@ -2,11 +2,11 @@
// source: cosmos/gov/v1beta2/query.proto // source: cosmos/gov/v1beta2/query.proto
/* /*
Package types is a reverse proxy. Package v1beta2 is a reverse proxy.
It translates gRPC into RESTful JSON APIs. It translates gRPC into RESTful JSON APIs.
*/ */
package types package v1beta2
import ( import (
"context" "context"
@ -20,7 +20,6 @@ import (
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog" "google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
) )
@ -31,7 +30,6 @@ var _ status.Status
var _ = runtime.String var _ = runtime.String
var _ = utilities.NewDoubleArray var _ = utilities.NewDoubleArray
var _ = descriptor.ForMessage 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) { 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 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". // RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
// UnaryRPC :call QueryServer directly. // UnaryRPC :call QueryServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // 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 { 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) { mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil { if err != nil {
@ -545,7 +541,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
return return
} }
resp, md, err := local_request_Query_Proposal_0(rctx, inboundMarshaler, server, req, pathParams) 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) ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil { if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 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) { mux.Handle("GET", pattern_Query_Proposals_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil { if err != nil {
@ -568,7 +561,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
return return
} }
resp, md, err := local_request_Query_Proposals_0(rctx, inboundMarshaler, server, req, pathParams) 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) ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil { if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 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) { mux.Handle("GET", pattern_Query_Vote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil { if err != nil {
@ -591,7 +581,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
return return
} }
resp, md, err := local_request_Query_Vote_0(rctx, inboundMarshaler, server, req, pathParams) 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) ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil { if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 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) { mux.Handle("GET", pattern_Query_Votes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil { if err != nil {
@ -614,7 +601,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
return return
} }
resp, md, err := local_request_Query_Votes_0(rctx, inboundMarshaler, server, req, pathParams) 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) ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil { if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 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) { mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil { if err != nil {
@ -637,7 +621,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
return return
} }
resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) 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) ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil { if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 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) { mux.Handle("GET", pattern_Query_Deposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil { if err != nil {
@ -660,7 +641,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
return return
} }
resp, md, err := local_request_Query_Deposit_0(rctx, inboundMarshaler, server, req, pathParams) 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) ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil { if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 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) { mux.Handle("GET", pattern_Query_Deposits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil { if err != nil {
@ -683,7 +661,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
return return
} }
resp, md, err := local_request_Query_Deposits_0(rctx, inboundMarshaler, server, req, pathParams) 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) ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil { if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 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) { mux.Handle("GET", pattern_Query_TallyResult_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil { if err != nil {
@ -706,7 +681,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
return return
} }
resp, md, err := local_request_Query_TallyResult_0(rctx, inboundMarshaler, server, req, pathParams) 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) ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil { if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)

View File

@ -1,4 +1,4 @@
package types package v1beta2
import ( import (
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT. // Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: cosmos/gov/v1beta2/tx.proto // source: cosmos/gov/v1beta2/tx.proto
package types package v1beta2
import ( import (
context "context" context "context"
@ -450,44 +450,44 @@ func init() {
func init() { proto.RegisterFile("cosmos/gov/v1beta2/tx.proto", fileDescriptor_4214261f6b3f9ed4) } func init() { proto.RegisterFile("cosmos/gov/v1beta2/tx.proto", fileDescriptor_4214261f6b3f9ed4) }
var fileDescriptor_4214261f6b3f9ed4 = []byte{ var fileDescriptor_4214261f6b3f9ed4 = []byte{
// 585 bytes of a gzipped FileDescriptorProto // 588 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcf, 0x6e, 0xd3, 0x4e,
0x14, 0x8d, 0x9b, 0x7e, 0xfd, 0xb9, 0xfd, 0x94, 0xaa, 0x56, 0x24, 0x1c, 0x17, 0xb9, 0x91, 0x11, 0x10, 0x8e, 0x9b, 0xfe, 0xfa, 0x67, 0xfa, 0x53, 0xab, 0x5a, 0x91, 0x70, 0x5c, 0xe4, 0x46, 0x46,
0x55, 0x24, 0x94, 0x31, 0x09, 0xa8, 0x6c, 0x58, 0xd0, 0xc0, 0xa2, 0x2c, 0x22, 0xc0, 0x95, 0x40, 0x54, 0x91, 0x50, 0xd6, 0x4d, 0x40, 0xe5, 0xc2, 0x81, 0x06, 0x0e, 0x05, 0x29, 0x02, 0x5c, 0x09,
0x62, 0x13, 0xec, 0x78, 0x3a, 0x1d, 0x91, 0xf8, 0x5a, 0x9e, 0x49, 0xd4, 0xbc, 0x05, 0xe2, 0x01, 0x24, 0x2e, 0xc1, 0x8e, 0xb7, 0xdb, 0x15, 0x89, 0xc7, 0xf2, 0x6e, 0xa2, 0xe6, 0x2d, 0x10, 0x0f,
0x58, 0xf1, 0x08, 0xbc, 0x02, 0x52, 0x97, 0x15, 0x2b, 0x56, 0x08, 0x25, 0x5b, 0x1e, 0x02, 0xc5, 0xc0, 0x89, 0x47, 0xe0, 0x15, 0x90, 0x7a, 0xac, 0x38, 0x71, 0x42, 0x28, 0xb9, 0xf2, 0x10, 0x28,
0x1e, 0xbb, 0xd0, 0xa4, 0x49, 0x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xf2, 0x74, 0xe0, 0x93, 0x2e, 0xf6, 0xd5, 0x1d, 0xa7, 0x7e, 0xea, 0x22, 0x78, 0xef, 0x9c, 0x25, 0x33, 0x2e, 0x4f, 0xfb, 0x3e, 0xe9, 0x60, 0x4f, 0xed, 0x38, 0xf5, 0x53, 0x13, 0xc1, 0x7b, 0xe7,
0x37, 0xa6, 0x1c, 0x45, 0x54, 0xf8, 0x6b, 0xc9, 0x4d, 0xf5, 0xe0, 0x77, 0x00, 0x00, 0x00, 0xff, 0x2c, 0xd9, 0x98, 0x72, 0x18, 0x51, 0x91, 0xed, 0x4d, 0x7f, 0x25, 0xd9, 0x58, 0xf7, 0x7f, 0x07,
0xff, 0xe7, 0x3b, 0xf1, 0xb1, 0x9d, 0x05, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x86, 0xf2, 0x34, 0xac, 0xa5, 0x05, 0x00, 0x00,
} }
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.

View File

@ -1,4 +1,4 @@
package types package v1beta2
import ( import (
"fmt" "fmt"