Skip to content

Commit

Permalink
feat(x/feegrant): feegrant autcli module query (#16213)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeancarloBarrios committed Jun 7, 2023
1 parent d0e1a9b commit c80d64e
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 332 deletions.
175 changes: 0 additions & 175 deletions x/feegrant/client/cli/query.go

This file was deleted.

156 changes: 0 additions & 156 deletions x/feegrant/client/cli/query_test.go

This file was deleted.

56 changes: 56 additions & 0 deletions x/feegrant/module/autocli.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package module

import (
"fmt"
"strings"

autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
feegrantv1beta1 "cosmossdk.io/api/cosmos/feegrant/v1beta1"

"github.com/cosmos/cosmos-sdk/version"
)

func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
return &autocliv1.ModuleOptions{
Query: &autocliv1.ServiceCommandDescriptor{
Service: feegrantv1beta1.Query_ServiceDesc.ServiceName,
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "Allowance",
Use: "grant [granter] [grantee]",
Short: "Query details of a single grant",
Long: strings.TrimSpace(
`Query details for a grant.
You can find the fee-grant of a granter and grantee.`),
Example: fmt.Sprintf(`$ %s query feegrant grant [granter] [grantee]`, version.AppName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "granter"},
{ProtoField: "grantee"},
},
},
{
RpcMethod: "Allowances",
Use: "grants-by-grantee [grantee]",
Short: "Query all grants of a grantee",
Long: "Queries all the grants for a grantee address.",
Example: fmt.Sprintf(`$ %s query feegrant grants-by-grantee [grantee]`, version.AppName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "grantee"},
},
},
{
RpcMethod: "AllowancesByGranter",
Use: "grants-by-granter [granter]",
Short: "Query all grants by a granter",
Example: fmt.Sprintf(`$ %s query feegrant grants-by-granter [granter]`, version.AppName),
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "granter"},
},
},
},
},
Tx: &autocliv1.ServiceCommandDescriptor{
Service: feegrantv1beta1.Msg_ServiceDesc.ServiceName,
},
}
}
2 changes: 1 addition & 1 deletion x/feegrant/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (ab AppModuleBasic) GetTxCmd() *cobra.Command {

// GetQueryCmd returns no root query command for the feegrant module.
func (ab AppModuleBasic) GetQueryCmd() *cobra.Command {
return cli.GetQueryCmd(ab.ac)
return nil
}

// ----------------------------------------------------------------------------
Expand Down

0 comments on commit c80d64e

Please sign in to comment.