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(params): autocli query support #17007

Merged
merged 3 commits into from
Jul 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
22 changes: 0 additions & 22 deletions tests/e2e/params/app_config.go
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

params was already sufficiently tested.

This file was deleted.

19 changes: 0 additions & 19 deletions tests/e2e/params/cli_test.go

This file was deleted.

85 changes: 0 additions & 85 deletions tests/e2e/params/grpc.go

This file was deleted.

148 changes: 0 additions & 148 deletions tests/e2e/params/suite.go

This file was deleted.

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

import (
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
paramsv1beta1 "cosmossdk.io/api/cosmos/params/v1beta1"
)

// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.
func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
return &autocliv1.ModuleOptions{
Query: &autocliv1.ServiceCommandDescriptor{
Service: paramsv1beta1.Query_ServiceDesc.ServiceName,
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "Params",
Use: "subspace [subspace] [key]",
Short: "Query for raw parameters by subspace and key",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "subspace"},
{ProtoField: "key"},
},
},
{
RpcMethod: "Subspaces",
Use: "subspaces",
Short: "Query for all registered subspaces and all keys for a subspace",
},
},
},
}
}
54 changes: 0 additions & 54 deletions x/params/client/cli/query.go

This file was deleted.

7 changes: 0 additions & 7 deletions x/params/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"

gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"

modulev1 "cosmossdk.io/api/cosmos/params/module/v1"
"cosmossdk.io/core/appmodule"
Expand All @@ -17,7 +16,6 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
"github.com/cosmos/cosmos-sdk/x/params/client/cli"
"github.com/cosmos/cosmos-sdk/x/params/keeper"
"github.com/cosmos/cosmos-sdk/x/params/types"
"github.com/cosmos/cosmos-sdk/x/params/types/proposal"
Expand Down Expand Up @@ -52,11 +50,6 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *g
}
}

// GetQueryCmd returns no root query command for the params module.
func (AppModuleBasic) GetQueryCmd() *cobra.Command {
return cli.NewQueryCmd()
}

func (am AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) {
proposal.RegisterInterfaces(registry)
}
Expand Down