From 904d0a69130cc187e022914c284698c434556848 Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Fri, 8 Nov 2024 13:08:53 +0700 Subject: [PATCH 1/2] Add typos check to CI --- .github/workflows/typo-check.yml | 19 +++++++++++++++++++ _typos.toml | 8 ++++++++ 2 files changed, 27 insertions(+) create mode 100644 .github/workflows/typo-check.yml create mode 100644 _typos.toml diff --git a/.github/workflows/typo-check.yml b/.github/workflows/typo-check.yml new file mode 100644 index 000000000..de612025b --- /dev/null +++ b/.github/workflows/typo-check.yml @@ -0,0 +1,19 @@ +name: Check for typos + +on: + merge_group: + pull_request: + push: + branches: + - main + workflow_dispatch: + +jobs: + check-typos: + name: "Spell-check repository source" + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Run spell-check + uses: crate-ci/typos@master diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 000000000..c58a7cc09 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,8 @@ +[default] +extend-ignore-re = ["(?Rm)^.*(#|//)\\s*spellchecker:disable-line$"] + +[default.extend-identifiers] +iNdEx = "iNdEx" + +[files] +extend-exclude = ["**/go.mod", "**/go.sum", "**/*.pb.go"] From d824a1166688973089365d153003b54d8eb26135 Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Fri, 8 Nov 2024 13:40:43 +0700 Subject: [PATCH 2/2] Fix typos --- CHANGELOG.md | 8 ++-- EVENTS.md | 8 ++-- UPGRADING.md | 6 +-- app/params/doc.go | 4 +- app/sim_test.go | 4 +- docs/proto/proto-docs.md | 10 ++--- proto/cosmwasm/wasm/v1/proposal_legacy.proto | 8 ++-- proto/cosmwasm/wasm/v1/tx.proto | 4 +- scripts/README.md | 2 +- scripts/contrib/devtools/Makefile | 2 +- tests/ibctesting/endpoint.go | 2 +- tests/system/system.go | 2 +- x/wasm/keeper/handler_plugin_encoders_test.go | 2 +- x/wasm/keeper/keeper_test.go | 26 ++++++------ x/wasm/keeper/msg_dispatcher_test.go | 4 +- x/wasm/keeper/querier.go | 4 +- x/wasm/keeper/querier_test.go | 12 +++--- x/wasm/keeper/staking_test.go | 42 +++++++++---------- x/wasm/migrations/v1/store.go | 2 +- x/wasm/migrations/v2/legacy_types.go | 2 +- x/wasm/migrations/v3/legacy_types.go | 2 +- x/wasm/simulation/proposals.go | 2 +- x/wasm/types/gas_register.go | 4 +- x/wasm/types/gas_register_test.go | 2 +- x/wasm/types/keys.go | 2 +- x/wasm/types/proposal_legacy.pb.go | 6 +-- x/wasm/types/tx.pb.go | 2 +- x/wasm/types/wasmer_engine.go | 2 +- 28 files changed, 88 insertions(+), 88 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b8e59440..bcd346017 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -162,7 +162,7 @@ - Log query error before redacting [\#1593](https://github.com/CosmWasm/wasmd/issues/1593) - Restrict pagination on all-state-query [\#1619](https://github.com/CosmWasm/wasmd/pull/1619) - Bug in IbcQuery::ListChannels implementation when port is unset [\#1597](https://github.com/CosmWasm/wasmd/issues/1597) -- Ensure some contraints and limits on pin/unpin code ids [\#1624](https://github.com/CosmWasm/wasmd/pull/1624) +- Ensure some constraints and limits on pin/unpin code ids [\#1624](https://github.com/CosmWasm/wasmd/pull/1624) - Ensure genesis import works with both address generators [\#1629](https://github.com/CosmWasm/wasmd/issues/1629) - Set default query limit and ensure constraints [\#1632](https://github.com/CosmWasm/wasmd/pull/1632) @@ -174,7 +174,7 @@ - If `port_id` is omitted, all channels bound to the contract's port will be listed. - Restrict pagination on all-state-query [\#1619](https://github.com/CosmWasm/wasmd/pull/1619) - Pagination limit is set to 100 for all-state-query. See also [\#1632](https://github.com/CosmWasm/wasmd/pull/1632) -- Ensure some contraints and limits on pin/unpin code ids [\#1624](https://github.com/CosmWasm/wasmd/pull/1624) +- Ensure some constraints and limits on pin/unpin code ids [\#1624](https://github.com/CosmWasm/wasmd/pull/1624) - Total number of code ids is limited to 50 for pin/unpin operations - Custom StoreCode Authorization for authz module [\#1584](https://github.com/CosmWasm/wasmd/issues/1584) @@ -413,7 +413,7 @@ below to learn more! [Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.28.0...v0.29.0) -- Add dependencies for protobuf and remove third_party forlder [/#1030](https://github.com/CosmWasm/wasmd/pull/1030) +- Add dependencies for protobuf and remove third_party folder [/#1030](https://github.com/CosmWasm/wasmd/pull/1030) - Check wasmvm version on startup [\#1029](https://github.com/CosmWasm/wasmd/pull/1029/) - Allow AccessConfig to use a list of addresses instead of just a single address [\#945](https://github.com/CosmWasm/wasmd/issues/945) - Make contract addresses predictable \("deterministic"\) [\#942](https://github.com/CosmWasm/wasmd/issues/942) @@ -455,7 +455,7 @@ No **Fixed Bugs** -- Fix: Make events in reply completely determinisitic by stripping out anything coming from Cosmos SDK (not CosmWasm codebase) [\#917](https://github.com/CosmWasm/wasmd/pull/917) ([assafmo](https://github.com/assafmo)) +- Fix: Make events in reply completely deterministic by stripping out anything coming from Cosmos SDK (not CosmWasm codebase) [\#917](https://github.com/CosmWasm/wasmd/pull/917) ([assafmo](https://github.com/assafmo)) Migration notes: diff --git a/EVENTS.md b/EVENTS.md index 371e1c405..e2fc365c0 100644 --- a/EVENTS.md +++ b/EVENTS.md @@ -46,7 +46,7 @@ consistent order (and avoid dictionaries/hashes). Here is a simple Event in JSON "type": "wasm", "attributes": [ {"key": "_contract_address", "value": "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6"}, - {"key": "transfered", "value": "777000"} + {"key": "transferred", "value": "777000"} ] } ``` @@ -321,10 +321,10 @@ action emitting events, so we define a structure to flatten this event tree: * All events are returned in execution order as [defined by CosmWasm docs](https://github.com/CosmWasm/cosmwasm/blob/main/SEMANTICS.md#dispatching-messages) * `x/wasm` keeper emits a custom event for each call to a contract entry point. Not just `execute`, `instantiate`, and `migrate`, but also `reply`, `sudo` and all ibc entry points. -* This means all `wasm*` events are preceeded by the cosmwasm entry point that returned them. +* This means all `wasm*` events are preceded by the cosmwasm entry point that returned them. To make this more clear, I will provide an example of executing a contract, which returns two messages, one to instantiate a new -contract and the other to set the withdrawl address, while also using `ReplyOnSuccess` for the instantiation (to get the +contract and the other to set the withdrawal address, while also using `ReplyOnSuccess` for the instantiation (to get the address). It will emit a series of events that looks something like this: ```go @@ -335,7 +335,7 @@ sdk.NewEvent( sdk.NewAttribute("sender", msg.Sender), ), -// top-level exection call +// top-level execution call sdk.NewEvent( "execute", sdk.NewAttribute("_contract_address", contractAddr.String()), diff --git a/UPGRADING.md b/UPGRADING.md index a5e204f2b..823497c68 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -142,7 +142,7 @@ docker run --rm -it \ ## Take majority control of the chain -In genesis we have a valiator with 250 million `ustake` bonded. We want to be easily +In genesis we have a validator with 250 million `ustake` bonded. We want to be easily able to pass a proposal with our client. Let us bond 700 million `ustake` to ensure we have > 67% of the voting power and will pass with the validator not voting. @@ -167,7 +167,7 @@ docker run --rm -it \ ## Vote on the upgrade Now that we see the chain is running and producing blocks, and our client has -enough token to control the netwrok, let's create a governance +enough token to control the network, let's create a governance upgrade proposal for the new chain to move to `musselnet-v2` (this must be the same name as we use in the handler we created above, change this to match what you put in your handler): @@ -298,7 +298,7 @@ docker run --rm -it \ After this, we just let the chain run and open the terminal so you can see the log files. It should keep producing blocks until it hits height 500 (or whatever you set there), when the process will print a huge stacktrace and hang. Immediately before the stack trace, you -should see a line like this (burried under tons of tendermint logs): +should see a line like this (buried under tons of tendermint logs): `8:50PM ERR UPGRADE "musselnet-v2" NEEDED at height: 100:` diff --git a/app/params/doc.go b/app/params/doc.go index 7c6035cad..49b5f6d1e 100644 --- a/app/params/doc.go +++ b/app/params/doc.go @@ -3,9 +3,9 @@ Package params defines the simulation parameters in the gaia. It contains the default weights used for each transaction used on the module's simulation. These weights define the chance for a transaction to be simulated at -any gived operation. +any given operation. -You can repace the default values for the weights by providing a params.json +You can replace the default values for the weights by providing a params.json file with the weights defined for each of the transaction operations: { diff --git a/app/sim_test.go b/app/sim_test.go index e6e1ae041..8f3eb4a6d 100644 --- a/app/sim_test.go +++ b/app/sim_test.go @@ -179,7 +179,7 @@ func TestAppImportExport(t *testing.T) { failedKVAs, failedKVBs := simtestutil.DiffKVStores(storeA, storeB, skipPrefixes[keyName]) if !assert.Equal(t, len(failedKVAs), len(failedKVBs), "unequal sets of key-values to compare in %q", keyName) { for _, v := range failedKVBs { - t.Logf("store missmatch: %q\n", v) + t.Logf("store mismatch: %q\n", v) } t.FailNow() } @@ -187,7 +187,7 @@ func TestAppImportExport(t *testing.T) { t.Logf("compared %d different key/value pairs between %s and %s\n", len(failedKVAs), appKeyA, appKeyB) if !assert.Equal(t, 0, len(failedKVAs), simtestutil.GetSimulationLog(keyName, app.SimulationManager().StoreDecoders, failedKVAs, failedKVBs)) { for _, v := range failedKVAs { - t.Logf("store missmatch: %q\n", v) + t.Logf("store mismatch: %q\n", v) } t.FailNow() } diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md index f20eb1317..0cb320e96 100644 --- a/docs/proto/proto-docs.md +++ b/docs/proto/proto-docs.md @@ -746,10 +746,10 @@ a v1 governance proposal. | ----- | ---- | ----- | ----------- | | `title` | [string](#string) | | Title is a short summary | | `description` | [string](#string) | | Description is a human readable text | -| `run_as` | [string](#string) | | RunAs is the address that is passed to the contract's enviroment as sender | +| `run_as` | [string](#string) | | RunAs is the address that is passed to the contract's environment as sender | | `admin` | [string](#string) | | Admin is an optional address that can execute migrations | | `code_id` | [uint64](#uint64) | | CodeID is the reference to the stored WASM code | -| `label` | [string](#string) | | Label is optional metadata to be stored with a constract instance. | +| `label` | [string](#string) | | Label is optional metadata to be stored with a contract instance. | | `msg` | [bytes](#bytes) | | Msg json encode message to be passed to the contract on instantiation | | `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred to the contract on instantiation | | `salt` | [bytes](#bytes) | | Salt is an arbitrary value provided by the sender. Size can be 1 to 64. | @@ -776,7 +776,7 @@ a v1 governance proposal. | `run_as` | [string](#string) | | RunAs is the address that is passed to the contract's environment as sender | | `admin` | [string](#string) | | Admin is an optional address that can execute migrations | | `code_id` | [uint64](#uint64) | | CodeID is the reference to the stored WASM code | -| `label` | [string](#string) | | Label is optional metadata to be stored with a constract instance. | +| `label` | [string](#string) | | Label is optional metadata to be stored with a contract instance. | | `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract on instantiation | | `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred to the contract on instantiation | @@ -847,7 +847,7 @@ the x/gov module via a v1 governance proposal. | `instantiate_permission` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | InstantiatePermission to apply on contract creation, optional | | `unpin_code` | [bool](#bool) | | UnpinCode code on upload, optional | | `admin` | [string](#string) | | Admin is an optional address that can execute migrations | -| `label` | [string](#string) | | Label is optional metadata to be stored with a constract instance. | +| `label` | [string](#string) | | Label is optional metadata to be stored with a contract instance. | | `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract on instantiation | | `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred to the contract on instantiation | | `source` | [string](#string) | | Source is the URL where the code is hosted | @@ -1762,7 +1762,7 @@ Since: 0.40 | `instantiate_permission` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | InstantiatePermission to apply on contract creation, optional | | `unpin_code` | [bool](#bool) | | UnpinCode code on upload, optional. As default the uploaded contract is pinned to cache. | | `admin` | [string](#string) | | Admin is an optional address that can execute migrations | -| `label` | [string](#string) | | Label is optional metadata to be stored with a constract instance. | +| `label` | [string](#string) | | Label is optional metadata to be stored with a contract instance. | | `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract on instantiation | | `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred from the authority account to the contract on instantiation | | `source` | [string](#string) | | Source is the URL where the code is hosted | diff --git a/proto/cosmwasm/wasm/v1/proposal_legacy.proto b/proto/cosmwasm/wasm/v1/proposal_legacy.proto index efefbeb43..d6d7a7d23 100644 --- a/proto/cosmwasm/wasm/v1/proposal_legacy.proto +++ b/proto/cosmwasm/wasm/v1/proposal_legacy.proto @@ -64,7 +64,7 @@ message InstantiateContractProposal { string admin = 4 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // CodeID is the reference to the stored WASM code uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; - // Label is optional metadata to be stored with a constract instance. + // Label is optional metadata to be stored with a contract instance. string label = 6; // Msg json encoded message to be passed to the contract on instantiation bytes msg = 7 [ @@ -93,13 +93,13 @@ message InstantiateContract2Proposal { string title = 1; // Description is a human readable text string description = 2; - // RunAs is the address that is passed to the contract's enviroment as sender + // RunAs is the address that is passed to the contract's environment as sender string run_as = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // Admin is an optional address that can execute migrations string admin = 4 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // CodeID is the reference to the stored WASM code uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; - // Label is optional metadata to be stored with a constract instance. + // Label is optional metadata to be stored with a contract instance. string label = 6; // Msg json encode message to be passed to the contract on instantiation bytes msg = 7 [ @@ -330,7 +330,7 @@ message StoreAndInstantiateContractProposal { bool unpin_code = 6; // Admin is an optional address that can execute migrations string admin = 7; - // Label is optional metadata to be stored with a constract instance. + // Label is optional metadata to be stored with a contract instance. string label = 8; // Msg json encoded message to be passed to the contract on instantiation bytes msg = 9 [ diff --git a/proto/cosmwasm/wasm/v1/tx.proto b/proto/cosmwasm/wasm/v1/tx.proto index 88a06f7a5..4dfe7446f 100644 --- a/proto/cosmwasm/wasm/v1/tx.proto +++ b/proto/cosmwasm/wasm/v1/tx.proto @@ -399,7 +399,7 @@ message MsgStoreAndInstantiateContract { bool unpin_code = 5; // Admin is an optional address that can execute migrations string admin = 6 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - // Label is optional metadata to be stored with a constract instance. + // Label is optional metadata to be stored with a contract instance. string label = 7; // Msg json encoded message to be passed to the contract on instantiation bytes msg = 8 [ @@ -518,4 +518,4 @@ message MsgUpdateContractLabel { } // MsgUpdateContractLabelResponse returns empty data -message MsgUpdateContractLabelResponse {} \ No newline at end of file +message MsgUpdateContractLabelResponse {} diff --git a/scripts/README.md b/scripts/README.md index c0aba168f..78f08b191 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -1,6 +1,6 @@ # Scripts -These scripts are copied from the [Cosmos-SDK](https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/scripts) respository +These scripts are copied from the [Cosmos-SDK](https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/scripts) repository with minor modifications. All credits and big thanks go to the original authors. Please note that a custom [fork](github.com/regen-network/protobuf) by the Regen network team is used. diff --git a/scripts/contrib/devtools/Makefile b/scripts/contrib/devtools/Makefile index 04cf14dc4..e8f55b65b 100644 --- a/scripts/contrib/devtools/Makefile +++ b/scripts/contrib/devtools/Makefile @@ -64,7 +64,7 @@ $(STATIK): @(cd /tmp && go install github.com/rakyll/statik@v0.1.6) # Install the runsim binary with a temporary workaround of entering an outside -# directory as the "go get" command ignores the -mod option and will polute the +# directory as the "go get" command ignores the -mod option and will pollute the # go.{mod, sum} files. # # ref: https://github.com/golang/go/issues/30515 diff --git a/tests/ibctesting/endpoint.go b/tests/ibctesting/endpoint.go index 54a20bd04..ec6a5d6ca 100644 --- a/tests/ibctesting/endpoint.go +++ b/tests/ibctesting/endpoint.go @@ -59,7 +59,7 @@ func NewDefaultEndpoint(chain *TestChain) *Endpoint { } } -// QueryProof queries proof associated with this endpoint using the lastest client state +// QueryProof queries proof associated with this endpoint using the latest client state // height on the counterparty chain. func (endpoint *Endpoint) QueryProof(key []byte) ([]byte, clienttypes.Height) { // obtain the counterparty client representing the chain associated with the endpoint diff --git a/tests/system/system.go b/tests/system/system.go index b408a952a..6295c17a0 100644 --- a/tests/system/system.go +++ b/tests/system/system.go @@ -374,7 +374,7 @@ func (s *SystemUnderTest) BuildNewBinary() { } } -// AwaitBlockHeight blocks until te target height is reached. An optional timout parameter can be passed to abort early +// AwaitBlockHeight blocks until te target height is reached. An optional timeout parameter can be passed to abort early func (s *SystemUnderTest) AwaitBlockHeight(t *testing.T, targetHeight int64, timeout ...time.Duration) { t.Helper() require.Greater(t, targetHeight, s.currentHeight) diff --git a/x/wasm/keeper/handler_plugin_encoders_test.go b/x/wasm/keeper/handler_plugin_encoders_test.go index 75faf7238..d2a0a5b6b 100644 --- a/x/wasm/keeper/handler_plugin_encoders_test.go +++ b/x/wasm/keeper/handler_plugin_encoders_test.go @@ -814,7 +814,7 @@ func TestEncodeGovMsg(t *testing.T) { }, }, }, - "Gov weighted vote: splitted": { + "Gov weighted vote: split": { sender: myAddr, srcMsg: wasmvmtypes.CosmosMsg{ Gov: &wasmvmtypes.GovMsg{ diff --git a/x/wasm/keeper/keeper_test.go b/x/wasm/keeper/keeper_test.go index dbebfa6e4..f48c9ba66 100644 --- a/x/wasm/keeper/keeper_test.go +++ b/x/wasm/keeper/keeper_test.go @@ -239,7 +239,7 @@ func TestEnforceValidPermissionsOnCreate(t *testing.T) { onlyOther := types.AccessTypeAnyOfAddresses.With(other) specs := map[string]struct { - defaultPermssion types.AccessType + defaultPermission types.AccessType requestedPermission *types.AccessConfig // grantedPermission is set iff no error grantedPermission types.AccessConfig @@ -247,42 +247,42 @@ func TestEnforceValidPermissionsOnCreate(t *testing.T) { expError *errorsmod.Error }{ "override everybody": { - defaultPermssion: types.AccessTypeEverybody, + defaultPermission: types.AccessTypeEverybody, requestedPermission: &onlyCreator, grantedPermission: onlyCreator, }, "default to everybody": { - defaultPermssion: types.AccessTypeEverybody, + defaultPermission: types.AccessTypeEverybody, requestedPermission: nil, grantedPermission: types.AccessConfig{Permission: types.AccessTypeEverybody}, }, "explicitly set everybody": { - defaultPermssion: types.AccessTypeEverybody, + defaultPermission: types.AccessTypeEverybody, requestedPermission: &types.AccessConfig{Permission: types.AccessTypeEverybody}, grantedPermission: types.AccessConfig{Permission: types.AccessTypeEverybody}, }, "cannot override nobody": { - defaultPermssion: types.AccessTypeNobody, + defaultPermission: types.AccessTypeNobody, requestedPermission: &onlyCreator, expError: sdkerrors.ErrUnauthorized, }, "default to nobody": { - defaultPermssion: types.AccessTypeNobody, + defaultPermission: types.AccessTypeNobody, requestedPermission: nil, grantedPermission: types.AccessConfig{Permission: types.AccessTypeNobody}, }, "only defaults to code creator": { - defaultPermssion: types.AccessTypeAnyOfAddresses, + defaultPermission: types.AccessTypeAnyOfAddresses, requestedPermission: nil, grantedPermission: onlyCreator, }, "can explicitly set to code creator": { - defaultPermssion: types.AccessTypeAnyOfAddresses, + defaultPermission: types.AccessTypeAnyOfAddresses, requestedPermission: &onlyCreator, grantedPermission: onlyCreator, }, "cannot override which address in only": { - defaultPermssion: types.AccessTypeAnyOfAddresses, + defaultPermission: types.AccessTypeAnyOfAddresses, requestedPermission: &onlyOther, expError: sdkerrors.ErrUnauthorized, }, @@ -290,7 +290,7 @@ func TestEnforceValidPermissionsOnCreate(t *testing.T) { for msg, spec := range specs { t.Run(msg, func(t *testing.T) { params := types.DefaultParams() - params.InstantiateDefaultPermission = spec.defaultPermssion + params.InstantiateDefaultPermission = spec.defaultPermission err := keeper.SetParams(ctx, params) require.NoError(t, err) codeID, _, err := contractKeeper.Create(ctx, creator, hackatomWasm, spec.requestedPermission) @@ -1647,7 +1647,7 @@ func TestIterateContractsByCodeWithMigration(t *testing.T) { type sudoMsg struct { // This is a tongue-in-check demo command. This is not the intended purpose of Sudo. - // Here we show that some priviledged Go module can make a call that should never be exposed + // Here we show that some privileged Go module can make a call that should never be exposed // to end users (via Tx/Execute). // // The contract developer can choose to expose anything to sudo. This functionality is not a true @@ -1693,7 +1693,7 @@ func TestSudo(t *testing.T) { // now the community wants to get paid via sudo msg := sudoMsg{ // This is a tongue-in-check demo command. This is not the intended purpose of Sudo. - // Here we show that some priviledged Go module can make a call that should never be exposed + // Here we show that some privileged Go module can make a call that should never be exposed // to end users (via Tx/Execute). StealFunds: stealFundsMsg{ Recipient: community.String(), @@ -2498,7 +2498,7 @@ func TestIteratorContractByCreator(t *testing.T) { creatorAddr: mockAddress2, contractsAddr: []string{gotAddr2.String(), gotAddr4.String(), gotAddr5.String()}, }, - "contractAdress": { + "contractAddress": { creatorAddr: gotAddr1, contractsAddr: []string{gotAddr3.String()}, }, diff --git a/x/wasm/keeper/msg_dispatcher_test.go b/x/wasm/keeper/msg_dispatcher_test.go index a17a73281..f9a0b7267 100644 --- a/x/wasm/keeper/msg_dispatcher_test.go +++ b/x/wasm/keeper/msg_dispatcher_test.go @@ -402,7 +402,7 @@ func TestDispatchSubmessages(t *testing.T) { // this is filtered out sdk.NewEvent("message", sdk.NewAttribute("stargate", "something-something")), // we still emit this to the client, but not the contract - sdk.NewEvent("non-determinstic"), + sdk.NewEvent("non-deterministic"), } return events, [][]byte{[]byte("subData")}, [][]*codectypes.Any{}, nil }, @@ -410,7 +410,7 @@ func TestDispatchSubmessages(t *testing.T) { expData: []byte("subData"), expCommits: []bool{true}, expEvents: []sdk.Event{ - sdk.NewEvent("non-determinstic"), + sdk.NewEvent("non-deterministic"), // the event from reply is also exposed sdk.NewEvent("stargate-reply"), }, diff --git a/x/wasm/keeper/querier.go b/x/wasm/keeper/querier.go index 54429d04b..d08b77b23 100644 --- a/x/wasm/keeper/querier.go +++ b/x/wasm/keeper/querier.go @@ -403,8 +403,8 @@ func (q GrpcQuerier) ContractsByCreator(c context.Context, req *types.QueryContr prefixStore := prefix.NewStore(runtime.KVStoreAdapter(q.storeService.OpenKVStore(ctx)), types.GetContractsByCreatorPrefix(creatorAddress)) pageRes, err := query.FilteredPaginate(prefixStore, paginationParams, func(key, _ []byte, accumulate bool) (bool, error) { if accumulate { - accAddres := sdk.AccAddress(key[types.AbsoluteTxPositionLen:]) - contracts = append(contracts, accAddres.String()) + accAddress := sdk.AccAddress(key[types.AbsoluteTxPositionLen:]) + contracts = append(contracts, accAddress.String()) } return true, nil }) diff --git a/x/wasm/keeper/querier_test.go b/x/wasm/keeper/querier_test.go index f35267f38..dfae47c00 100644 --- a/x/wasm/keeper/querier_test.go +++ b/x/wasm/keeper/querier_test.go @@ -1024,13 +1024,13 @@ func TestQueryContractsByCreatorList(t *testing.T) { return ctx } - var allExpecedContracts []string + var allExpectedContracts []string // create 10 contracts with real block/gas setup for i := 0; i < 10; i++ { ctx = setBlock(ctx, h) h++ contract, _, err := keepers.ContractKeeper.Instantiate(ctx, codeID, creator, nil, initMsgBz, fmt.Sprintf("contract %d", i), topUp) - allExpecedContracts = append(allExpecedContracts, contract.String()) + allExpectedContracts = append(allExpectedContracts, contract.String()) require.NoError(t, err) } @@ -1043,7 +1043,7 @@ func TestQueryContractsByCreatorList(t *testing.T) { srcQuery: &types.QueryContractsByCreatorRequest{ CreatorAddress: creator.String(), }, - expContractAddr: allExpecedContracts, + expContractAddr: allExpectedContracts, expErr: nil, }, "with pagination offset": { @@ -1062,19 +1062,19 @@ func TestQueryContractsByCreatorList(t *testing.T) { Limit: 1, }, }, - expContractAddr: allExpecedContracts[0:1], + expContractAddr: allExpectedContracts[0:1], expErr: nil, }, "nil creator": { srcQuery: &types.QueryContractsByCreatorRequest{ Pagination: &query.PageRequest{}, }, - expContractAddr: allExpecedContracts, + expContractAddr: allExpectedContracts, expErr: errors.New("empty address string is not allowed"), }, "nil req": { srcQuery: nil, - expContractAddr: allExpecedContracts, + expContractAddr: allExpectedContracts, expErr: status.Error(codes.InvalidArgument, "empty request"), }, } diff --git a/x/wasm/keeper/staking_test.go b/x/wasm/keeper/staking_test.go index 292094a52..fc577bcdd 100644 --- a/x/wasm/keeper/staking_test.go +++ b/x/wasm/keeper/staking_test.go @@ -31,7 +31,7 @@ type StakingInitMsg struct { Validator sdk.ValAddress `json:"validator"` ExitTax sdkmath.LegacyDec `json:"exit_tax"` // MinWithdrawal is uint128 encoded as a string (use math.Int?) - MinWithdrawl string `json:"min_withdrawal"` + MinWithdrawal string `json:"min_withdrawal"` } // StakingHandleMsg is used to encode handle messages @@ -88,8 +88,8 @@ type InvestmentResponse struct { Owner sdk.AccAddress `json:"owner"` Validator sdk.ValAddress `json:"validator"` ExitTax sdkmath.LegacyDec `json:"exit_tax"` - // MinWithdrawl is uint128 encoded as a string (use math.Int?) - MinWithdrawl string `json:"min_withdrawal"` + // MinWithdrawal is uint128 encoded as a string (use math.Int?) + MinWithdrawal string `json:"min_withdrawal"` } func TestInitializeStaking(t *testing.T) { @@ -114,12 +114,12 @@ func TestInitializeStaking(t *testing.T) { // register to a valid address initMsg := StakingInitMsg{ - Name: "Staking Derivatives", - Symbol: "DRV", - Decimals: 0, - Validator: valAddr, - ExitTax: sdkmath.LegacyMustNewDecFromStr("0.10"), - MinWithdrawl: "100", + Name: "Staking Derivatives", + Symbol: "DRV", + Decimals: 0, + Validator: valAddr, + ExitTax: sdkmath.LegacyMustNewDecFromStr("0.10"), + MinWithdrawal: "100", } initBz, err := json.Marshal(&initMsg) require.NoError(t, err) @@ -134,12 +134,12 @@ func TestInitializeStaking(t *testing.T) { // try to register with a validator not on the list and it fails _, bob := keyPubAddr() badInitMsg := StakingInitMsg{ - Name: "Missing Validator", - Symbol: "MISS", - Decimals: 0, - Validator: sdk.ValAddress(bob), - ExitTax: sdkmath.LegacyMustNewDecFromStr("0.10"), - MinWithdrawl: "100", + Name: "Missing Validator", + Symbol: "MISS", + Decimals: 0, + Validator: sdk.ValAddress(bob), + ExitTax: sdkmath.LegacyMustNewDecFromStr("0.10"), + MinWithdrawal: "100", } badBz, err := json.Marshal(&badInitMsg) require.NoError(t, err) @@ -191,12 +191,12 @@ func initializeStaking(t *testing.T) initInfo { // register to a valid address initMsg := StakingInitMsg{ - Name: "Staking Derivatives", - Symbol: "DRV", - Decimals: 0, - Validator: valAddr, - ExitTax: sdkmath.LegacyMustNewDecFromStr("0.10"), - MinWithdrawl: "100", + Name: "Staking Derivatives", + Symbol: "DRV", + Decimals: 0, + Validator: valAddr, + ExitTax: sdkmath.LegacyMustNewDecFromStr("0.10"), + MinWithdrawal: "100", } initBz, err := json.Marshal(&initMsg) require.NoError(t, err) diff --git a/x/wasm/migrations/v1/store.go b/x/wasm/migrations/v1/store.go index ab245b0e2..cdccb0a1a 100644 --- a/x/wasm/migrations/v1/store.go +++ b/x/wasm/migrations/v1/store.go @@ -8,7 +8,7 @@ import ( "github.com/CosmWasm/wasmd/x/wasm/types" ) -// AddToSecondIndexFn creates a secondary index entry for the creator fo the contract +// AddToSecondIndexFn creates a secondary index entry for the creator of the contract type AddToSecondIndexFn func(ctx context.Context, creatorAddress sdk.AccAddress, position *types.AbsoluteTxPosition, contractAddress sdk.AccAddress) error // Keeper abstract keeper diff --git a/x/wasm/migrations/v2/legacy_types.go b/x/wasm/migrations/v2/legacy_types.go index 787c28b57..1221ef8c0 100644 --- a/x/wasm/migrations/v2/legacy_types.go +++ b/x/wasm/migrations/v2/legacy_types.go @@ -1213,7 +1213,7 @@ func skipTypes(dAtA []byte) (n int, err error) { } var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshalling") ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") ) diff --git a/x/wasm/migrations/v3/legacy_types.go b/x/wasm/migrations/v3/legacy_types.go index 01ec4743a..d6a393c9c 100644 --- a/x/wasm/migrations/v3/legacy_types.go +++ b/x/wasm/migrations/v3/legacy_types.go @@ -1213,7 +1213,7 @@ func skipTypes(dAtA []byte) (n int, err error) { } var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshalling") ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") ) diff --git a/x/wasm/simulation/proposals.go b/x/wasm/simulation/proposals.go index c98bec205..24bd74b63 100644 --- a/x/wasm/simulation/proposals.go +++ b/x/wasm/simulation/proposals.go @@ -112,7 +112,7 @@ func ProposalMsgs(bk BankKeeper, wasmKeeper WasmKeeper) []simtypes.WeightedPropo } // simulate store code proposal (unused now) -// Current problem: out of gas (defaul gaswanted config of gov SimulateMsgSubmitProposal is 10_000_000) +// Current problem: out of gas (default gaswanted config of gov SimulateMsgSubmitProposal is 10_000_000) // but this proposal may need more than it func SimulateStoreCodeProposal(wasmKeeper WasmKeeper) simtypes.MsgSimulatorFn { return func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { diff --git a/x/wasm/types/gas_register.go b/x/wasm/types/gas_register.go index 37d12d4e3..5c7ef7e0d 100644 --- a/x/wasm/types/gas_register.go +++ b/x/wasm/types/gas_register.go @@ -174,7 +174,7 @@ func (g WasmGasRegister) UncompressCosts(byteLength int) storetypes.Gas { // SetupContractCost costs when interacting with a wasm contract. // Set discount to true in cases where you can reasonably assume the contract -// is loaded from an in-memory cache (e.g. pinned contracts or replys). +// is loaded from an in-memory cache (e.g. pinned contracts or replies). func (g WasmGasRegister) SetupContractCost(discount bool, msgLen int) storetypes.Gas { if msgLen < 0 { panic(errorsmod.Wrap(ErrInvalid, "negative length")) @@ -189,7 +189,7 @@ func (g WasmGasRegister) SetupContractCost(discount bool, msgLen int) storetypes // ReplyCosts costs to handle a message reply. // Set discount to true in cases where you can reasonably assume the contract -// is loaded from an in-memory cache (e.g. pinned contracts or replys). +// is loaded from an in-memory cache (e.g. pinned contracts or replies). func (g WasmGasRegister) ReplyCosts(discount bool, reply wasmvmtypes.Reply) storetypes.Gas { var eventGas storetypes.Gas msgLen := len(reply.Result.Err) diff --git a/x/wasm/types/gas_register_test.go b/x/wasm/types/gas_register_test.go index 45e9719cb..a1444d759 100644 --- a/x/wasm/types/gas_register_test.go +++ b/x/wasm/types/gas_register_test.go @@ -306,7 +306,7 @@ func TestFromWasmVMGasConversion(t *testing.T) { src: math.MaxUint64, exp: math.MaxUint64, }, - "missconfigured": { + "misconfigured": { srcConfig: WasmGasRegisterConfig{ GasMultiplier: 0, }, diff --git a/x/wasm/types/keys.go b/x/wasm/types/keys.go index 107b9de73..2f86ca169 100644 --- a/x/wasm/types/keys.go +++ b/x/wasm/types/keys.go @@ -41,7 +41,7 @@ var ( KeySequenceInstanceID = append(SequenceKeyPrefix, []byte("lastContractId")...) ) -// GetCodeKey constructs the key for retreiving the ID for the WASM code +// GetCodeKey constructs the key for retrieving the ID for the WASM code func GetCodeKey(codeID uint64) []byte { contractIDBz := sdk.Uint64ToBigEndian(codeID) return append(CodeKeyPrefix, contractIDBz...) diff --git a/x/wasm/types/proposal_legacy.pb.go b/x/wasm/types/proposal_legacy.pb.go index 79c8e2af1..0d16411d1 100644 --- a/x/wasm/types/proposal_legacy.pb.go +++ b/x/wasm/types/proposal_legacy.pb.go @@ -114,7 +114,7 @@ type InstantiateContractProposal struct { Admin string `protobuf:"bytes,4,opt,name=admin,proto3" json:"admin,omitempty"` // CodeID is the reference to the stored WASM code CodeID uint64 `protobuf:"varint,5,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` - // Label is optional metadata to be stored with a constract instance. + // Label is optional metadata to be stored with a contract instance. Label string `protobuf:"bytes,6,opt,name=label,proto3" json:"label,omitempty"` // Msg json encoded message to be passed to the contract on instantiation Msg RawContractMessage `protobuf:"bytes,7,opt,name=msg,proto3,casttype=RawContractMessage" json:"msg,omitempty"` @@ -176,7 +176,7 @@ type InstantiateContract2Proposal struct { Admin string `protobuf:"bytes,4,opt,name=admin,proto3" json:"admin,omitempty"` // CodeID is the reference to the stored WASM code CodeID uint64 `protobuf:"varint,5,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` - // Label is optional metadata to be stored with a constract instance. + // Label is optional metadata to be stored with a contract instance. Label string `protobuf:"bytes,6,opt,name=label,proto3" json:"label,omitempty"` // Msg json encode message to be passed to the contract on instantiation Msg RawContractMessage `protobuf:"bytes,7,opt,name=msg,proto3,casttype=RawContractMessage" json:"msg,omitempty"` @@ -724,7 +724,7 @@ type StoreAndInstantiateContractProposal struct { UnpinCode bool `protobuf:"varint,6,opt,name=unpin_code,json=unpinCode,proto3" json:"unpin_code,omitempty"` // Admin is an optional address that can execute migrations Admin string `protobuf:"bytes,7,opt,name=admin,proto3" json:"admin,omitempty"` - // Label is optional metadata to be stored with a constract instance. + // Label is optional metadata to be stored with a contract instance. Label string `protobuf:"bytes,8,opt,name=label,proto3" json:"label,omitempty"` // Msg json encoded message to be passed to the contract on instantiation Msg RawContractMessage `protobuf:"bytes,9,opt,name=msg,proto3,casttype=RawContractMessage" json:"msg,omitempty"` diff --git a/x/wasm/types/tx.pb.go b/x/wasm/types/tx.pb.go index f0c58e7e1..63309b09c 100644 --- a/x/wasm/types/tx.pb.go +++ b/x/wasm/types/tx.pb.go @@ -1183,7 +1183,7 @@ type MsgStoreAndInstantiateContract struct { UnpinCode bool `protobuf:"varint,5,opt,name=unpin_code,json=unpinCode,proto3" json:"unpin_code,omitempty"` // Admin is an optional address that can execute migrations Admin string `protobuf:"bytes,6,opt,name=admin,proto3" json:"admin,omitempty"` - // Label is optional metadata to be stored with a constract instance. + // Label is optional metadata to be stored with a contract instance. Label string `protobuf:"bytes,7,opt,name=label,proto3" json:"label,omitempty"` // Msg json encoded message to be passed to the contract on instantiation Msg RawContractMessage `protobuf:"bytes,8,opt,name=msg,proto3,casttype=RawContractMessage" json:"msg,omitempty"` diff --git a/x/wasm/types/wasmer_engine.go b/x/wasm/types/wasmer_engine.go index d22543acc..4dab6957d 100644 --- a/x/wasm/types/wasmer_engine.go +++ b/x/wasm/types/wasmer_engine.go @@ -132,7 +132,7 @@ type WasmEngine interface { // Sudo runs an existing contract in read/write mode (like Execute), but is never exposed to external callers // (either transactions or government proposals), but can only be called by other native Go modules directly. // - // This allows a contract to expose custom "super user" functions or priviledged operations that can be + // This allows a contract to expose custom "super user" functions or privileged operations that can be // deeply integrated with native modules. Sudo( checksum wasmvm.Checksum,