Skip to content

Commit

Permalink
fix: cli grants-by-grantee, grants-by-granter cmds (#11983)
Browse files Browse the repository at this point in the history
## Description

ref: #11362

---

### 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/main/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/main/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/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)

(cherry picked from commit f470d40)

# Conflicts:
#	CHANGELOG.md
  • Loading branch information
atheeshp authored and mergify[bot] committed May 24, 2022
1 parent 2921a1c commit ba38fdd
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 8 deletions.
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,44 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [\#11772](https://github.com/cosmos/cosmos-sdk/pull/11772) Limit types.Dec length to avoid overflow.
* [\#10947](https://github.com/cosmos/cosmos-sdk/pull/10947) Add `AllowancesByGranter` query to the feegrant module
* [\#9639](https://github.com/cosmos/cosmos-sdk/pull/9639) Check store keys length before accessing them by making sure that `key` is of length `m+1` (for `key[n:m]`)
<<<<<<< HEAD
=======
* (types) [\#9627](https://github.com/cosmos/cosmos-sdk/pull/9627) Fix nil pointer panic on `NewBigIntFromInt`
* (x/genutil) [\#9574](https://github.com/cosmos/cosmos-sdk/pull/9575) Actually use the `gentx` client tx flags (like `--keyring-dir`)
* (x/distribution) [\#9599](https://github.com/cosmos/cosmos-sdk/pull/9599) Withdraw rewards event now includes a value attribute even if there are 0 rewards (due to situations like 100% commission).
* (x/genutil) [\#9638](https://github.com/cosmos/cosmos-sdk/pull/9638) Added missing validator key save when recovering from mnemonic
* [\#9762](https://github.com/cosmos/cosmos-sdk/pull/9762) The init command uses the chain-id from the client config if --chain-id is not provided
* [\#9854](https://github.com/cosmos/cosmos-sdk/pull/9854) Fixed the `make proto-gen` to get dynamic container name based on project name for the cosmos based sdks.
* [\#9980](https://github.com/cosmos/cosmos-sdk/pull/9980) Returning the error when the invalid argument is passed to bank query total supply cli.
* (server) [#10016](https://github.com/cosmos/cosmos-sdk/issues/10016) Fix marshaling of index-events into server config file.
* [\#10184](https://github.com/cosmos/cosmos-sdk/pull/10184) Fixed CLI tx commands to no longer explicitly require the chain-id flag as this value can come from a user config.
* [\#10239](https://github.com/cosmos/cosmos-sdk/pull/10239) Fixed x/bank/044 migrateDenomMetadata.
* (x/upgrade) [\#10189](https://github.com/cosmos/cosmos-sdk/issues/10189) Removed potential sources of non-determinism in upgrades
* [\#10258](https://github.com/cosmos/cosmos-sdk/issues/10258) Fixes issue related to segmentation fault on mac m1 arm64
* [\#10466](https://github.com/cosmos/cosmos-sdk/issues/10466) Fixes error with simulation tests when genesis start time is randomly created after the year 2262
* [\#10394](https://github.com/cosmos/cosmos-sdk/issues/10394) Fixes issue related to grpc-gateway of account balance by
ibc-denom.
* [\#10593](https://github.com/cosmos/cosmos-sdk/pull/10593) Update swagger-ui to v4.1.0 to fix xss vulnerability.
* [\#10842](https://github.com/cosmos/cosmos-sdk/pull/10842) Fix error when `--generate-only`, `--max-msgs` fags set while executing `WithdrawAllRewards` command.
* [\#10897](https://github.com/cosmos/cosmos-sdk/pull/10897) Fix: set a non-zero value on gas overflow.
* [#9790](https://github.com/cosmos/cosmos-sdk/pull/10687) Fix behavior of `DecCoins.MulDecTruncate`.
* [\#10990](https://github.com/cosmos/cosmos-sdk/pull/10990) Fixes missing `iavl-cache-size` config parsing in `GetConfig` method.
* (crypto) [#11027] Remove dependency on Tendermint core for xsalsa20symmetric.
* (x/authz) [\#10447](https://github.com/cosmos/cosmos-sdk/pull/10447) Fix authz `NewGrant` expiration check.
* (x/authz) [\#10633](https://github.com/cosmos/cosmos-sdk/pull/10633) Fixed authorization not found error when executing message.
* [#11222](https://github.com/cosmos/cosmos-sdk/pull/11222) reject query with block height in the future
* [#11229](https://github.com/cosmos/cosmos-sdk/pull/11229) Handled the error message of `transaction encountered error` from tendermint.
* (x/authz) [\#11252](https://github.com/cosmos/cosmos-sdk/pull/11252) Allow insufficient funds error for authz simulation
* (cli) [\#11313](https://github.com/cosmos/cosmos-sdk/pull/11313) Fixes `--gas auto` when executing CLI transactions in `--generate-only` mode
* (cli) [\#11337](https://github.com/cosmos/cosmos-sdk/pull/11337) Fixes `show-adress` cli cmd
* (crypto) [\#11298](https://github.com/cosmos/cosmos-sdk/pull/11298) Fix cgo secp signature verification and update libscep256k1 library.
* (x/authz) [\#11512](https://github.com/cosmos/cosmos-sdk/pull/11512) Fix response of a panic to error, when subtracting balances.
* (rosetta) [\#11590](https://github.com/cosmos/cosmos-sdk/pull/11590) `/block` returns an error with nil pointer when a request has both of index and hash and increase timeout for huge genesis.
* (x/feegrant) [\#11813](https://github.com/cosmos/cosmos-sdk/pull/11813) Fix pagination total count in `AllowancesByGranter` query.
* (simapp) [\#11855](https://github.com/cosmos/cosmos-sdk/pull/11855) Use `sdkmath.Int` instead of `int64` for `SimulationState.InitialStake`.
* (x/capability) [\#11737](https://github.com/cosmos/cosmos-sdk/pull/11737) Use a fixed length encoding of `Capability` pointer for `FwdCapabilityKey`
* [\#11983](https://github.com/cosmos/cosmos-sdk/pull/11983) (x/feegrant, x/authz) rename grants query commands to `grants-by-grantee`, `grants-by-granter` cmds.
>>>>>>> f470d402a (fix: cli `grants-by-grantee`, `grants-by-granter` cmds (#11983))
## Improvements

Expand Down
8 changes: 4 additions & 4 deletions x/authz/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ $ %s query %s grants cosmos1skjw.. cosmos1skjwj.. %s

func GetQueryGranterGrants() *cobra.Command {
cmd := &cobra.Command{
Use: "granter-grants [granter-addr]",
Use: "grants-by-granter [granter-addr]",
Args: cobra.ExactArgs(1),
Short: "query authorization grants granted by granter",
Long: strings.TrimSpace(
fmt.Sprintf(`Query authorization grants granted by granter.
Examples:
$ %s q %s granter-grants cosmos1skj..
$ %s q %s grants-by-granter cosmos1skj..
`,
version.AppName, authz.ModuleName),
),
Expand Down Expand Up @@ -144,13 +144,13 @@ $ %s q %s granter-grants cosmos1skj..

func GetQueryGranteeGrants() *cobra.Command {
cmd := &cobra.Command{
Use: "grantee-grants [grantee-addr]",
Use: "grants-by-grantee [grantee-addr]",
Args: cobra.ExactArgs(1),
Short: "query authorization grants granted to a grantee",
Long: strings.TrimSpace(
fmt.Sprintf(`Query authorization grants granted to a grantee.
Examples:
$ %s q %s grantee-grants cosmos1skj..
$ %s q %s grants-by-grantee cosmos1skj..
`,
version.AppName, authz.ModuleName),
),
Expand Down
8 changes: 4 additions & 4 deletions x/feegrant/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ $ %s query feegrant grant [granter] [grantee]
// GetCmdQueryFeeGrantsByGrantee returns cmd to query for all grants for a grantee.
func GetCmdQueryFeeGrantsByGrantee() *cobra.Command {
cmd := &cobra.Command{
Use: "grants [grantee]",
Use: "grants-by-grantee [grantee]",
Args: cobra.ExactArgs(1),
Short: "Query all grants of a grantee",
Long: strings.TrimSpace(
fmt.Sprintf(`Queries all the grants for a grantee address.
Example:
$ %s query feegrant grants [grantee]
$ %s query feegrant grants-by-grantee [grantee]
`, version.AppName),
),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down Expand Up @@ -133,14 +133,14 @@ $ %s query feegrant grants [grantee]
// GetCmdQueryFeeGrantsByGranter returns cmd to query for all grants by a granter.
func GetCmdQueryFeeGrantsByGranter() *cobra.Command {
cmd := &cobra.Command{
Use: "grants [granter]",
Use: "grants-by-granter [granter]",
Args: cobra.ExactArgs(1),
Short: "Query all grants by a granter",
Long: strings.TrimSpace(
fmt.Sprintf(`Queries all the grants issued for a granter address.
Example:
$ %s query feegrant grants [granter]
$ %s query feegrant grants-by-granter [granter]
`, version.AppName),
),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down

0 comments on commit ba38fdd

Please sign in to comment.