Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(x/feegrant): feegrant autcli module query #16213

Merged
merged 18 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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