From 05217e8af14e32704d895eb22ef3a51cec4d8b0d Mon Sep 17 00:00:00 2001 From: Santala <31094102+tranhoaison@users.noreply.github.com> Date: Fri, 12 Jan 2024 23:10:30 +0700 Subject: [PATCH] fix: some typos (#1412) Hey, I fix some typos in the code. ## Summary by CodeRabbit - **Documentation** - Corrected various typos in comments across multiple files for improved clarity and professionalism. --- contracts/src/cosmos/precompile/testing/GovernanceWrapper.sol | 2 +- cosmos/testutil/bank.go | 2 +- cosmos/x/evm/plugins/precompile/log/attributes.go | 2 +- cosmos/x/evm/plugins/precompile/log/translator.go | 4 ++-- cosmos/x/evm/plugins/precompile/recovery.go | 2 +- cosmos/x/evm/plugins/state/keys.go | 4 ++-- cosmos/x/evm/plugins/state/plugin.go | 2 +- e2e/localnet/network/fixture_test.go | 2 +- e2e/precompile/contracts/bank/bank_test.go | 2 +- e2e/precompile/contracts/distribution/distribution_test.go | 2 +- e2e/precompile/contracts/gov/governance_test.go | 2 +- e2e/precompile/contracts/misc/precompile_constructor_test.go | 2 +- e2e/precompile/contracts/staking/staking_test.go | 2 +- eth/core/state/journal/logs.go | 2 +- eth/core/state/journal/selfdestructs.go | 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) diff --git a/contracts/src/cosmos/precompile/testing/GovernanceWrapper.sol b/contracts/src/cosmos/precompile/testing/GovernanceWrapper.sol index 3ec7e73fa..5b8d8d1c4 100644 --- a/contracts/src/cosmos/precompile/testing/GovernanceWrapper.sol +++ b/contracts/src/cosmos/precompile/testing/GovernanceWrapper.sol @@ -93,7 +93,7 @@ contract GovernanceWrapper { } /** - * @dev Cancel a proposal. Returns the cancled time and height. + * @dev Cancel a proposal. Returns the canceled time and height. * burned. * @param proposalId The id of the proposal to cancel. */ diff --git a/cosmos/testutil/bank.go b/cosmos/testutil/bank.go index fb33fb88b..56f52e9cc 100644 --- a/cosmos/testutil/bank.go +++ b/cosmos/testutil/bank.go @@ -55,6 +55,6 @@ func MintCoinsToAddress( return err } - // Send the bank denomination to the receipient. + // Send the bank denomination to the recipient. return bk.SendCoinsFromModuleToAccount(ctx, moduleAcc, recipient.Bytes(), coins) } diff --git a/cosmos/x/evm/plugins/precompile/log/attributes.go b/cosmos/x/evm/plugins/precompile/log/attributes.go index 93686f654..18b66338e 100644 --- a/cosmos/x/evm/plugins/precompile/log/attributes.go +++ b/cosmos/x/evm/plugins/precompile/log/attributes.go @@ -39,7 +39,7 @@ import ( const ( // intBase is the base `int`s are parsed in, 10. intBase = 10 - // int64Bits is the number of bits stored in a variabe of `int64` type. + // int64Bits is the number of bits stored in a variable of `int64` type. int64Bits = 64 // notFound is a default return value for searches in which an item was not found. notFound = -1 diff --git a/cosmos/x/evm/plugins/precompile/log/translator.go b/cosmos/x/evm/plugins/precompile/log/translator.go index 7d54a8d36..ba633b7b5 100644 --- a/cosmos/x/evm/plugins/precompile/log/translator.go +++ b/cosmos/x/evm/plugins/precompile/log/translator.go @@ -43,7 +43,7 @@ func (f *Factory) makeTopics(pl *precompileLog, event *sdk.Event) ([]common.Hash // for each Ethereum indexed argument, get the corresponding Cosmos event attribute and // convert to a geth compatible type. NOTE: this iteration has total complexity O(M), where - // M = average length of atrribute key strings, as length of `indexedInputs` <= 3. + // M = average length of attribute key strings, as length of `indexedInputs` <= 3. for i, arg := range pl.indexedInputs { attrIdx := searchAttributesForArg(&event.Attributes, arg.Name) if attrIdx == notFound { @@ -80,7 +80,7 @@ func (f *Factory) makeData(pl *precompileLog, event *sdk.Event) ([]byte, error) // for each Ethereum non-indexed argument, get the corresponding Cosmos event attribute and // convert to a geth compatible type. NOTE: the total complexity of this iteration: O(M*N^2), - // where N is the # of non-indexed args, M = average length of atrribute key strings. + // where N is the # of non-indexed args, M = average length of attribute key strings. for i, arg := range pl.nonIndexedInputs { attrIdx := searchAttributesForArg(&event.Attributes, arg.Name) if attrIdx == notFound { diff --git a/cosmos/x/evm/plugins/precompile/recovery.go b/cosmos/x/evm/plugins/precompile/recovery.go index 8e2aaa846..0294fcd7d 100644 --- a/cosmos/x/evm/plugins/precompile/recovery.go +++ b/cosmos/x/evm/plugins/precompile/recovery.go @@ -34,7 +34,7 @@ import ( // RecoveryHandler is used to recover from any WriteProtection and gas consumption panics that // occur during precompile execution; the handler modifies the given error to be returned to the -// caller. Any other type of panic is propogated up to the caller via panic. +// caller. Any other type of panic is propagated up to the caller via panic. func RecoveryHandler(ctx sdk.Context, vmErr *error) { if panicked := recover(); panicked != nil { // NOTE: this only propagates an error back to the EVM if the type of the given panic diff --git a/cosmos/x/evm/plugins/state/keys.go b/cosmos/x/evm/plugins/state/keys.go index e8bca381d..e77e5a42f 100644 --- a/cosmos/x/evm/plugins/state/keys.go +++ b/cosmos/x/evm/plugins/state/keys.go @@ -67,7 +67,7 @@ func AddressFromSlotKey(key []byte) common.Address { return common.BytesToAddress(key[1 : 1+common.AddressLength]) } -// CodeHashKeyFor defines the full key under which an addreses codehash is stored. +// CodeHashKeyFor defines the full key under which an addresses codehash is stored. func CodeHashKeyFor(address common.Address) []byte { bz := make([]byte, 1+common.AddressLength) copy(bz, []byte{types.CodeHashKeyPrefix}) @@ -75,7 +75,7 @@ func CodeHashKeyFor(address common.Address) []byte { return bz } -// CodeKeyFor defines the full key under which an addreses code is stored. +// CodeKeyFor defines the full key under which an addresses code is stored. func CodeKeyFor(codeHash common.Hash) []byte { bz := make([]byte, 1+common.HashLength) copy(bz, []byte{types.CodeKeyPrefix}) diff --git a/cosmos/x/evm/plugins/state/plugin.go b/cosmos/x/evm/plugins/state/plugin.go index bfd0200ec..7f098dd76 100644 --- a/cosmos/x/evm/plugins/state/plugin.go +++ b/cosmos/x/evm/plugins/state/plugin.go @@ -114,7 +114,7 @@ type plugin struct { stateCtx context.Context - // lqc is used for fullfilling + // lqc is used for fulfilling lqc sdk.Context qfn func() func(height int64, prove bool) (sdk.Context, error) } diff --git a/e2e/localnet/network/fixture_test.go b/e2e/localnet/network/fixture_test.go index 987fabe8c..ca0d0ba15 100644 --- a/e2e/localnet/network/fixture_test.go +++ b/e2e/localnet/network/fixture_test.go @@ -65,7 +65,7 @@ var _ = Describe("JSON RPC tests", func() { }) AfterEach(func() { - // Dump logs and stop the containter here. + // Dump logs and stop the container here. if !CurrentSpecReport().Failure.IsZero() { logs, err := tf.DumpLogs() Expect(err).ToNot(HaveOccurred()) diff --git a/e2e/precompile/contracts/bank/bank_test.go b/e2e/precompile/contracts/bank/bank_test.go index 77a0f1325..51922df28 100644 --- a/e2e/precompile/contracts/bank/bank_test.go +++ b/e2e/precompile/contracts/bank/bank_test.go @@ -63,7 +63,7 @@ var _ = Describe("Bank", func() { }) AfterEach(func() { - // Dump logs and stop the containter here. + // Dump logs and stop the container here. if !CurrentSpecReport().Failure.IsZero() { logs, err := tf.DumpLogs() Expect(err).ToNot(HaveOccurred()) diff --git a/e2e/precompile/contracts/distribution/distribution_test.go b/e2e/precompile/contracts/distribution/distribution_test.go index 2fbe1fc4f..bce6d7a81 100644 --- a/e2e/precompile/contracts/distribution/distribution_test.go +++ b/e2e/precompile/contracts/distribution/distribution_test.go @@ -78,7 +78,7 @@ var _ = Describe("Distribution Precompile", func() { }) AfterEach(func() { - // Dump logs and stop the containter here. + // Dump logs and stop the container here. if !CurrentSpecReport().Failure.IsZero() { logs, err := tf.DumpLogs() Expect(err).ToNot(HaveOccurred()) diff --git a/e2e/precompile/contracts/gov/governance_test.go b/e2e/precompile/contracts/gov/governance_test.go index 003a9cfe4..a06478e29 100644 --- a/e2e/precompile/contracts/gov/governance_test.go +++ b/e2e/precompile/contracts/gov/governance_test.go @@ -123,7 +123,7 @@ var _ = Describe("Call the Precompile Directly", func() { }) AfterEach(func() { - // Dump logs and stop the containter here. + // Dump logs and stop the container here. if !CurrentSpecReport().Failure.IsZero() { logs, err := tf.DumpLogs() Expect(err).ToNot(HaveOccurred()) diff --git a/e2e/precompile/contracts/misc/precompile_constructor_test.go b/e2e/precompile/contracts/misc/precompile_constructor_test.go index 06bafb8ea..71bcff6d5 100644 --- a/e2e/precompile/contracts/misc/precompile_constructor_test.go +++ b/e2e/precompile/contracts/misc/precompile_constructor_test.go @@ -51,7 +51,7 @@ var _ = Describe("Miscellaneous Precompile Tests", func() { }) AfterEach(func() { - // Dump logs and stop the containter here. + // Dump logs and stop the container here. if !CurrentSpecReport().Failure.IsZero() { logs, err := tf.DumpLogs() Expect(err).ToNot(HaveOccurred()) diff --git a/e2e/precompile/contracts/staking/staking_test.go b/e2e/precompile/contracts/staking/staking_test.go index cacf0e56e..80a8c5c2b 100644 --- a/e2e/precompile/contracts/staking/staking_test.go +++ b/e2e/precompile/contracts/staking/staking_test.go @@ -76,7 +76,7 @@ var _ = Describe("Staking", func() { }) AfterEach(func() { - // Dump logs and stop the containter here. + // Dump logs and stop the container here. if !CurrentSpecReport().Failure.IsZero() { logs, err := tf.DumpLogs() Expect(err).ToNot(HaveOccurred()) diff --git a/eth/core/state/journal/logs.go b/eth/core/state/journal/logs.go index 995043eff..aa6e4e300 100644 --- a/eth/core/state/journal/logs.go +++ b/eth/core/state/journal/logs.go @@ -39,7 +39,7 @@ type Log interface { TxIndex() int // AddLog adds a log to the logs journal. AddLog(*ethtypes.Log) - // Logs returns the logs of the tx with the exisiting metadata. + // Logs returns the logs of the tx with the existing metadata. Logs() []*ethtypes.Log // GetLogs returns the logs of the tx with the given metadata. GetLogs(hash common.Hash, blockNumber uint64, blockHash common.Hash) []*ethtypes.Log diff --git a/eth/core/state/journal/selfdestructs.go b/eth/core/state/journal/selfdestructs.go index b9e2425b4..7a3532f9a 100644 --- a/eth/core/state/journal/selfdestructs.go +++ b/eth/core/state/journal/selfdestructs.go @@ -34,7 +34,7 @@ import ( // 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470. var emptyCodeHash = crypto.Keccak256Hash(nil) -// `selfDestructStatePlugin` defines the required funtions from the StatePlugin +// `selfDestructStatePlugin` defines the required functions from the StatePlugin // for the suicide journal. type selfDestructStatePlugin interface { // GetCodeHash returns the code hash of the given account.