diff --git a/CHANGELOG.md b/CHANGELOG.md index c5a7c38582fc..5e9609791e2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* (types) [#16890](https://github.com/cosmos/cosmos-sdk/pull/16890) Remove `GetTxCmd() *cobra.Command` and `GetQueryCmd() *cobra.Command` from `module.AppModuleBasic` interface. * (cli) [#16856](https://github.com/cosmos/cosmos-sdk/pull/16856) Improve `simd prune` UX by using the app default home directory and set pruning method as first variable argument (defaults to default). * (all) [#16537](https://github.com/cosmos/cosmos-sdk/pull/16537) Properly propagated fmt.Errorf errors + using errors.New where appropriate. * (x/authz) [#16869](https://github.com/cosmos/cosmos-sdk/pull/16869) Error message has been improvised in `Exec` command when grant not found. diff --git a/UPGRADING.md b/UPGRADING.md index 8c049ea967f5..a109cbd127d3 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -222,23 +222,25 @@ The return type of the interface method `TxConfig.SignModeHandler()` has been ch #### `**all**` -[RFC 001](https://docs.cosmos.network/main/rfc/rfc-001-tx-validation) has defined a simplification of the message validation process for modules. +* [RFC 001](https://docs.cosmos.network/main/rfc/rfc-001-tx-validation) has defined a simplification of the message validation process for modules. The `sdk.Msg` interface has been updated to not require the implementation of the `ValidateBasic` method. It is now recommended to validate message directly in the message server. When the validation is performed in the message server, the `ValidateBasic` method on a message is no longer required and can be removed. -Messages no longer need to implement the `LegacyMsg` interface and implementations of `GetSignBytes` can be deleted. Because of this change, global legacy Amino codec definitions and their registration in `init()` can safely be removed as well. +* Messages no longer need to implement the `LegacyMsg` interface and implementations of `GetSignBytes` can be deleted. Because of this change, global legacy Amino codec definitions and their registration in `init()` can safely be removed as well. -The following modules' `Keeper` methods now take in a `context.Context` instead of `sdk.Context`. Any module that has an interfaces for them (like "expected keepers") will need to update and re-generate mocks if needed: +* The `AppModuleBasic` interface has been simplifed. Defining `GetTxCmd() *cobra.Command` and `GetQueryCmd() *cobra.Command` is no longer required. The module manager registers detects when module commands are defined. If AutoCLI is enabled, `EnhanceRootCommand()` will add the auto-generated commands to the root command, unless a custom module command is defined and register that one instead. -* `x/authz` -* `x/bank` -* `x/mint` -* `x/crisis` -* `x/distribution` -* `x/evidence` -* `x/gov` -* `x/slashing` -* `x/upgrade` +* The following modules' `Keeper` methods now take in a `context.Context` instead of `sdk.Context`. Any module that has an interfaces for them (like "expected keepers") will need to update and re-generate mocks if needed: + + * `x/authz` + * `x/bank` + * `x/mint` + * `x/crisis` + * `x/distribution` + * `x/evidence` + * `x/gov` + * `x/slashing` + * `x/upgrade` #### `x/auth` diff --git a/docs/docs/building-modules/01-module-manager.md b/docs/docs/building-modules/01-module-manager.md index 86d1f345e36e..15d0e85053cc 100644 --- a/docs/docs/building-modules/01-module-manager.md +++ b/docs/docs/building-modules/01-module-manager.md @@ -59,8 +59,6 @@ Let us go through the methods: * `RegisterLegacyAminoCodec(*codec.LegacyAmino)`: Registers the `amino` codec for the module, which is used to marshal and unmarshal structs to/from `[]byte` in order to persist them in the module's `KVStore`. * `RegisterInterfaces(codectypes.InterfaceRegistry)`: Registers a module's interface types and their concrete implementations as `proto.Message`. * `RegisterGRPCGatewayRoutes(client.Context, *runtime.ServeMux)`: Registers gRPC routes for the module. -* `GetTxCmd()`: Returns the root [`Tx` command](./09-module-interfaces.md#tx) for the module. The subcommands of this root command are used by end-users to generate new transactions containing [`message`s](./02-messages-and-queries.md#queries) defined in the module. -* `GetQueryCmd()`: Return the root [`query` command](./09-module-interfaces.md#query) for the module. The subcommands of this root command are used by end-users to generate new queries to the subset of the state defined by the module. All the `AppModuleBasic` of an application are managed by the [`BasicManager`](#basicmanager). @@ -242,8 +240,8 @@ It implements the following methods: * `DefaultGenesis(cdc codec.JSONCodec)`: Provides default genesis information for modules in the application by calling the [`DefaultGenesis(cdc codec.JSONCodec)`](./08-genesis.md#defaultgenesis) function of each module. It only calls the modules that implements the `HasGenesisBasics` interfaces. * `ValidateGenesis(cdc codec.JSONCodec, txEncCfg client.TxEncodingConfig, genesis map[string]json.RawMessage)`: Validates the genesis information modules by calling the [`ValidateGenesis(codec.JSONCodec, client.TxEncodingConfig, json.RawMessage)`](./08-genesis.md#validategenesis) function of modules implementing the `HasGenesisBasics` interface. * `RegisterGRPCGatewayRoutes(clientCtx client.Context, rtr *runtime.ServeMux)`: Registers gRPC routes for modules. -* `AddTxCommands(rootTxCmd *cobra.Command)`: Adds modules' transaction commands to the application's [`rootTxCommand`](../core/07-cli.md#transaction-commands). This function is usually called function from the `main.go` function of the [application's command-line interface](../core/07-cli.md). -* `AddQueryCommands(rootQueryCmd *cobra.Command)`: Adds modules' query commands to the application's [`rootQueryCommand`](../core/07-cli.md#query-commands). This function is usually called function from the `main.go` function of the [application's command-line interface](../core/07-cli.md). +* `AddTxCommands(rootTxCmd *cobra.Command)`: Adds modules' transaction commands (defined as `GetTxCmd() *cobra.Command`) to the application's [`rootTxCommand`](../core/07-cli.md#transaction-commands). This function is usually called function from the `main.go` function of the [application's command-line interface](../core/07-cli.md). +* `AddQueryCommands(rootQueryCmd *cobra.Command)`: Adds modules' query commands (defined as `GetQueryCmd() *cobra.Command`) to the application's [`rootQueryCommand`](../core/07-cli.md#query-commands). This function is usually called function from the `main.go` function of the [application's command-line interface](../core/07-cli.md). ### `Manager` diff --git a/docs/docs/building-modules/09-module-interfaces.md b/docs/docs/building-modules/09-module-interfaces.md index f50cc8c2f371..dc4ba0951104 100644 --- a/docs/docs/building-modules/09-module-interfaces.md +++ b/docs/docs/building-modules/09-module-interfaces.md @@ -48,13 +48,13 @@ In general, the getter function does the following: * **Adds transaction flags:** All transaction commands must add a set of transaction [flags](#flags). The transaction flags are used to collect additional information from the user (e.g. the amount of fees the user is willing to pay). The transaction flags are added to the constructed command using `AddTxFlagsToCmd(cmd)`. * **Returns the command:** Finally, the transaction command is returned. -Each module must implement `NewTxCmd()`, which aggregates all of the transaction commands of the module. Here is an example from the `x/bank` module: +Each module can implement `NewTxCmd()`, which aggregates all of the transaction commands of the module. Here is an example from the `x/bank` module: ```go reference https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/bank/client/cli/tx.go#L20-L35 ``` -Each module must also implement the `GetTxCmd()` method for `AppModuleBasic` that simply returns `NewTxCmd()`. This allows the root command to easily aggregate all of the transaction commands for each module. Here is an example: +Each module then can also implement a `GetTxCmd()` method that simply returns `NewTxCmd()`. This allows the root command to easily aggregate all of the transaction commands for each module. Here is an example: ```go reference https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/bank/module.go#L84-L86 @@ -62,8 +62,11 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/bank/module.go#L84-L ### Query Commands - - ## gRPC @@ -160,4 +163,4 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/auth/v1be gRPC gateway is started in-process along with the application and CometBFT. It can be enabled or disabled by setting gRPC Configuration `enable` in [`app.toml`](../run-node/02-interact-node.md#configuring-the-node-using-apptoml). -The Cosmos SDK provides a command for generating [Swagger](https://swagger.io/) documentation (`protoc-gen-swagger`). Setting `swagger` in [`app.toml`](../run-node/02-interact-node.md#configuring-the-node-using-apptoml) defines if swagger documentation should be automatically registered. --> +The Cosmos SDK provides a command for generating [Swagger](https://swagger.io/) documentation (`protoc-gen-swagger`). Setting `swagger` in [`app.toml`](../run-node/02-interact-node.md#configuring-the-node-using-apptoml) defines if swagger documentation should be automatically registered. diff --git a/docs/docs/core/03-node.md b/docs/docs/core/03-node.md index c2abe2c2f519..c24b9e4ec8d4 100644 --- a/docs/docs/core/03-node.md +++ b/docs/docs/core/03-node.md @@ -74,7 +74,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/server/types/app.go#L6 In practice, the [constructor of the application](../basics/00-app-anatomy.md#constructor-function) is passed as the `appCreator`. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root.go#L278-L291 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root_v2.go#L294-L308 ``` Then, the instance of `app` is used to instantiate a new CometBFT node: diff --git a/docs/docs/core/07-cli.md b/docs/docs/core/07-cli.md index bf9f260c0dab..42d4f66ed358 100644 --- a/docs/docs/core/07-cli.md +++ b/docs/docs/core/07-cli.md @@ -37,7 +37,7 @@ The `main.go` file needs to have a `main()` function that creates a root command * **setting configurations** by reading in configuration files (e.g. the Cosmos SDK config file). * **adding any flags** to it, such as `--chain-id`. -* **instantiating the `codec`** by calling the application's `MakeCodec()` function (called `MakeTestEncodingConfig` in `simapp`). The [`codec`](../core/05-encoding.md) is used to encode and decode data structures for the application - stores can only persist `[]byte`s so the developer must define a serialization format for their data structures or use the default, Protobuf. +* **instantiating the `codec`** by injecting the application codecs. The [`codec`](../core/05-encoding.md) is used to encode and decode data structures for the application - stores can only persist `[]byte`s so the developer must define a serialization format for their data structures or use the default, Protobuf. * **adding subcommand** for all the possible user interactions, including [transaction commands](#transaction-commands) and [query commands](#query-commands). The `main()` function finally creates an executor and [execute](https://pkg.go.dev/github.com/spf13/cobra#Command.Execute) the root command. See an example of `main()` function from the `simapp` application: @@ -66,21 +66,27 @@ Learn more [here](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/serv Next is an example `rootCmd` function from the `simapp` application. It instantiates the root command, adds a [*persistent* flag](#flags) and `PreRun` function to be run before every execution, and adds all of the necessary subcommands. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root.go#L47-L120 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root_v2.go#L47-L130 ``` +:::tip +Use the `EnhanceRootCommand()` from the AutoCLI options to automatically add auto-generated commands from the modules to the root command. +Additionnally it adds all manually defined modules commands (`tx` and `query`) as well. +Read more about [AutoCLI](https://docs.cosmos.network/main/building-modules/autocli#getting-started) in its dedicated section. +::: + `rootCmd` has a function called `initAppConfig()` which is useful for setting the application's custom configs. By default app uses CometBFT app config template from Cosmos SDK, which can be over-written via `initAppConfig()`. Here's an example code to override default `app.toml` template. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root.go#L136-L188 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root_v2.go#L144-L199 ``` The `initAppConfig()` also allows overriding the default Cosmos SDK's [server config](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/server/config/config.go#L235). One example is the `min-gas-prices` config, which defines the minimum gas prices a validator is willing to accept for processing a transaction. By default, the Cosmos SDK sets this parameter to `""` (empty string), which forces all validators to tweak their own `app.toml` and set a non-empty value, or else the node will halt on startup. This might not be the best UX for validators, so the chain developer can set a default `app.toml` value for validators inside this `initAppConfig()` function. ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root.go#L154-L170 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root_v2.go#L164-L180 ``` The root-level `status` and `keys` subcommands are common across most applications and do not interact with application state. The bulk of an application's functionality - what users can actually *do* with it - is enabled by its `tx` and `query` commands. @@ -90,43 +96,53 @@ The root-level `status` and `keys` subcommands are common across most applicatio [Transactions](./01-transactions.md) are objects wrapping [`Msg`s](../building-modules/02-messages-and-queries.md#messages) that trigger state changes. To enable the creation of transactions using the CLI interface, a function `txCommand` is generally added to the `rootCmd`: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root.go#L181-L189 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root_v2.go#L222-L229 ``` This `txCommand` function adds all the transaction available to end-users for the application. This typically includes: * **Sign command** from the [`auth`](../modules/auth/README.md) module that signs messages in a transaction. To enable multisig, add the `auth` module's `MultiSign` command. Since every transaction requires some sort of signature in order to be valid, the signing command is necessary for every application. * **Broadcast command** from the Cosmos SDK client tools, to broadcast transactions. -* **All [module transaction commands](../building-modules/09-module-interfaces.md#transaction-commands)** the application is dependent on, retrieved by using the [basic module manager's](../building-modules/01-module-manager.md#basic-manager) `AddTxCommands()` function. +* **All [module transaction commands](../building-modules/09-module-interfaces.md#transaction-commands)** the application is dependent on, retrieved by using the [basic module manager's](../building-modules/01-module-manager.md#basic-manager) `AddTxCommands()` function, or enhanced by [AutoCLI](https://docs.cosmos.network/main/building-modules/autocli#getting-started). Here is an example of a `txCommand` aggregating these subcommands from the `simapp` application: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root.go#L253-L275 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root_v2.go#L270-L292 ``` +:::tip +When using AutoCLI to generate module transaction commands, `EnhanceRootCommand()` automatically adds the module `tx` command to the root command. +Read more about [AutoCLI](https://docs.cosmos.network/main/building-modules/autocli#getting-started) in its dedicated section. +::: + ### Query Commands [**Queries**](../building-modules/02-messages-and-queries.md#queries) are objects that allow users to retrieve information about the application's state. To enable the creation of queries using the CLI interface, a function `queryCommand` is generally added to the `rootCmd`: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root.go#L232-L251 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root_v2.go#L222-L229 ``` This `queryCommand` function adds all the queries available to end-users for the application. This typically includes: -* **QueryTx** and/or other transaction query commands] from the `auth` module which allow the user to search for a transaction by inputting its hash, a list of tags, or a block height. These queries allow users to see if transactions have been included in a block. +* **QueryTx** and/or other transaction query commands from the `auth` module which allow the user to search for a transaction by inputting its hash, a list of tags, or a block height. These queries allow users to see if transactions have been included in a block. * **Account command** from the `auth` module, which displays the state (e.g. account balance) of an account given an address. * **Validator command** from the Cosmos SDK rpc client tools, which displays the validator set of a given height. * **Block command** from the Cosmos SDK RPC client tools, which displays the block data for a given height. -* **All [module query commands](../building-modules/09-module-interfaces.md#query-commands)** the application is dependent on, retrieved by using the [basic module manager's](../building-modules/01-module-manager.md#basic-manager) `AddQueryCommands()` function. +* **All [module query commands](../building-modules/09-module-interfaces.md#query-commands)** the application is dependent on, retrieved by using the [basic module manager's](../building-modules/01-module-manager.md#basic-manager) `AddQueryCommands()` function, or enhanced by [AutoCLI](https://docs.cosmos.network/main/building-modules/autocli#getting-started). Here is an example of a `queryCommand` aggregating subcommands from the `simapp` application: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root.go#L232-L251 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root_v2.go#L249-L268 ``` +:::tip +When using AutoCLI to generate module query commands, `EnhanceRootCommand()` automatically adds the module `query` command to the root command. +Read more about [AutoCLI](https://docs.cosmos.network/main/building-modules/autocli#getting-started) in its dedicated section. +::: + ## Flags Flags are used to modify commands; developers can include them in a `flags.go` file with their CLI. Users can explicitly include them in commands or pre-configure them by inside their [`app.toml`](../run-node/02-interact-node.md#configuring-the-node-using-apptoml). Commonly pre-configured flags include the `--node` to connect to and `--chain-id` of the blockchain the user wishes to interact with. @@ -163,7 +179,7 @@ It is vital that the root command of an application uses `PersistentPreRun()` co Here is an example of an `PersistentPreRun()` function from `simapp`: ```go reference -https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root.go#L70-L110 +https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/simd/cmd/root_v2.go#L81-L120 ``` The `SetCmdClientContextHandler` call reads persistent flags via `ReadPersistentCommandFlags` which creates a `client.Context` and sets that on the root command's `Context`. diff --git a/scripts/mockgen.sh b/scripts/mockgen.sh index a57691b951f7..cda998093a19 100755 --- a/scripts/mockgen.sh +++ b/scripts/mockgen.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash mockgen_cmd="mockgen" -$mockgen_cmd -source=baseapp/abci_utils.go -package mock -destination baseapp/testutil/mock/validator_store.go +$mockgen_cmd -source=baseapp/abci_utils.go -package mock -destination baseapp/testutil/mock/mocks.go $mockgen_cmd -source=client/account_retriever.go -package mock -destination testutil/mock/account_retriever.go $mockgen_cmd -package mock -destination store/mock/cosmos_cosmos_db_DB.go github.com/cosmos/cosmos-db DB $mockgen_cmd -source=types/module/module.go -package mock -destination testutil/mock/types_module_module.go diff --git a/testutil/mock/types_mock_appmodule.go b/testutil/mock/types_mock_appmodule.go index dd31281640ad..b5cab1121f0e 100644 --- a/testutil/mock/types_mock_appmodule.go +++ b/testutil/mock/types_mock_appmodule.go @@ -18,7 +18,6 @@ import ( module "github.com/cosmos/cosmos-sdk/types/module" gomock "github.com/golang/mock/gomock" runtime "github.com/grpc-ecosystem/grpc-gateway/runtime" - cobra "github.com/spf13/cobra" ) // MockAppModuleWithAllExtensions is a mock of AppModuleWithAllExtensions interface. @@ -101,34 +100,6 @@ func (mr *MockAppModuleWithAllExtensionsMockRecorder) ExportGenesis(arg0, arg1 i return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportGenesis", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).ExportGenesis), arg0, arg1) } -// GetQueryCmd mocks base method. -func (m *MockAppModuleWithAllExtensions) GetQueryCmd() *cobra.Command { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetQueryCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 -} - -// GetQueryCmd indicates an expected call of GetQueryCmd. -func (mr *MockAppModuleWithAllExtensionsMockRecorder) GetQueryCmd() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).GetQueryCmd)) -} - -// GetTxCmd mocks base method. -func (m *MockAppModuleWithAllExtensions) GetTxCmd() *cobra.Command { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTxCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 -} - -// GetTxCmd indicates an expected call of GetTxCmd. -func (mr *MockAppModuleWithAllExtensionsMockRecorder) GetTxCmd() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).GetTxCmd)) -} - // InitGenesis mocks base method. func (m *MockAppModuleWithAllExtensions) InitGenesis(arg0 types1.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) []types.ValidatorUpdate { m.ctrl.T.Helper() diff --git a/testutil/mock/types_module_module.go b/testutil/mock/types_module_module.go index 550628701c8e..223db3bcb86c 100644 --- a/testutil/mock/types_module_module.go +++ b/testutil/mock/types_module_module.go @@ -17,7 +17,6 @@ import ( module "github.com/cosmos/cosmos-sdk/types/module" gomock "github.com/golang/mock/gomock" runtime "github.com/grpc-ecosystem/grpc-gateway/runtime" - cobra "github.com/spf13/cobra" ) // MockAppModuleBasic is a mock of AppModuleBasic interface. @@ -43,34 +42,6 @@ func (m *MockAppModuleBasic) EXPECT() *MockAppModuleBasicMockRecorder { return m.recorder } -// GetQueryCmd mocks base method. -func (m *MockAppModuleBasic) GetQueryCmd() *cobra.Command { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetQueryCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 -} - -// GetQueryCmd indicates an expected call of GetQueryCmd. -func (mr *MockAppModuleBasicMockRecorder) GetQueryCmd() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockAppModuleBasic)(nil).GetQueryCmd)) -} - -// GetTxCmd mocks base method. -func (m *MockAppModuleBasic) GetTxCmd() *cobra.Command { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTxCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 -} - -// GetTxCmd indicates an expected call of GetTxCmd. -func (mr *MockAppModuleBasicMockRecorder) GetTxCmd() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockAppModuleBasic)(nil).GetTxCmd)) -} - // Name mocks base method. func (m *MockAppModuleBasic) Name() string { m.ctrl.T.Helper() @@ -260,34 +231,6 @@ func (mr *MockAppModuleGenesisMockRecorder) ExportGenesis(arg0, arg1 interface{} return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportGenesis", reflect.TypeOf((*MockAppModuleGenesis)(nil).ExportGenesis), arg0, arg1) } -// GetQueryCmd mocks base method. -func (m *MockAppModuleGenesis) GetQueryCmd() *cobra.Command { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetQueryCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 -} - -// GetQueryCmd indicates an expected call of GetQueryCmd. -func (mr *MockAppModuleGenesisMockRecorder) GetQueryCmd() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockAppModuleGenesis)(nil).GetQueryCmd)) -} - -// GetTxCmd mocks base method. -func (m *MockAppModuleGenesis) GetTxCmd() *cobra.Command { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTxCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 -} - -// GetTxCmd indicates an expected call of GetTxCmd. -func (mr *MockAppModuleGenesisMockRecorder) GetTxCmd() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockAppModuleGenesis)(nil).GetTxCmd)) -} - // InitGenesis mocks base method. func (m *MockAppModuleGenesis) InitGenesis(arg0 types1.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) []types.ValidatorUpdate { m.ctrl.T.Helper() @@ -468,34 +411,6 @@ func (m *MockAppModule) EXPECT() *MockAppModuleMockRecorder { return m.recorder } -// GetQueryCmd mocks base method. -func (m *MockAppModule) GetQueryCmd() *cobra.Command { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetQueryCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 -} - -// GetQueryCmd indicates an expected call of GetQueryCmd. -func (mr *MockAppModuleMockRecorder) GetQueryCmd() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockAppModule)(nil).GetQueryCmd)) -} - -// GetTxCmd mocks base method. -func (m *MockAppModule) GetTxCmd() *cobra.Command { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTxCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 -} - -// GetTxCmd indicates an expected call of GetTxCmd. -func (mr *MockAppModuleMockRecorder) GetTxCmd() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockAppModule)(nil).GetTxCmd)) -} - // Name mocks base method. func (m *MockAppModule) Name() string { m.ctrl.T.Helper() @@ -691,34 +606,6 @@ func (mr *MockHasABCIEndblockMockRecorder) EndBlock(arg0 interface{}) *gomock.Ca return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EndBlock", reflect.TypeOf((*MockHasABCIEndblock)(nil).EndBlock), arg0) } -// GetQueryCmd mocks base method. -func (m *MockHasABCIEndblock) GetQueryCmd() *cobra.Command { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetQueryCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 -} - -// GetQueryCmd indicates an expected call of GetQueryCmd. -func (mr *MockHasABCIEndblockMockRecorder) GetQueryCmd() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockHasABCIEndblock)(nil).GetQueryCmd)) -} - -// GetTxCmd mocks base method. -func (m *MockHasABCIEndblock) GetTxCmd() *cobra.Command { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTxCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 -} - -// GetTxCmd indicates an expected call of GetTxCmd. -func (mr *MockHasABCIEndblockMockRecorder) GetTxCmd() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockHasABCIEndblock)(nil).GetTxCmd)) -} - // Name mocks base method. func (m *MockHasABCIEndblock) Name() string { m.ctrl.T.Helper() diff --git a/tools/confix/README.md b/tools/confix/README.md index 19c637ba90b6..a990ed98d267 100644 --- a/tools/confix/README.md +++ b/tools/confix/README.md @@ -12,7 +12,7 @@ It is based on the [CometBFT RFC 019](https://github.com/cometbft/cometbft/blob/ ### Add Config Command -To add the confix tool, it's required to add the `ConfigCommand` to your application's root command file (e.g. `simd/cmd/root.go`). +To add the confix tool, it's required to add the `ConfigCommand` to your application's root command file (e.g. `/cmd/root.go`). Import the `confixCmd` package: diff --git a/tools/rosetta/README.md b/tools/rosetta/README.md index 3d8467aea892..68ad08becc7b 100644 --- a/tools/rosetta/README.md +++ b/tools/rosetta/README.md @@ -10,7 +10,7 @@ The `rosetta` package implements Coinbase's [Rosetta API](https://www.rosetta-ap The Rosetta API server is a stand-alone server that connects to a node of a chain developed with Cosmos SDK. -To enable Rosetta API support, it's required to add the `RosettaCommand` to your application's root command file (e.g. `simd/cmd/root.go`). +To enable Rosetta API support, it's required to add the `RosettaCommand` to your application's root command file (e.g. `/cmd/root.go`). Import the `rosettaCmd` package: diff --git a/types/module/module.go b/types/module/module.go index 6fe25a934be0..51e57e524100 100644 --- a/types/module/module.go +++ b/types/module/module.go @@ -57,11 +57,7 @@ type AppModuleBasic interface { HasName RegisterLegacyAminoCodec(*codec.LegacyAmino) RegisterInterfaces(types.InterfaceRegistry) - - // client functionality RegisterGRPCGatewayRoutes(client.Context, *runtime.ServeMux) - GetTxCmd() *cobra.Command - GetQueryCmd() *cobra.Command } // HasName allows the module to provide its own name for legacy purposes. @@ -163,8 +159,12 @@ func (bm BasicManager) RegisterGRPCGatewayRoutes(clientCtx client.Context, rtr * // AddTxCommands adds all tx commands to the rootTxCmd. func (bm BasicManager) AddTxCommands(rootTxCmd *cobra.Command) { for _, b := range bm { - if cmd := b.GetTxCmd(); cmd != nil { - rootTxCmd.AddCommand(cmd) + if mod, ok := b.(interface { + GetTxCmd() *cobra.Command + }); ok { + if cmd := mod.GetTxCmd(); cmd != nil { + rootTxCmd.AddCommand(cmd) + } } } } @@ -172,8 +172,12 @@ func (bm BasicManager) AddTxCommands(rootTxCmd *cobra.Command) { // AddQueryCommands adds all query commands to the rootQueryCmd. func (bm BasicManager) AddQueryCommands(rootQueryCmd *cobra.Command) { for _, b := range bm { - if cmd := b.GetQueryCmd(); cmd != nil { - rootQueryCmd.AddCommand(cmd) + if mod, ok := b.(interface { + GetQueryCmd() *cobra.Command + }); ok { + if cmd := mod.GetQueryCmd(); cmd != nil { + rootQueryCmd.AddCommand(cmd) + } } } } diff --git a/types/module/module_test.go b/types/module/module_test.go index 264e9c8b3598..3cde79f6a6fe 100644 --- a/types/module/module_test.go +++ b/types/module/module_test.go @@ -27,6 +27,12 @@ import ( var errFoo = errors.New("dummy") +func (MockCoreAppModule) GetQueryCmd() *cobra.Command { + return &cobra.Command{ + Use: "foo", + } +} + func TestBasicManager(t *testing.T) { mockCtrl := gomock.NewController(t) t.Cleanup(mockCtrl.Finish) @@ -52,8 +58,6 @@ func TestBasicManager(t *testing.T) { mockAppModuleBasic1.EXPECT().ValidateGenesis(gomock.Eq(cdc), gomock.Eq(nil), gomock.Eq(expDefaultGenesis["mockAppModuleBasic1"])).AnyTimes().Return(nil) mockAppModuleBasic1.EXPECT().RegisterLegacyAminoCodec(gomock.Eq(legacyAmino)).Times(1) mockAppModuleBasic1.EXPECT().RegisterInterfaces(gomock.Eq(interfaceRegistry)).Times(1) - mockAppModuleBasic1.EXPECT().GetTxCmd().Times(1).Return(nil) - mockAppModuleBasic1.EXPECT().GetQueryCmd().Times(1).Return(nil) // mock core API module mockCoreAppModule2 := mock.NewMockCoreAppModule(mockCtrl) @@ -82,8 +86,8 @@ func TestBasicManager(t *testing.T) { mockCmd := &cobra.Command{Use: "root"} mm.AddTxCommands(mockCmd) - mm.AddQueryCommands(mockCmd) + require.Equal(t, 1, len(mockCmd.Commands())) // validate genesis returns nil require.Nil(t, module.NewBasicManager().ValidateGenesis(cdc, nil, expDefaultGenesis)) diff --git a/x/auth/module.go b/x/auth/module.go index eb49321e2f34..171d8a3b5b4d 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -7,7 +7,6 @@ import ( abci "github.com/cometbft/cometbft/abci/types" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" modulev1 "cosmossdk.io/api/cosmos/auth/module/v1" "cosmossdk.io/core/address" @@ -78,16 +77,6 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *g } } -// GetTxCmd returns the root tx command for the auth module. -func (AppModuleBasic) GetTxCmd() *cobra.Command { - return nil -} - -// GetQueryCmd returns the root query command for the auth module. -func (ab AppModuleBasic) GetQueryCmd() *cobra.Command { - return nil -} - // RegisterInterfaces registers interfaces and implementations of the auth module. func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { types.RegisterInterfaces(registry) diff --git a/x/auth/vesting/module.go b/x/auth/vesting/module.go index 015fbecf0d95..98a411c01105 100644 --- a/x/auth/vesting/module.go +++ b/x/auth/vesting/module.go @@ -70,11 +70,6 @@ func (ab AppModuleBasic) GetTxCmd() *cobra.Command { return cli.GetTxCmd(ab.ac) } -// GetQueryCmd returns the module's root query command. Currently, this is a no-op. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return nil -} - // AppModule extends the AppModuleBasic implementation by implementing the // AppModule interface. type AppModule struct { diff --git a/x/bank/module.go b/x/bank/module.go index ef52a77fd1fa..592af3c4791b 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -84,11 +84,6 @@ func (ab AppModuleBasic) GetTxCmd() *cobra.Command { return cli.NewTxCmd(ab.ac) } -// GetQueryCmd returns no root query command for the bank module. -func (ab AppModuleBasic) GetQueryCmd() *cobra.Command { - return nil -} - // RegisterInterfaces registers interfaces and implementations of the bank module. func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { types.RegisterInterfaces(registry) diff --git a/x/consensus/module.go b/x/consensus/module.go index cc11ac50681c..ec30b7b8e86d 100644 --- a/x/consensus/module.go +++ b/x/consensus/module.go @@ -6,7 +6,6 @@ import ( abci "github.com/cometbft/cometbft/abci/types" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" "google.golang.org/grpc" modulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" @@ -67,16 +66,6 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *g } } -// GetTxCmd returns the root tx command -func (AppModuleBasic) GetTxCmd() *cobra.Command { - return nil -} - -// GetQueryCmd returns no root query command -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return nil -} - // RegisterInterfaces registers interfaces and implementations of the bank module. func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { types.RegisterInterfaces(registry) diff --git a/x/crisis/module.go b/x/crisis/module.go index a7e0147a4227..1a821e8e4e78 100644 --- a/x/crisis/module.go +++ b/x/crisis/module.go @@ -80,9 +80,6 @@ func (b AppModuleBasic) GetTxCmd() *cobra.Command { return cli.NewTxCmd() } -// GetQueryCmd returns no root query command for the crisis module. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { return nil } - // RegisterInterfaces registers interfaces and implementations of the crisis // module. func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { diff --git a/x/distribution/module.go b/x/distribution/module.go index 493cfcd21f3f..30cc0b799d2a 100644 --- a/x/distribution/module.go +++ b/x/distribution/module.go @@ -82,11 +82,6 @@ func (ab AppModuleBasic) GetTxCmd() *cobra.Command { return cli.NewTxCmd(ab.ac) } -// GetQueryCmd returns the root query command for the distribution module. -func (ab AppModuleBasic) GetQueryCmd() *cobra.Command { - return nil -} - // RegisterInterfaces implements InterfaceModule func (AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { types.RegisterInterfaces(registry) diff --git a/x/evidence/go.mod b/x/evidence/go.mod index e7825e2a6861..8c30708ea4ff 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -8,12 +8,12 @@ require ( cosmossdk.io/core v0.9.0 cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 - cosmossdk.io/log v1.1.0 + cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca cosmossdk.io/math v1.0.1 cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c github.com/cometbft/cometbft v0.38.0-rc2 github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230620151856-3aab81f45d55 + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230709172657-53a07864b68f github.com/cosmos/gogoproto v1.4.10 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.3 @@ -84,6 +84,7 @@ require ( github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-metrics v0.5.1 // indirect github.com/hashicorp/go-plugin v1.4.10 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect diff --git a/x/evidence/go.sum b/x/evidence/go.sum index 2a6acbccc920..6afeba214e08 100644 --- a/x/evidence/go.sum +++ b/x/evidence/go.sum @@ -45,8 +45,8 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= +cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca h1:msenprh2BLLRwNT7zN56TbBHOGk/7ARQckXHxXyvjoQ= +cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca/go.mod h1:PkIAKXZvaxrTRc++z53XMRvFk8AcGGWYHcMIPzVYX9c= cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= @@ -177,8 +177,8 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0 github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230620151856-3aab81f45d55 h1:qEWSMjCeg+ChbOh9VEJbxg8qFa33DLuVUunROeD5l00= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230620151856-3aab81f45d55/go.mod h1:/HloC8xR6Kwtj5ieHSbje4B39aObp43aRp2V12UR+9c= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230709172657-53a07864b68f h1:3791c4kToJ9u46bfd7J4lXeg9HSrMwRJHJ5YJD1foZY= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230709172657-53a07864b68f/go.mod h1:dmZ0kV7SplzqHiYR9aV/iIpIGVoUF8r0NfiigmXxKeM= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= @@ -431,6 +431,8 @@ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.1 h1:rfPwUqFU6uZXNvGl4hzjY8LEBsqFVU4si1H9/Hqck/U= +github.com/hashicorp/go-metrics v0.5.1/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= diff --git a/x/evidence/module.go b/x/evidence/module.go index c44db6d7f48e..42092f0c6c9b 100644 --- a/x/evidence/module.go +++ b/x/evidence/module.go @@ -94,11 +94,6 @@ func (a AppModuleBasic) GetTxCmd() *cobra.Command { return cli.GetTxCmd(evidenceCLIHandlers) } -// GetQueryCmd returns the evidence module's root query command. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return nil -} - // RegisterInterfaces registers the evidence module's interface types func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { types.RegisterInterfaces(registry) diff --git a/x/feegrant/go.mod b/x/feegrant/go.mod index 11e76cde9b31..a058bf913e2b 100644 --- a/x/feegrant/go.mod +++ b/x/feegrant/go.mod @@ -7,12 +7,12 @@ require ( cosmossdk.io/core v0.9.0 cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 - cosmossdk.io/log v1.1.0 + cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca cosmossdk.io/math v1.0.1 cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c github.com/cometbft/cometbft v0.38.0-rc2 github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.50.0-alpha.1 + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230709172657-53a07864b68f github.com/cosmos/gogoproto v1.4.10 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.3 diff --git a/x/feegrant/go.sum b/x/feegrant/go.sum index c691dc8153e7..ea7b60f01da3 100644 --- a/x/feegrant/go.sum +++ b/x/feegrant/go.sum @@ -45,8 +45,8 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= +cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca h1:msenprh2BLLRwNT7zN56TbBHOGk/7ARQckXHxXyvjoQ= +cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca/go.mod h1:PkIAKXZvaxrTRc++z53XMRvFk8AcGGWYHcMIPzVYX9c= cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= @@ -175,8 +175,8 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0 github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.50.0-alpha.1 h1:7ERS+ZW1tTly/DLfUwjMB6h80wtlNGBcFjI2Eb9eZIU= -github.com/cosmos/cosmos-sdk v0.50.0-alpha.1/go.mod h1:xee+suLR+WgtzSQBr0jjXQsvb1FIteMfnEzbr2Lk+4w= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230709172657-53a07864b68f h1:3791c4kToJ9u46bfd7J4lXeg9HSrMwRJHJ5YJD1foZY= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230709172657-53a07864b68f/go.mod h1:dmZ0kV7SplzqHiYR9aV/iIpIGVoUF8r0NfiigmXxKeM= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= diff --git a/x/feegrant/module/module.go b/x/feegrant/module/module.go index 19de021ba880..06813b1573cf 100644 --- a/x/feegrant/module/module.go +++ b/x/feegrant/module/module.go @@ -98,11 +98,6 @@ func (ab AppModuleBasic) GetTxCmd() *cobra.Command { return cli.GetTxCmd(ab.ac) } -// GetQueryCmd returns no root query command for the feegrant module. -func (ab AppModuleBasic) GetQueryCmd() *cobra.Command { - return nil -} - // ---------------------------------------------------------------------------- // AppModule // ---------------------------------------------------------------------------- diff --git a/x/genutil/module.go b/x/genutil/module.go index 182aceabb4fd..7bf648eb8127 100644 --- a/x/genutil/module.go +++ b/x/genutil/module.go @@ -6,7 +6,6 @@ import ( abci "github.com/cometbft/cometbft/abci/types" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" modulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" "cosmossdk.io/core/appmodule" @@ -68,12 +67,6 @@ func (b AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, txEncodingConfig cl func (AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *gwruntime.ServeMux) { } -// GetTxCmd returns no root tx command for the genutil module. -func (AppModuleBasic) GetTxCmd() *cobra.Command { return nil } - -// GetQueryCmd returns no root query command for the genutil module. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { return nil } - // AppModule implements an application module for the genutil module. type AppModule struct { AppModuleBasic diff --git a/x/mint/module.go b/x/mint/module.go index 609c36c2dcfe..211ce814d2d7 100644 --- a/x/mint/module.go +++ b/x/mint/module.go @@ -7,7 +7,6 @@ import ( abci "github.com/cometbft/cometbft/abci/types" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" modulev1 "cosmossdk.io/api/cosmos/mint/module/v1" "cosmossdk.io/core/appmodule" @@ -80,14 +79,6 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *g } } -// GetTxCmd returns no root tx command for the mint module. -func (AppModuleBasic) GetTxCmd() *cobra.Command { return nil } - -// GetQueryCmd returns the root query command for the mint module. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return nil -} - // AppModule implements an application module for the mint module. type AppModule struct { AppModuleBasic diff --git a/x/nft/go.mod b/x/nft/go.mod index bdfb08c4daee..44b2103bb1c5 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -7,12 +7,12 @@ require ( cosmossdk.io/core v0.9.0 cosmossdk.io/depinject v1.0.0-alpha.3 cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 - cosmossdk.io/log v1.1.0 + cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca cosmossdk.io/math v1.0.1 cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c github.com/cometbft/cometbft v0.38.0-rc2 github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230614103911-b3da8bb4e801 + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230709172657-53a07864b68f github.com/cosmos/gogoproto v1.4.10 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.3 @@ -82,6 +82,7 @@ require ( github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-metrics v0.5.1 // indirect github.com/hashicorp/go-plugin v1.4.10 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect diff --git a/x/nft/go.sum b/x/nft/go.sum index 0f66ce2154d6..3382cf9da95b 100644 --- a/x/nft/go.sum +++ b/x/nft/go.sum @@ -45,8 +45,8 @@ cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741 h1:BCRz06fvddw7cKGiEGDiSox3qMsjQ97f92K+PDZDHdc= cosmossdk.io/errors v1.0.0-beta.7.0.20230524212735-6cabb6aa5741/go.mod h1:TB05o6YXkZkzsc+6bZFAV5kZRBtoCU9tUkbeMIqEg0w= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= +cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca h1:msenprh2BLLRwNT7zN56TbBHOGk/7ARQckXHxXyvjoQ= +cosmossdk.io/log v1.1.1-0.20230704160919-88f2c830b0ca/go.mod h1:PkIAKXZvaxrTRc++z53XMRvFk8AcGGWYHcMIPzVYX9c= cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPBDQNtFeDFN27h1SAP6OVjnGgPLlYXmI= @@ -176,8 +176,8 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0 github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230614103911-b3da8bb4e801 h1:Qg0EgcEYtN0RWmxaFWTTCeMDfnbHB6UEzHucafy14i8= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230614103911-b3da8bb4e801/go.mod h1:VwFzgpv4z/Mrx+0sQpWwURCHx4h/iAalMdKIe3VEyBw= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230709172657-53a07864b68f h1:3791c4kToJ9u46bfd7J4lXeg9HSrMwRJHJ5YJD1foZY= +github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230709172657-53a07864b68f/go.mod h1:dmZ0kV7SplzqHiYR9aV/iIpIGVoUF8r0NfiigmXxKeM= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= @@ -430,6 +430,8 @@ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.1 h1:rfPwUqFU6uZXNvGl4hzjY8LEBsqFVU4si1H9/Hqck/U= +github.com/hashicorp/go-metrics v0.5.1/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= diff --git a/x/nft/module/module.go b/x/nft/module/module.go index 81fe806b3a6d..203ccbdd3fb7 100644 --- a/x/nft/module/module.go +++ b/x/nft/module/module.go @@ -84,12 +84,6 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx sdkclient.Context, mux } } -// GetQueryCmd returns a no-op command for the nft module. -// Queries for NFT are registered by autocli. -func (ab AppModuleBasic) GetQueryCmd() *cobra.Command { - return nil -} - // GetTxCmd returns the transaction commands for the nft module func (AppModuleBasic) GetTxCmd() *cobra.Command { return cli.GetTxCmd() diff --git a/x/params/module.go b/x/params/module.go index 3a9cc709bcb2..778f846c4949 100644 --- a/x/params/module.go +++ b/x/params/module.go @@ -52,9 +52,6 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *g } } -// GetTxCmd returns no root tx command for the params module. -func (AppModuleBasic) GetTxCmd() *cobra.Command { return nil } - // GetQueryCmd returns no root query command for the params module. func (AppModuleBasic) GetQueryCmd() *cobra.Command { return cli.NewQueryCmd() diff --git a/x/staking/module.go b/x/staking/module.go index affb0e957774..bcfe0aa29b2e 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -93,11 +93,6 @@ func (AppModuleBasic) GetTxCmd() *cobra.Command { return cli.NewTxCmd() } -// GetQueryCmd returns no root query command for the staking module. -func (ab AppModuleBasic) GetQueryCmd() *cobra.Command { - return nil -} - // AppModule implements an application module for the staking module. type AppModule struct { AppModuleBasic