From ad4ae722cc0bc63fd9203dfcdedfec607276b8cc Mon Sep 17 00:00:00 2001 From: edjroz <14135788+edjroz@users.noreply.github.com> Date: Sat, 18 Jan 2025 12:07:20 +0000 Subject: [PATCH] chore: spelling errors fixes --- CHANGELOG.md | 2 +- docs/architecture/adr-75-v2.md | 8 +- docs/build/building-modules/06-keeper.md | 2 +- docs/rfc/rfc-003-crosslang.md | 2 +- docs/user/run-node/01-run-node.md | 2 +- docs/user/run-node/03-txs.md | 2 +- docs/user/run-node/04-rosetta.md | 4 +- docs/user/run-node/05-run-testnet.md | 2 +- docs/user/run-node/06-run-production.md | 2 +- orm/internal/codegen/codegen.go | 6 +- simapp/v2/export.go | 2 +- simsx/environment.go | 4 +- .../distribution/keeper/grpc_query_test.go | 20 ++-- .../integration/gov/keeper/grpc_query_test.go | 6 +- types/coin_test.go | 2 +- x/accounts/defaults/lockup/TUTORIAL.md | 6 +- x/auth/CHANGELOG.md | 2 +- x/bank/README.md | 2 +- x/gov/keeper/grpc_query_test.go | 104 +++++++++--------- x/gov/simulation/msg_factory.go | 2 +- 20 files changed, 91 insertions(+), 91 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d88d88ad2d0..2697c15a43c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -137,7 +137,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i * (genutil) [#21701](https://github.com/cosmos/cosmos-sdk/pull/21701) Improved error messages for genesis validation. * (runtime) [#21704](https://github.com/cosmos/cosmos-sdk/pull/21704) Move `upgradetypes.StoreLoader` to runtime and alias it in upgrade for backward compatibility. * (sims)[#21613](https://github.com/cosmos/cosmos-sdk/pull/21613) Add sims2 framework and factory methods for simpler message factories in modules -* (modules) [#21963](https://github.com/cosmos/cosmos-sdk/pull/21963) Duplicatable metrics are no more collected in modules. They were unecessary overhead. +* (modules) [#21963](https://github.com/cosmos/cosmos-sdk/pull/21963) Duplicatable metrics are no more collected in modules. They were unnecessary overhead. * (crypto/ledger) [#22116](https://github.com/cosmos/cosmos-sdk/pull/22116) Improve error message when deriving paths using index >100 ### Bug Fixes diff --git a/docs/architecture/adr-75-v2.md b/docs/architecture/adr-75-v2.md index 44eecc0d2411..ebfce2de5e27 100644 --- a/docs/architecture/adr-75-v2.md +++ b/docs/architecture/adr-75-v2.md @@ -56,7 +56,7 @@ The alternative to doing a rewrite is to spend more time cleaning up baseapp. Th ## Decision -The Descision is to rewrite the core componenets (baseapp, server, store) of the SDK into smaller modules. +The Decision is to rewrite the core components (baseapp, server, store) of the SDK into smaller modules. These components will be broken into separate go.mods. The modules consist of the following: @@ -135,7 +135,7 @@ The state transition function interface is simple and meant to be as light weigh ```mermaid graph TD - subgraph STF[State Transition Funciton] + subgraph STF[State Transition Function] BR --> DB subgraph DB[DeliverBlock] PB[PreBlock] @@ -205,9 +205,9 @@ The design of the node comes with a number of tradeoffs. ### Backwards Compatibility -The state machine was made to not affect modules that are not using the state transition function. If a user would like to migrate to v2 they will need to migrate to `appmodule.Environment` from `sdk.Context`. `sdk.Context` is a struct which is a global in the state machine, this desing limits the concurrency. +The state machine was made to not affect modules that are not using the state transition function. If a user would like to migrate to v2 they will need to migrate to `appmodule.Environment` from `sdk.Context`. `sdk.Context` is a struct which is a global in the state machine, this design limits the concurrency. -V2 will have a breaking changes in regards to how CometBFT handles certain fields in ABCI. Previously, the Cosmos SDK paniced and recovered in the case of out of gas, providing an error to CometBFT which we do not return in the new design. +V2 will have a breaking changes in regards to how CometBFT handles certain fields in ABCI. Previously, the Cosmos SDK panicked and recovered in the case of out of gas, providing an error to CometBFT which we do not return in the new design. V2 only works with `Store/v2`, `IAVL V1` can be used with `Store/v2`. This allows chains to continue with existing databases. There will be a migration happening to convert the database to the separation of Storage and Commitment. Once the migration is completed the state machine will query information from the rawDB unless otherwise specified. diff --git a/docs/build/building-modules/06-keeper.md b/docs/build/building-modules/06-keeper.md index 0bd776ff9b9d..6ed626648544 100644 --- a/docs/build/building-modules/06-keeper.md +++ b/docs/build/building-modules/06-keeper.md @@ -66,4 +66,4 @@ State management is recommended to be done via [Collections](../packages/collect In the Cosmos SDK, it is crucial to be methodical and selective when managing state within a module, as improper state management can lead to inefficiency, security risks, and scalability issues. Not all data belongs in the on-chain state; it's important to store only essential blockchain data that needs to be verified by consensus. Storing unnecessary information, especially client-side data, can bloat the state and slow down performance. Instead, developers should focus on using an off-chain database to handle supplementary data, extending the API as needed. This approach minimizes on-chain complexity, optimizes resource usage, and keeps the blockchain state lean and efficient, ensuring scalability and smooth operations. -The Cosmos SDK leverages Protocol Buffers (protobuf) for efficient state management, providing a well-structured, binary encoding format that ensures compatibility and performance across different modules. The SDK’s recommended approach for managing state is through the [collections package](../pacakges/02-collections.md), which simplifies state handling by offering predefined data structures like maps and indexed sets, reducing the complexity of managing raw state data. While users can opt for custom encoding schemes if they need more flexibility or have specialized requirements, they should be aware that such custom implementations may not integrate seamlessly with indexers that decode state data on the fly. This could lead to challenges in data retrieval, querying, and interoperability, making protobuf a safer and more future-proof choice for most use cases. +The Cosmos SDK leverages Protocol Buffers (protobuf) for efficient state management, providing a well-structured, binary encoding format that ensures compatibility and performance across different modules. The SDK’s recommended approach for managing state is through the [collections package](../packages/02-collections.md), which simplifies state handling by offering predefined data structures like maps and indexed sets, reducing the complexity of managing raw state data. While users can opt for custom encoding schemes if they need more flexibility or have specialized requirements, they should be aware that such custom implementations may not integrate seamlessly with indexers that decode state data on the fly. This could lead to challenges in data retrieval, querying, and interoperability, making protobuf a safer and more future-proof choice for most use cases. diff --git a/docs/rfc/rfc-003-crosslang.md b/docs/rfc/rfc-003-crosslang.md index b71db170e0ec..845714b68b4f 100644 --- a/docs/rfc/rfc-003-crosslang.md +++ b/docs/rfc/rfc-003-crosslang.md @@ -162,7 +162,7 @@ These bytes can be used by the **state handler** to determine what type of state A **state token** is an opaque array of 32-bytes that is passed in each message request. The hypervisor has no knowledge of what this token represents or how it is created, -but it is expected that modules that mange state do understand this token and use it to manage all state changes +but it is expected that modules that manage state do understand this token and use it to manage all state changes in consistent transactions. All side effects regarding state, events, etc. are expected to coordinate around the usage of this token. It is possible that state modules expose methods for creating new **state tokens** diff --git a/docs/user/run-node/01-run-node.md b/docs/user/run-node/01-run-node.md index 9b1dfb4ebd59..e9f5a9f0a5c1 100644 --- a/docs/user/run-node/01-run-node.md +++ b/docs/user/run-node/01-run-node.md @@ -198,7 +198,7 @@ Local state sync work similar to normal state sync except that it works off a lo 1. As mentioned in https://docs.cometbft.com/v0.37/core/state-sync, one must set a height and hash in the config.toml along with a few rpc servers (the afromentioned link has instructions on how to do this). 2. Run ` ` to restore a local snapshot (note: first load it from a file with the *load* command). -3. Bootsrapping Comet state in order to start the node after the snapshot has been ingested. This can be done with the bootstrap command ` comet bootstrap-state` +3. Bootstrapping Comet state in order to start the node after the snapshot has been ingested. This can be done with the bootstrap command ` comet bootstrap-state` ### Snapshots Commands diff --git a/docs/user/run-node/03-txs.md b/docs/user/run-node/03-txs.md index 106f02e8e8e8..f459acb88014 100644 --- a/docs/user/run-node/03-txs.md +++ b/docs/user/run-node/03-txs.md @@ -269,7 +269,7 @@ func sendTx() error { ### Broadcasting a Transaction -The preferred way to broadcast a transaction is to use gRPC, though using REST (via `gRPC-gateway`) or the CometBFT RPC is also posible. An overview of the differences between these methods is exposed [here](../../learn/advanced/06-grpc_rest.md). For this tutorial, we will only describe the gRPC method. +The preferred way to broadcast a transaction is to use gRPC, though using REST (via `gRPC-gateway`) or the CometBFT RPC is also possible. An overview of the differences between these methods is exposed [here](../../learn/advanced/06-grpc_rest.md). For this tutorial, we will only describe the gRPC method. ```go import ( diff --git a/docs/user/run-node/04-rosetta.md b/docs/user/run-node/04-rosetta.md index de74d9898b0c..ec983f2b6fe3 100644 --- a/docs/user/run-node/04-rosetta.md +++ b/docs/user/run-node/04-rosetta.md @@ -54,7 +54,7 @@ An implementation example can be found in `simapp` package. To run Rosetta in your application CLI, use the following command: -> **Note:** if using the native approach, add your node name before any rosetta comand. +> **Note:** if using the native approach, add your node name before any rosetta command. ```shell rosetta --help @@ -74,7 +74,7 @@ rosetta ## Plugins - Multi chain connections -Rosetta will try to reflect the node types trough reflection over the node gRPC endpoints, there may be cases were this approach is not enough. It is possible to extend or implement the required types easily trough plugins. +Rosetta will try to reflect the node types through reflection over the node gRPC endpoints, there may be cases were this approach is not enough. It is possible to extend or implement the required types easily through plugins. To use Rosetta over any chain, it is required to set up prefixes and registering zone specific interfaces through plugins. diff --git a/docs/user/run-node/05-run-testnet.md b/docs/user/run-node/05-run-testnet.md index c2b5da598186..9200042e79e1 100644 --- a/docs/user/run-node/05-run-testnet.md +++ b/docs/user/run-node/05-run-testnet.md @@ -34,7 +34,7 @@ The default output directory is a relative `.testnets` directory. Let's take a l ### gentxs -The `gentxs` directory includes a genesis transaction for each validator node. Each file includes a JSON encoded genesis transaction used to register a validator node at the time of genesis. The genesis transactions are added to the `genesis.json` file within each node directory during the initilization process. +The `gentxs` directory includes a genesis transaction for each validator node. Each file includes a JSON encoded genesis transaction used to register a validator node at the time of genesis. The genesis transactions are added to the `genesis.json` file within each node directory during the initialization process. ### nodes diff --git a/docs/user/run-node/06-run-production.md b/docs/user/run-node/06-run-production.md index 73e669e88836..9f3f31677bf2 100644 --- a/docs/user/run-node/06-run-production.md +++ b/docs/user/run-node/06-run-production.md @@ -196,7 +196,7 @@ tmkms softsign import $HOME/tmkms/config/secrets/priv_validator_key.json $HOME/t At this point, it is necessary to delete the `priv_validator_key.json` from the validator node and the tmkms node. Since the key has been imported into tmkms (above) it is no longer necessary on the nodes. The key can be safely stored offline. -4. Modifiy the `tmkms.toml`. +4. Modify the `tmkms.toml`. ```bash vim $HOME/tmkms/config/tmkms.toml diff --git a/orm/internal/codegen/codegen.go b/orm/internal/codegen/codegen.go index 8f253f3f672b..f2f92a10302e 100644 --- a/orm/internal/codegen/codegen.go +++ b/orm/internal/codegen/codegen.go @@ -26,7 +26,7 @@ func ORMPluginRunner(p *protogen.Plugin) error { continue } - if !hasTables(f) { + if !hashtables(f) { continue } @@ -52,7 +52,7 @@ func QueryProtoPluginRunner(p *protogen.Plugin) error { continue } - if !hasTables(f) { + if !hashtables(f) { continue } @@ -76,7 +76,7 @@ func QueryProtoPluginRunner(p *protogen.Plugin) error { return nil } -func hasTables(file *protogen.File) bool { +func hashtables(file *protogen.File) bool { for _, message := range file.Messages { if proto.GetExtension(message.Desc.Options(), ormv1.E_Table).(*ormv1.TableDescriptor) != nil { return true diff --git a/simapp/v2/export.go b/simapp/v2/export.go index 61175f41607f..961d55da2f97 100644 --- a/simapp/v2/export.go +++ b/simapp/v2/export.go @@ -11,7 +11,7 @@ import ( // ExportAppStateAndValidators exports the state of the application for a genesis // file. -// This is a demonstation of how to export a genesis file. Export may need extended at +// This is a demonstration of how to export a genesis file. Export may need extended at // the user discretion for cleaning the genesis state at the end provided with jailAllowedAddrs func (app *SimApp[T]) ExportAppStateAndValidators( jailAllowedAddrs []string, diff --git a/simsx/environment.go b/simsx/environment.go index e5302802cce4..38c1bbaa3b0a 100644 --- a/simsx/environment.go +++ b/simsx/environment.go @@ -379,9 +379,9 @@ func (c *ChainDataSource) AccountsCount() int { return len(c.accounts) } -// AccountAt return SimAccount within the accounts slice. Reporter skip flag is set when boundaries are exceeded. +// accountant return SimAccount within the accounts slice. Reporter skip flag is set when boundaries are exceeded. -func (c *ChainDataSource) AccountAt(reporter SimulationReporter, i int) SimAccount { +func (c *ChainDataSource) accountant(reporter SimulationReporter, i int) SimAccount { if i > len(c.accounts) { reporter.Skipf("account index out of range: %d", i) return c.nullAccount() diff --git a/tests/integration/distribution/keeper/grpc_query_test.go b/tests/integration/distribution/keeper/grpc_query_test.go index f83671fc4eac..c93dc48c5575 100644 --- a/tests/integration/distribution/keeper/grpc_query_test.go +++ b/tests/integration/distribution/keeper/grpc_query_test.go @@ -207,7 +207,7 @@ func TestGRPCValidatorSlashes(t *testing.T) { var ( req *types.QueryValidatorSlashesRequest - expRes *types.QueryValidatorSlashesResponse + express *types.QueryValidatorSlashesResponse ) testCases := []struct { @@ -220,7 +220,7 @@ func TestGRPCValidatorSlashes(t *testing.T) { name: "empty request", malleate: func() { req = &types.QueryValidatorSlashesRequest{} - expRes = &types.QueryValidatorSlashesResponse{} + express = &types.QueryValidatorSlashesResponse{} }, expPass: false, expErrMsg: "empty validator address", @@ -233,7 +233,7 @@ func TestGRPCValidatorSlashes(t *testing.T) { StartingHeight: 10, EndingHeight: 1, } - expRes = &types.QueryValidatorSlashesResponse{Pagination: &query.PageResponse{}} + express = &types.QueryValidatorSlashesResponse{Pagination: &query.PageResponse{}} }, expPass: false, expErrMsg: "starting height greater than ending height", @@ -246,7 +246,7 @@ func TestGRPCValidatorSlashes(t *testing.T) { StartingHeight: 1, EndingHeight: 10, } - expRes = &types.QueryValidatorSlashesResponse{Pagination: &query.PageResponse{}} + express = &types.QueryValidatorSlashesResponse{Pagination: &query.PageResponse{}} }, expPass: true, }, @@ -265,7 +265,7 @@ func TestGRPCValidatorSlashes(t *testing.T) { Pagination: pageReq, } - expRes = &types.QueryValidatorSlashesResponse{ + express = &types.QueryValidatorSlashesResponse{ Slashes: slashes[2:], } }, @@ -286,7 +286,7 @@ func TestGRPCValidatorSlashes(t *testing.T) { Pagination: pageReq, } - expRes = &types.QueryValidatorSlashesResponse{ + express = &types.QueryValidatorSlashesResponse{ Slashes: slashes[:3], } }, @@ -307,7 +307,7 @@ func TestGRPCValidatorSlashes(t *testing.T) { Pagination: pageReq, } - expRes = &types.QueryValidatorSlashesResponse{ + express = &types.QueryValidatorSlashesResponse{ Slashes: slashes[:4], } }, @@ -324,7 +324,7 @@ func TestGRPCValidatorSlashes(t *testing.T) { if tc.expPass { assert.NilError(t, err) - assert.DeepEqual(t, expRes.GetSlashes(), slashesRes.GetSlashes()) + assert.DeepEqual(t, express.GetSlashes(), slashesRes.GetSlashes()) } else { assert.ErrorContains(t, err, tc.expErrMsg) assert.Assert(t, slashesRes == nil) @@ -467,7 +467,7 @@ func TestGRPCDelegationRewards(t *testing.T) { assert.NilError(t, f.distrKeeper.ValidatorCurrentRewards.Set(f.sdkCtx, f.valAddr, currentRewards)) assert.NilError(t, f.distrKeeper.ValidatorOutstandingRewards.Set(f.sdkCtx, f.valAddr, types.ValidatorOutstandingRewards{Rewards: decCoins})) - expRes := &types.QueryDelegationRewardsResponse{ + express := &types.QueryDelegationRewardsResponse{ Rewards: sdk.DecCoins{sdk.DecCoin{Denom: sdk.DefaultBondDenom, Amount: math.LegacyNewDec(initialStake / 10)}}, } @@ -528,7 +528,7 @@ func TestGRPCDelegationRewards(t *testing.T) { if tc.expPass { assert.NilError(t, err) - assert.DeepEqual(t, expRes, rewards) + assert.DeepEqual(t, express, rewards) } else { assert.ErrorContains(t, err, tc.expErrMsg) assert.Assert(t, rewards == nil) diff --git a/tests/integration/gov/keeper/grpc_query_test.go b/tests/integration/gov/keeper/grpc_query_test.go index edd583c4dd9e..89159d4da7ca 100644 --- a/tests/integration/gov/keeper/grpc_query_test.go +++ b/tests/integration/gov/keeper/grpc_query_test.go @@ -23,7 +23,7 @@ func TestLegacyGRPCQueryTally(t *testing.T) { var ( req *v1beta1.QueryTallyResultRequest - expRes *v1beta1.QueryTallyResultResponse + express *v1beta1.QueryTallyResultResponse ) testCases := []struct { @@ -46,7 +46,7 @@ func TestLegacyGRPCQueryTally(t *testing.T) { req = &v1beta1.QueryTallyResultRequest{ProposalId: proposal.Id} - expRes = &v1beta1.QueryTallyResultResponse{ + express = &v1beta1.QueryTallyResultResponse{ Tally: v1beta1.TallyResult{ Yes: math.NewInt(3 * 5 * 1000000), No: math.NewInt(0), @@ -68,7 +68,7 @@ func TestLegacyGRPCQueryTally(t *testing.T) { if testCase.expPass { assert.NilError(t, err) - assert.Equal(t, expRes.String(), tally.String()) + assert.Equal(t, express.String(), tally.String()) } else { assert.ErrorContains(t, err, testCase.expErrMsg) assert.Assert(t, tally == nil) diff --git a/types/coin_test.go b/types/coin_test.go index 0c746ffb6206..ebdb5a51a7b1 100644 --- a/types/coin_test.go +++ b/types/coin_test.go @@ -76,7 +76,7 @@ func (s *coinTestSuite) TestIsEqualCoin() { } func (s *coinTestSuite) TestCoinIsValid() { - loremIpsum := `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam viverra dui vel nulla aliquet, non dictum elit aliquam. Proin consequat leo in consectetur mattis. Phasellus eget odio luctus, rutrum dolor at, venenatis ante. Praesent metus erat, sodales vitae sagittis eget, commodo non ipsum. Duis eget urna quis erat mattis pulvinar. Vivamus egestas imperdiet sem, porttitor hendrerit lorem pulvinar in. Vivamus laoreet sapien eget libero euismod tristique. Suspendisse tincidunt nulla quis luctus mattis. + loremIpsum := `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Name viverra dui vel nulla aliquet, non dictum elit aliquam. Proin consequat leo in consectetur mattis. Phasellus eget odio luctus, rutrum dolor at, venenatis ante. Praesent metus erat, sodales vitae sagittis eget, commodo non ipsum. Duis eget urna quis erat mattis pulvinar. Vivamus egestas imperdiet sem, porttitor hendrerit lorem pulvinar in. Vivamus laoreet sapien eget libero euismod tristique. Suspendisse tincidunt nulla quis luctus mattis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed id turpis at erat placerat fermentum id sed sapien. Fusce mattis enim id nulla viverra, eget placerat eros aliquet. Nunc fringilla urna ac condimentum ultricies. Praesent in eros ac neque fringilla sodales. Donec ut venenatis eros. Quisque iaculis lectus neque, a various sem ullamcorper nec. Cras tincidunt dignissim libero nec volutpat. Donec molestie enim sed metus venenatis, quis elementum sem various. Curabitur eu venenatis nulla. Cras sit amet ligula vel turpis placerat sollicitudin. Nunc massa odio, eleifend id lacus nec, ultricies elementum arcu. Donec imperdiet nulla lacus, a venenatis lacus fermentum nec. Proin vestibulum dolor enim, vitae posuere velit aliquet non. Suspendisse pharetra condimentum nunc tincidunt viverra. Etiam posuere, ligula ut maximus congue, mauris orci consectetur velit, vel finibus eros metus non tellus. Nullam et dictum metus. Aliquam maximus fermentum mauris elementum aliquet. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Etiam dapibus lectus sed tellus rutrum tincidunt. Nulla at dolor sem. Ut non dictum arcu, eget congue sem.` diff --git a/x/accounts/defaults/lockup/TUTORIAL.md b/x/accounts/defaults/lockup/TUTORIAL.md index f8ff4bdbee43..507679daf549 100644 --- a/x/accounts/defaults/lockup/TUTORIAL.md +++ b/x/accounts/defaults/lockup/TUTORIAL.md @@ -29,7 +29,7 @@ simd keys add owner Normally the creator must have enough token to grant to the lockup account during the lockup account init process. The owner wallet should be associated with the individual that the creator want to grant the fund to. Now, the creator can craft the lockup account init messages. This message depend on what type of lockup account the creator want to create. -For continous, delayed, permanent locking account: +For continuous, delayed, permanent locking account: ```json { @@ -40,7 +40,7 @@ For continous, delayed, permanent locking account: ``` :::info -`start_time` is only needed for continous locking account init process. For the other two, you dont have to set it in. Error will returned if `start_time` is not provided when creating continous locking account* +`start_time` is only needed for continuous locking account init process. For the other two, you dont have to set it in. Error will returned if `start_time` is not provided when creating continuous locking account* ::: For periodic locking account: @@ -215,7 +215,7 @@ simd tx accounts query $querycontents The query request type url for this query is `cosmos.accounts.defaults.lockup.QueryLockupAccountInfoRequest`. And query json file can be an empty object since `QueryLockupAccountInfoRequest` does not required an input. -Account informations including: +Account information including: * original locked amount diff --git a/x/auth/CHANGELOG.md b/x/auth/CHANGELOG.md index d0b1ca0509bb..18d99ca40859 100644 --- a/x/auth/CHANGELOG.md +++ b/x/auth/CHANGELOG.md @@ -60,7 +60,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#18817](https://github.com/cosmos/cosmos-sdk/pull/18817) SigVerification, GasConsumption, IncreaseSequence ante decorators have all been joined into one SigVerification decorator. Gas consumption during TX validation flow has reduced. * [#19093](https://github.com/cosmos/cosmos-sdk/pull/19093) SetPubKeyDecorator was merged into SigVerification, gas consumption is almost halved for a simple tx. * [#19535](https://github.com/cosmos/cosmos-sdk/pull/19535) Remove vesting account creation when the chain is running. The accounts module is required for creating [#vesting accounts](../accounts/defaults/lockup/README.md) on a running chain. -* [#21688](https://github.com/cosmos/cosmos-sdk/pull/21688) Allow x/accounts to be queriable from the `AccountInfo` and `Account` gRPC endpoints +* [#21688](https://github.com/cosmos/cosmos-sdk/pull/21688) Allow x/accounts to be queryable from the `AccountInfo` and `Account` gRPC endpoints * [#21820](https://github.com/cosmos/cosmos-sdk/pull/21820) Allow x/auth `BaseAccount` to migrate to a `x/accounts` via the new `MsgMigrateAccount`. ### Bug Fixes diff --git a/x/bank/README.md b/x/bank/README.md index f6f77f1f947e..fc6c39a9183a 100644 --- a/x/bank/README.md +++ b/x/bank/README.md @@ -589,7 +589,7 @@ The bank module contains the following parameters ### SendEnabled -SendEnabled is depreacted and only kept for backward compatibility. For genesis, use the newly added send_enabled field in the genesis object. Storage, lookup, and manipulation of this information is now in the keeper. +SendEnabled is deprecated and only kept for backward compatibility. For genesis, use the newly added send_enabled field in the genesis object. Storage, lookup, and manipulation of this information is now in the keeper. ### DefaultSendEnabled diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 265726a7f75a..22321471a77b 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -93,11 +93,11 @@ func (suite *KeeperTestSuite) TestGRPCQueryConstitution() { suite.reset() queryClient := suite.queryClient - expRes := &v1.QueryConstitutionResponse{Constitution: "constitution"} + express := &v1.QueryConstitutionResponse{Constitution: "constitution"} constitution, err := queryClient.Constitution(gocontext.Background(), &v1.QueryConstitutionRequest{}) suite.Require().NoError(err) - suite.Require().Equal(expRes, constitution) + suite.Require().Equal(express, constitution) } func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposal() { @@ -200,7 +200,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { var ( req *v1.QueryProposalsRequest - expRes *v1.QueryProposalsResponse + express *v1.QueryProposalsResponse ) testCases := []struct { @@ -235,7 +235,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { Pagination: &query.PageRequest{Limit: 3}, } - expRes = &v1.QueryProposalsResponse{ + express = &v1.QueryProposalsResponse{ Proposals: testProposals[:3], } }, @@ -248,7 +248,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { Pagination: &query.PageRequest{Offset: 3, Limit: 3}, } - expRes = &v1.QueryProposalsResponse{ + express = &v1.QueryProposalsResponse{ Proposals: testProposals[3:], } }, @@ -261,7 +261,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { Pagination: &query.PageRequest{Limit: 2, CountTotal: true}, } - expRes = &v1.QueryProposalsResponse{ + express = &v1.QueryProposalsResponse{ Proposals: testProposals[:2], } }, @@ -274,7 +274,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { ProposalStatus: v1.StatusDepositPeriod, } - expRes = &v1.QueryProposalsResponse{ + express = &v1.QueryProposalsResponse{ Proposals: testProposals, } }, @@ -292,7 +292,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { Depositor: addr0Str, } - expRes = &v1.QueryProposalsResponse{ + express = &v1.QueryProposalsResponse{ Proposals: testProposals[:1], } }, @@ -310,7 +310,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { Voter: addr0Str, } - expRes = &v1.QueryProposalsResponse{ + express = &v1.QueryProposalsResponse{ Proposals: testProposals[1:2], } }, @@ -330,7 +330,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { } } - expRes = &v1.QueryProposalsResponse{ + express = &v1.QueryProposalsResponse{ Proposals: proposals, } }, @@ -350,7 +350,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { } } - expRes = &v1.QueryProposalsResponse{ + express = &v1.QueryProposalsResponse{ Proposals: proposals, } }, @@ -374,7 +374,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { } } - expRes = &v1.QueryProposalsResponse{ + express = &v1.QueryProposalsResponse{ Proposals: proposals, } }, @@ -393,11 +393,11 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { if tc.expPass { suite.Require().NoError(err) - suite.Require().Len(proposals.GetProposals(), len(expRes.GetProposals())) + suite.Require().Len(proposals.GetProposals(), len(express.GetProposals())) for i := 0; i < len(proposals.GetProposals()); i++ { suite.Require().NoError(err) suite.Require().NotEmpty(proposals.GetProposals()[i]) - suite.Require().Equal(expRes.GetProposals()[i].String(), proposals.GetProposals()[i].String()) + suite.Require().Equal(express.GetProposals()[i].String(), proposals.GetProposals()[i].String()) } } else { @@ -465,7 +465,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { var ( req *v1.QueryVoteRequest - expRes *v1.QueryVoteResponse + express *v1.QueryVoteResponse proposal v1.Proposal ) @@ -523,7 +523,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { Voter: addr0Str, } - expRes = &v1.QueryVoteResponse{} + express = &v1.QueryVoteResponse{} }, false, }, @@ -540,7 +540,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { Voter: addr0Str, } - expRes = &v1.QueryVoteResponse{Vote: &v1.Vote{ProposalId: proposal.Id, Voter: addr0Str, Options: []*v1.WeightedVoteOption{{Option: v1.OptionAbstain, Weight: math.LegacyMustNewDecFromStr("1.0").String()}}}} + express = &v1.QueryVoteResponse{Vote: &v1.Vote{ProposalId: proposal.Id, Voter: addr0Str, Options: []*v1.WeightedVoteOption{{Option: v1.OptionAbstain, Weight: math.LegacyMustNewDecFromStr("1.0").String()}}}} }, true, }, @@ -552,7 +552,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { Voter: addr1Str, } - expRes = &v1.QueryVoteResponse{} + express = &v1.QueryVoteResponse{} }, false, }, @@ -568,7 +568,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { if tc.expPass { suite.Require().NoError(err) - suite.Require().Equal(expRes, vote) + suite.Require().Equal(express, vote) } else { suite.Require().Error(err) suite.Require().Nil(vote) @@ -585,7 +585,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVote() { suite.Require().NoError(err) var ( req *v1beta1.QueryVoteRequest - expRes *v1beta1.QueryVoteResponse + express *v1beta1.QueryVoteResponse proposal v1.Proposal ) @@ -643,7 +643,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVote() { Voter: addr0Str, } - expRes = &v1beta1.QueryVoteResponse{} + express = &v1beta1.QueryVoteResponse{} }, false, }, @@ -660,7 +660,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVote() { Voter: addr0Str, } - expRes = &v1beta1.QueryVoteResponse{Vote: v1beta1.Vote{ProposalId: proposal.Id, Voter: addr0Str, Options: []v1beta1.WeightedVoteOption{{Option: v1beta1.OptionAbstain, Weight: math.LegacyMustNewDecFromStr("1.0")}}}} + express = &v1beta1.QueryVoteResponse{Vote: v1beta1.Vote{ProposalId: proposal.Id, Voter: addr0Str, Options: []v1beta1.WeightedVoteOption{{Option: v1beta1.OptionAbstain, Weight: math.LegacyMustNewDecFromStr("1.0")}}}} }, true, }, @@ -672,7 +672,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVote() { Voter: addr1Str, } - expRes = &v1beta1.QueryVoteResponse{} + express = &v1beta1.QueryVoteResponse{} }, false, }, @@ -688,7 +688,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVote() { if tc.expPass { suite.Require().NoError(err) - suite.Require().Equal(expRes, vote) + suite.Require().Equal(express, vote) } else { suite.Require().Error(err) suite.Require().Nil(vote) @@ -709,7 +709,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { var ( req *v1.QueryVotesRequest - expRes *v1.QueryVotesResponse + express *v1.QueryVotesResponse proposal v1.Proposal votes v1.Votes ) @@ -780,7 +780,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { ProposalId: proposal.Id, } - expRes = &v1.QueryVotesResponse{ + express = &v1.QueryVotesResponse{ Votes: votes, } }, @@ -798,7 +798,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { if tc.expPass { suite.Require().NoError(err) - suite.Require().Equal(expRes.GetVotes(), votes.GetVotes()) + suite.Require().Equal(express.GetVotes(), votes.GetVotes()) } else { suite.Require().Error(err) suite.Require().Nil(votes) @@ -819,7 +819,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVotes() { var ( req *v1beta1.QueryVotesRequest - expRes *v1beta1.QueryVotesResponse + express *v1beta1.QueryVotesResponse proposal v1.Proposal votes v1beta1.Votes ) @@ -891,7 +891,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVotes() { ProposalId: proposal.Id, } - expRes = &v1beta1.QueryVotesResponse{ + express = &v1beta1.QueryVotesResponse{ Votes: votes, } }, @@ -909,7 +909,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVotes() { if tc.expPass { suite.Require().NoError(err) - suite.Require().Equal(expRes.GetVotes(), votes.GetVotes()) + suite.Require().Equal(express.GetVotes(), votes.GetVotes()) } else { suite.Require().Error(err) suite.Require().Nil(votes) @@ -1024,7 +1024,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryParams() { var ( req *v1beta1.QueryParamsRequest - expRes *v1beta1.QueryParamsResponse + express *v1beta1.QueryParamsResponse ) defaultTallyParams := v1beta1.TallyParams{ @@ -1050,7 +1050,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryParams() { func() { req = &v1beta1.QueryParamsRequest{ParamsType: v1beta1.ParamDeposit} depositParams := v1beta1.DefaultDepositParams() - expRes = &v1beta1.QueryParamsResponse{ + express = &v1beta1.QueryParamsResponse{ DepositParams: depositParams, TallyParams: defaultTallyParams, } @@ -1062,7 +1062,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryParams() { func() { req = &v1beta1.QueryParamsRequest{ParamsType: v1beta1.ParamVoting} votingParams := v1beta1.DefaultVotingParams() - expRes = &v1beta1.QueryParamsResponse{ + express = &v1beta1.QueryParamsResponse{ VotingParams: votingParams, TallyParams: defaultTallyParams, } @@ -1074,7 +1074,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryParams() { func() { req = &v1beta1.QueryParamsRequest{ParamsType: v1beta1.ParamTallying} tallyParams := v1beta1.DefaultTallyParams() - expRes = &v1beta1.QueryParamsResponse{ + express = &v1beta1.QueryParamsResponse{ TallyParams: tallyParams, } }, @@ -1084,7 +1084,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryParams() { "invalid request", func() { req = &v1beta1.QueryParamsRequest{ParamsType: "wrongPath"} - expRes = &v1beta1.QueryParamsResponse{} + express = &v1beta1.QueryParamsResponse{} }, false, }, @@ -1100,9 +1100,9 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryParams() { if tc.expPass { suite.Require().NoError(err) - suite.Require().Equal(expRes.GetDepositParams(), params.GetDepositParams()) - suite.Require().Equal(expRes.GetVotingParams(), params.GetVotingParams()) - suite.Require().Equal(expRes.GetTallyParams(), params.GetTallyParams()) + suite.Require().Equal(express.GetDepositParams(), params.GetDepositParams()) + suite.Require().Equal(express.GetVotingParams(), params.GetVotingParams()) + suite.Require().Equal(express.GetTallyParams(), params.GetTallyParams()) } else { suite.Require().Error(err) suite.Require().Nil(params) @@ -1119,7 +1119,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { var ( req *v1.QueryDepositRequest - expRes *v1.QueryDepositResponse + express *v1.QueryDepositResponse proposal v1.Proposal ) @@ -1193,7 +1193,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { Depositor: addr0Str, } - expRes = &v1.QueryDepositResponse{Deposit: &deposit} + express = &v1.QueryDepositResponse{Deposit: &deposit} }, true, }, @@ -1209,10 +1209,10 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { if tc.expPass { suite.Require().NoError(err) - suite.Require().Equal(deposit.GetDeposit(), expRes.GetDeposit()) + suite.Require().Equal(deposit.GetDeposit(), express.GetDeposit()) } else { suite.Require().Error(err) - suite.Require().Nil(expRes) + suite.Require().Nil(express) } }) } @@ -1225,7 +1225,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposit() { var ( req *v1beta1.QueryDepositRequest - expRes *v1beta1.QueryDepositResponse + express *v1beta1.QueryDepositResponse proposal v1.Proposal ) @@ -1300,7 +1300,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposit() { Depositor: addr0Str, } - expRes = &v1beta1.QueryDepositResponse{Deposit: deposit} + express = &v1beta1.QueryDepositResponse{Deposit: deposit} }, true, }, @@ -1316,10 +1316,10 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposit() { if tc.expPass { suite.Require().NoError(err) - suite.Require().Equal(deposit.GetDeposit(), expRes.GetDeposit()) + suite.Require().Equal(deposit.GetDeposit(), express.GetDeposit()) } else { suite.Require().Error(err) - suite.Require().Nil(expRes) + suite.Require().Nil(express) } }) } @@ -1334,7 +1334,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { var ( req *v1.QueryDepositsRequest - expRes *v1.QueryDepositsResponse + express *v1.QueryDepositsResponse proposal v1.Proposal ) @@ -1400,7 +1400,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { ProposalId: proposal.Id, } - expRes = &v1.QueryDepositsResponse{ + express = &v1.QueryDepositsResponse{ Deposits: deposits, } }, @@ -1418,7 +1418,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { if tc.expPass { suite.Require().NoError(err) - suite.Require().Equal(expRes.GetDeposits(), deposits.GetDeposits()) + suite.Require().Equal(express.GetDeposits(), deposits.GetDeposits()) } else { suite.Require().Error(err) suite.Require().Nil(deposits) @@ -1437,7 +1437,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposits() { var ( req *v1beta1.QueryDepositsRequest - expRes *v1beta1.QueryDepositsResponse + express *v1beta1.QueryDepositsResponse proposal v1.Proposal ) @@ -1505,7 +1505,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposits() { ProposalId: proposal.Id, } - expRes = &v1beta1.QueryDepositsResponse{ + express = &v1beta1.QueryDepositsResponse{ Deposits: deposits, } }, @@ -1523,7 +1523,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposits() { if tc.expPass { suite.Require().NoError(err) - suite.Require().Equal(expRes.GetDeposits(), deposits.GetDeposits()) + suite.Require().Equal(express.GetDeposits(), deposits.GetDeposits()) } else { suite.Require().Error(err) suite.Require().Nil(deposits) diff --git a/x/gov/simulation/msg_factory.go b/x/gov/simulation/msg_factory.go index b1267a9ea262..ef68d2b47aa1 100644 --- a/x/gov/simulation/msg_factory.go +++ b/x/gov/simulation/msg_factory.go @@ -228,7 +228,7 @@ func submitProposalWithVotesScheduled( reporter.Skip("proposal not in voting period") return nil, nil } - voter := testData.AccountAt(reporter, whoVotes[i]) + voter := testData.accountant(reporter, whoVotes[i]) msg := v1.NewMsgVote(voter.AddressBech32, proposalID, randomVotingOption(r.Rand), "") return []simsx.SimAccount{voter}, msg }