chore: Bump gov and group to v1 (#11334)
## Description Closes: #11331 --- ### 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:
@@ -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.v1beta2.MsgVote --from=cosmos1sk..
|
||||
$ %s tx %s grant cosmos1skjw.. generic --msg-type=/cosmos.gov.v1.MsgVote --from=cosmos1sk..
|
||||
`, version.AppName, authz.ModuleName, bank.SendAuthorization{}.MsgTypeURL(), version.AppName, authz.ModuleName),
|
||||
),
|
||||
Args: cobra.ExactArgs(2),
|
||||
|
||||
@@ -19,8 +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"
|
||||
govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
|
||||
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"
|
||||
)
|
||||
|
||||
@@ -56,7 +56,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
|
||||
// create a proposal with deposit
|
||||
_, err = govtestutil.MsgSubmitLegacyProposal(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()))
|
||||
fmt.Sprintf("--%s=%s", govcli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, govv1.DefaultMinDepositTokens).String()))
|
||||
s.Require().NoError(err)
|
||||
|
||||
// Create new account in the keyring.
|
||||
@@ -140,8 +140,8 @@ func (s *IntegrationTestSuite) TearDownSuite() {
|
||||
}
|
||||
|
||||
var typeMsgSend = bank.SendAuthorization{}.MsgTypeURL()
|
||||
var typeMsgVote = sdk.MsgTypeURL(&govv1beta2.MsgVote{})
|
||||
var typeMsgSubmitProposal = sdk.MsgTypeURL(&govv1beta2.MsgSubmitProposal{})
|
||||
var typeMsgVote = sdk.MsgTypeURL(&govv1.MsgVote{})
|
||||
var typeMsgSubmitProposal = sdk.MsgTypeURL(&govv1.MsgSubmitProposal{})
|
||||
|
||||
func (s *IntegrationTestSuite) TestCLITxGrantAuthorization() {
|
||||
val := s.network.Validators[0]
|
||||
@@ -531,7 +531,7 @@ func (s *IntegrationTestSuite) TestExecAuthorizationWithExpiration() {
|
||||
)
|
||||
s.Require().NoError(err)
|
||||
// msg vote
|
||||
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())
|
||||
voteTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.gov.v1.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 +572,7 @@ func (s *IntegrationTestSuite) TestNewExecGenericAuthorized() {
|
||||
s.Require().NoError(err)
|
||||
|
||||
// msg vote
|
||||
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())
|
||||
voteTx := fmt.Sprintf(`{"body":{"messages":[{"@type":"/cosmos.gov.v1.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 {
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
|
||||
"github.com/cosmos/cosmos-sdk/x/authz"
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2"
|
||||
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
|
||||
)
|
||||
|
||||
// genGrant returns a slice of authorization grants.
|
||||
@@ -33,7 +33,7 @@ func genGrant(r *rand.Rand, accounts []simtypes.Account, genT time.Time) []authz
|
||||
func generateRandomGrant(r *rand.Rand) *codectypes.Any {
|
||||
authorizations := make([]*codectypes.Any, 2)
|
||||
authorizations[0] = newAnyAuthorization(banktypes.NewSendAuthorization(sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(1000)))))
|
||||
authorizations[1] = newAnyAuthorization(authz.NewGenericAuthorization(sdk.MsgTypeURL(&v1beta2.MsgSubmitProposal{})))
|
||||
authorizations[1] = newAnyAuthorization(authz.NewGenericAuthorization(sdk.MsgTypeURL(&v1.MsgSubmitProposal{})))
|
||||
|
||||
return authorizations[r.Intn(len(authorizations))]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user