Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
fix: some typos (#1412)
Browse files Browse the repository at this point in the history
Hey, I fix some typos in the code.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Documentation**
- Corrected various typos in comments across multiple files for improved
clarity and professionalism.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
tranhoaison committed Jan 12, 2024
1 parent 13911c3 commit 05217e8
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
2 changes: 1 addition & 1 deletion cosmos/testutil/bank.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
2 changes: 1 addition & 1 deletion cosmos/x/evm/plugins/precompile/log/attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cosmos/x/evm/plugins/precompile/log/translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion cosmos/x/evm/plugins/precompile/recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cosmos/x/evm/plugins/state/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ 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})
copy(bz[1:], address[:])
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})
Expand Down
2 changes: 1 addition & 1 deletion cosmos/x/evm/plugins/state/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion e2e/localnet/network/fixture_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion e2e/precompile/contracts/bank/bank_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion e2e/precompile/contracts/distribution/distribution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion e2e/precompile/contracts/gov/governance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion e2e/precompile/contracts/staking/staking_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion eth/core/state/journal/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion eth/core/state/journal/selfdestructs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 05217e8

Please sign in to comment.