diff --git a/accounts/abi/abi_test.go b/accounts/abi/abi_test.go index b21218de3e00..ddfc78681827 100644 --- a/accounts/abi/abi_test.go +++ b/accounts/abi/abi_test.go @@ -1059,7 +1059,7 @@ func TestABI_EventById(t *testing.T) { t.Fatalf("Failed to look up ABI method: %v, test #%d", err, testnum) } if event == nil { - t.Errorf("We should find a event for topic %s, test #%d", topicID.Hex(), testnum) + t.Errorf("We should find an event for topic %s, test #%d", topicID.Hex(), testnum) } else if event.ID != topicID { t.Errorf("Event id %s does not match topic %s, test #%d", event.ID.Hex(), topicID.Hex(), testnum) } diff --git a/accounts/abi/bind/template.go b/accounts/abi/bind/template.go index f9ce54fb9131..35ef75caeabb 100644 --- a/accounts/abi/bind/template.go +++ b/accounts/abi/bind/template.go @@ -114,7 +114,7 @@ var ( {{$structs := .Structs}} {{range $structs}} - // {{.Name}} is an auto generated low-level Go binding around an user-defined struct. + // {{.Name}} is an auto generated low-level Go binding around a user-defined struct. type {{.Name}} struct { {{range $field := .Fields}} {{$field.Name}} {{$field.Type}}{{end}} diff --git a/accounts/keystore/keystore.go b/accounts/keystore/keystore.go index dbf62421b145..ae97929df4fe 100644 --- a/accounts/keystore/keystore.go +++ b/accounts/keystore/keystore.go @@ -258,7 +258,7 @@ func (ks *KeyStore) Delete(a accounts.Account, passphrase string) error { return err } -// SignHash calculates a ECDSA signature for the given hash. The produced +// SignHash calculates an ECDSA signature for the given hash. The produced // signature is in the [R || S || V] format where V is 0 or 1. func (ks *KeyStore) SignHash(a accounts.Account, hash []byte) ([]byte, error) { // Look up the key to sign with and abort if it cannot be found diff --git a/accounts/usbwallet/wallet.go b/accounts/usbwallet/wallet.go index 2bdf888d9b10..3f2421a91889 100644 --- a/accounts/usbwallet/wallet.go +++ b/accounts/usbwallet/wallet.go @@ -442,7 +442,7 @@ func (w *wallet) selfDerive() { // Contains implements accounts.Wallet, returning whether a particular account is // or is not pinned into this wallet instance. Although we could attempt to resolve -// unpinned accounts, that would be an non-negligible hardware operation. +// unpinned accounts, that would be a non-negligible hardware operation. func (w *wallet) Contains(account accounts.Account) bool { w.stateLock.RLock() defer w.stateLock.RUnlock() diff --git a/cmd/clef/main.go b/cmd/clef/main.go index 121d1e783ac1..a118238dc0e6 100644 --- a/cmd/clef/main.go +++ b/cmd/clef/main.go @@ -129,7 +129,7 @@ var ( stdiouiFlag = &cli.BoolFlag{ Name: "stdio-ui", Usage: "Use STDIN/STDOUT as a channel for an external UI. " + - "This means that an STDIN/STDOUT is used for RPC-communication with a e.g. a graphical user " + + "This means that a STDIN/STDOUT is used for RPC-communication with a e.g. a graphical user " + "interface, and can be used when Clef is started by an external process.", } testFlag = &cli.BoolFlag{ diff --git a/cmd/evm/internal/t8ntool/tracewriter.go b/cmd/evm/internal/t8ntool/tracewriter.go index 4b81f19c9a9d..0ed658fc2360 100644 --- a/cmd/evm/internal/t8ntool/tracewriter.go +++ b/cmd/evm/internal/t8ntool/tracewriter.go @@ -27,7 +27,7 @@ import ( "github.com/ava-labs/libevm/log" ) -// traceWriter is an vm.EVMLogger which also holds an inner logger/tracer. +// traceWriter is a vm.EVMLogger which also holds an inner logger/tracer. // When the TxEnd event happens, the inner tracer result is written to the file, and // the file is closed. type traceWriter struct { diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index ac56bc747254..dc567e6b8545 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -544,7 +544,7 @@ var ( // Logging and debug settings EthStatsURLFlag = &cli.StringFlag{ Name: "ethstats", - Usage: "Reporting URL of a ethstats service (nodename:secret@host:port)", + Usage: "Reporting URL of an ethstats service (nodename:secret@host:port)", Category: flags.MetricsCategory, } NoCompactionFlag = &cli.BoolFlag{ diff --git a/consensus/clique/api.go b/consensus/clique/api.go index 986e3b6b7e35..a5803611beab 100644 --- a/consensus/clique/api.go +++ b/consensus/clique/api.go @@ -205,7 +205,7 @@ func (sb *blockNumberOrHashOrRLP) UnmarshalJSON(data []byte) error { } // GetSigner returns the signer for a specific clique block. -// Can be called with a block number, a block hash or a rlp encoded blob. +// Can be called with a block number, a block hash or an rlp encoded blob. // The RLP encoded blob can either be a block or a header. func (api *API) GetSigner(rlpOrBlockNr *blockNumberOrHashOrRLP) (common.Address, error) { if len(rlpOrBlockNr.RLP) == 0 { diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index c5d108337d78..002e56c8c756 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -114,7 +114,7 @@ var ( // errInvalidMixDigest is returned if a block's mix digest is non-zero. errInvalidMixDigest = errors.New("non-zero mix digest") - // errInvalidUncleHash is returned if a block contains an non-empty uncle list. + // errInvalidUncleHash is returned if a block contains a non-empty uncle list. errInvalidUncleHash = errors.New("non empty uncle hash") // errInvalidDifficulty is returned if the difficulty of a block neither 1 or 2. diff --git a/consensus/ethash/ethash.go b/consensus/ethash/ethash.go index 069595c86d0d..99564b37bcf3 100644 --- a/consensus/ethash/ethash.go +++ b/consensus/ethash/ethash.go @@ -40,7 +40,7 @@ func NewFaker() *Ethash { return new(Ethash) } -// NewFakeFailer creates a ethash consensus engine with a fake PoW scheme that +// NewFakeFailer creates an ethash consensus engine with a fake PoW scheme that // accepts all blocks as valid apart from the single one specified, though they // still have to conform to the Ethereum consensus rules. func NewFakeFailer(fail uint64) *Ethash { @@ -49,7 +49,7 @@ func NewFakeFailer(fail uint64) *Ethash { } } -// NewFakeDelayer creates a ethash consensus engine with a fake PoW scheme that +// NewFakeDelayer creates an ethash consensus engine with a fake PoW scheme that // accepts all blocks as valid, but delays verifications by some time, though // they still have to conform to the Ethereum consensus rules. func NewFakeDelayer(delay time.Duration) *Ethash { diff --git a/core/rawdb/accessors_snapshot.go b/core/rawdb/accessors_snapshot.go index 9dfe4605363f..24a747f07355 100644 --- a/core/rawdb/accessors_snapshot.go +++ b/core/rawdb/accessors_snapshot.go @@ -92,20 +92,20 @@ func DeleteAccountSnapshot(db ethdb.KeyValueWriter, hash common.Hash) { } } -// ReadStorageSnapshot retrieves the snapshot entry of an storage trie leaf. +// ReadStorageSnapshot retrieves the snapshot entry of a storage trie leaf. func ReadStorageSnapshot(db ethdb.KeyValueReader, accountHash, storageHash common.Hash) []byte { data, _ := db.Get(storageSnapshotKey(accountHash, storageHash)) return data } -// WriteStorageSnapshot stores the snapshot entry of an storage trie leaf. +// WriteStorageSnapshot stores the snapshot entry of a storage trie leaf. func WriteStorageSnapshot(db ethdb.KeyValueWriter, accountHash, storageHash common.Hash, entry []byte) { if err := db.Put(storageSnapshotKey(accountHash, storageHash), entry); err != nil { log.Crit("Failed to store storage snapshot", "err", err) } } -// DeleteStorageSnapshot removes the snapshot entry of an storage trie leaf. +// DeleteStorageSnapshot removes the snapshot entry of a storage trie leaf. func DeleteStorageSnapshot(db ethdb.KeyValueWriter, accountHash, storageHash common.Hash) { if err := db.Delete(storageSnapshotKey(accountHash, storageHash)); err != nil { log.Crit("Failed to delete storage snapshot", "err", err) diff --git a/core/rawdb/freezer_table.go b/core/rawdb/freezer_table.go index 4393390e1e7c..bf1709bddddb 100644 --- a/core/rawdb/freezer_table.go +++ b/core/rawdb/freezer_table.go @@ -239,7 +239,7 @@ func (t *freezerTable) repair() error { firstIndex.unmarshalBinary(buffer) // Assign the tail fields with the first stored index. - // The total removed items is represented with an uint32, + // The total removed items is represented with a uint32, // which is not enough in theory but enough in practice. // TODO: use uint64 to represent total removed items. t.tailId = firstIndex.filenum diff --git a/core/rlp_test.go b/core/rlp_test.go index c3c0ce95793c..3ce26dbec532 100644 --- a/core/rlp_test.go +++ b/core/rlp_test.go @@ -133,7 +133,7 @@ func testRlpIterator(t *testing.T, txs, uncles, datasize int) { } } -// BenchmarkHashing compares the speeds of hashing a rlp raw data directly +// BenchmarkHashing compares the speeds of hashing an rlp raw data directly // without the unmarshalling/marshalling step func BenchmarkHashing(b *testing.B) { // Make a pretty fat block diff --git a/core/state/database.go b/core/state/database.go index 87a22cf76580..dbc0d2c2b82e 100644 --- a/core/state/database.go +++ b/core/state/database.go @@ -20,7 +20,6 @@ import ( "errors" "fmt" - "github.com/crate-crypto/go-ipa/banderwagon" "github.com/ava-labs/libevm/common" "github.com/ava-labs/libevm/common/lru" "github.com/ava-labs/libevm/core/rawdb" @@ -31,6 +30,7 @@ import ( "github.com/ava-labs/libevm/trie/trienode" "github.com/ava-labs/libevm/trie/utils" "github.com/ava-labs/libevm/triedb" + "github.com/crate-crypto/go-ipa/banderwagon" ) const ( @@ -71,7 +71,7 @@ type Database interface { TrieDB() *triedb.Database } -// Trie is a Ethereum Merkle Patricia trie. +// Trie is an Ethereum Merkle Patricia trie. type Trie interface { // GetKey returns the sha3 preimage of a hashed key that was previously used // to store a value. diff --git a/core/state/iterator.go b/core/state/iterator.go index c6ee20ed3eb6..dd23fddea3fb 100644 --- a/core/state/iterator.go +++ b/core/state/iterator.go @@ -46,7 +46,7 @@ type nodeIterator struct { Error error // Failure set in case of an internal error in the iterator } -// newNodeIterator creates an post-order state node iterator. +// newNodeIterator creates a post-order state node iterator. func newNodeIterator(state *StateDB) *nodeIterator { return &nodeIterator{ state: state, diff --git a/core/state/snapshot/context.go b/core/state/snapshot/context.go index 5ea9c815ad09..1541601c86b1 100644 --- a/core/state/snapshot/context.go +++ b/core/state/snapshot/context.go @@ -46,7 +46,7 @@ type generatorStats struct { storage common.StorageSize // Total account and storage slot size(generation or recovery) } -// Log creates an contextual log with the given message and the context pulled +// Log creates a contextual log with the given message and the context pulled // from the internally maintained statistics. func (gs *generatorStats) Log(msg string, root common.Hash, marker []byte) { var ctx []interface{} diff --git a/core/state/snapshot/iterator_binary.go b/core/state/snapshot/iterator_binary.go index fda894fbe551..2c933e06dd62 100644 --- a/core/state/snapshot/iterator_binary.go +++ b/core/state/snapshot/iterator_binary.go @@ -68,7 +68,7 @@ func (dl *diffLayer) initBinaryStorageIterator(account common.Hash) Iterator { parent, ok := dl.parent.(*diffLayer) if !ok { // If the storage in this layer is already destructed, discard all - // deeper layers but still return an valid single-branch iterator. + // deeper layers but still return a valid single-branch iterator. a, destructed := dl.StorageIterator(account, common.Hash{}) if destructed { l := &binaryIterator{ @@ -92,7 +92,7 @@ func (dl *diffLayer) initBinaryStorageIterator(account common.Hash) Iterator { return l } // If the storage in this layer is already destructed, discard all - // deeper layers but still return an valid single-branch iterator. + // deeper layers but still return a valid single-branch iterator. a, destructed := dl.StorageIterator(account, common.Hash{}) if destructed { l := &binaryIterator{ diff --git a/core/state/snapshot/snapshot.go b/core/state/snapshot/snapshot.go index e000c563e411..92625f1df663 100644 --- a/core/state/snapshot/snapshot.go +++ b/core/state/snapshot/snapshot.go @@ -863,7 +863,7 @@ func (t *Tree) generating() (bool, error) { return layer.genMarker != nil, nil } -// DiskRoot is a external helper function to return the disk layer root. +// DiskRoot is an external helper function to return the disk layer root. func (t *Tree) DiskRoot() common.Hash { t.lock.Lock() defer t.lock.Unlock() diff --git a/core/state/trie_prefetcher.go b/core/state/trie_prefetcher.go index 275f20b94b69..504f24147f89 100644 --- a/core/state/trie_prefetcher.go +++ b/core/state/trie_prefetcher.go @@ -203,7 +203,7 @@ func (p *triePrefetcher) used(owner common.Hash, root common.Hash, used [][]byte } } -// trieID returns an unique trie identifier consists the trie owner and root hash. +// trieID returns a unique trie identifier consists the trie owner and root hash. func (p *triePrefetcher) trieID(owner common.Hash, root common.Hash) string { trieID := make([]byte, common.HashLength*2) copy(trieID, owner.Bytes()) diff --git a/core/vm/contracts.libevm_test.go b/core/vm/contracts.libevm_test.go index 1bb98fac2fa0..0a960c17ce73 100644 --- a/core/vm/contracts.libevm_test.go +++ b/core/vm/contracts.libevm_test.go @@ -702,7 +702,7 @@ func TestPrecompileMakeCall(t *testing.T) { func TestPrecompileCallWithTracer(t *testing.T) { // The native pre-state tracer, when logging storage, assumes an invariant // that is broken by a precompile calling another contract. This is a test - // of the fix, ensuring that an SLOADed value is properly handled by the + // of the fix, ensuring that a SLOADed value is properly handled by the // tracer. rng := ethtest.NewPseudoRand(42 * 142857) diff --git a/crypto/secp256k1/curve.go b/crypto/secp256k1/curve.go index 9b26ab292859..549d3c8e24d0 100644 --- a/crypto/secp256k1/curve.go +++ b/crypto/secp256k1/curve.go @@ -262,7 +262,7 @@ func (BitCurve *BitCurve) Marshal(x, y *big.Int) []byte { return ret } -// Unmarshal converts a point, serialised by Marshal, into an x, y pair. On +// Unmarshal converts a point, serialised by Marshal, into a x, y pair. On // error, x = nil. func (BitCurve *BitCurve) Unmarshal(data []byte) (x, y *big.Int) { byteLen := (BitCurve.BitSize + 7) >> 3 diff --git a/crypto/secp256k1/libsecp256k1/src/scalar.h b/crypto/secp256k1/libsecp256k1/src/scalar.h index 27e9d8375e8b..a812ea92f3e3 100644 --- a/crypto/secp256k1/libsecp256k1/src/scalar.h +++ b/crypto/secp256k1/libsecp256k1/src/scalar.h @@ -72,7 +72,7 @@ static int secp256k1_scalar_is_zero(const secp256k1_scalar *a); /** Check whether a scalar equals one. */ static int secp256k1_scalar_is_one(const secp256k1_scalar *a); -/** Check whether a scalar, considered as an nonnegative integer, is even. */ +/** Check whether a scalar, considered as a nonnegative integer, is even. */ static int secp256k1_scalar_is_even(const secp256k1_scalar *a); /** Check whether a scalar is higher than the group order divided by 2. */ diff --git a/eth/catalyst/queue.go b/eth/catalyst/queue.go index 6f473557b6c5..5eb5596cf786 100644 --- a/eth/catalyst/queue.go +++ b/eth/catalyst/queue.go @@ -107,7 +107,7 @@ func (q *payloadQueue) has(id engine.PayloadID) bool { return false } -// headerQueueItem represents an hash->header tuple to store until it's retrieved +// headerQueueItem represents a hash->header tuple to store until it's retrieved // or evicted. type headerQueueItem struct { hash common.Hash diff --git a/eth/fetcher/block_fetcher_test.go b/eth/fetcher/block_fetcher_test.go index d85e5b543024..016eff80b580 100644 --- a/eth/fetcher/block_fetcher_test.go +++ b/eth/fetcher/block_fetcher_test.go @@ -286,7 +286,7 @@ func verifyFetchingEvent(t *testing.T, fetching chan []common.Hash, arrive bool) } } -// verifyCompletingEvent verifies that one single event arrive on an completing channel. +// verifyCompletingEvent verifies that one single event arrive on a completing channel. func verifyCompletingEvent(t *testing.T, completing chan []common.Hash, arrive bool) { t.Helper() diff --git a/eth/fetcher/tx_fetcher.go b/eth/fetcher/tx_fetcher.go index 39562713a014..68c4d7cc681c 100644 --- a/eth/fetcher/tx_fetcher.go +++ b/eth/fetcher/tx_fetcher.go @@ -171,7 +171,7 @@ type TxFetcher struct { // Stage 1: Waiting lists for newly discovered transactions that might be // broadcast without needing explicit request/reply round trips. - waitlist map[common.Hash]map[string]struct{} // Transactions waiting for an potential broadcast + waitlist map[common.Hash]map[string]struct{} // Transactions waiting for a potential broadcast waittime map[common.Hash]mclock.AbsTime // Timestamps when transactions were added to the waitlist waitslots map[string]map[common.Hash]*txMetadata // Waiting announcements grouped by peer (DoS protection) diff --git a/eth/fetcher/tx_fetcher_test.go b/eth/fetcher/tx_fetcher_test.go index 54fe5bbed902..be9ee9a8cbfc 100644 --- a/eth/fetcher/tx_fetcher_test.go +++ b/eth/fetcher/tx_fetcher_test.go @@ -562,7 +562,7 @@ func TestTransactionFetcherFailedRescheduling(t *testing.T) { "A": {{0x01}, {0x02}}, }, }, - // While the original peer is stuck in the request, push in an second + // While the original peer is stuck in the request, push in a second // data source. doTxNotify{peer: "B", hashes: []common.Hash{{0x02}}}, isWaiting(nil), diff --git a/eth/protocols/snap/protocol.go b/eth/protocols/snap/protocol.go index d615a08e0e55..08087ecb91cf 100644 --- a/eth/protocols/snap/protocol.go +++ b/eth/protocols/snap/protocol.go @@ -113,7 +113,7 @@ func (p *AccountRangePacket) Unpack() ([]common.Hash, [][]byte, error) { return hashes, accounts, nil } -// GetStorageRangesPacket represents an storage slot query. +// GetStorageRangesPacket represents a storage slot query. type GetStorageRangesPacket struct { ID uint64 // Request ID to match up responses with Root common.Hash // Root hash of the account trie to serve diff --git a/ethstats/ethstats.go b/ethstats/ethstats.go index 21a211acedf8..6aed95aa7d94 100644 --- a/ethstats/ethstats.go +++ b/ethstats/ethstats.go @@ -419,7 +419,7 @@ func (s *Service) readLoop(conn *connWrapper) { if !ok { log.Warn("Invalid stats history request", "msg", msg["emit"][1]) select { - case s.histCh <- nil: // Treat it as an no indexes request + case s.histCh <- nil: // Treat it as a no indexes request default: } continue diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 7da95b2e5d7b..ee9d0e0002e3 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1478,7 +1478,7 @@ func (s *BlockChainAPI) CreateAccessList(ctx context.Context, args TransactionAr // AccessList creates an access list for the given transaction. // If the accesslist creation fails an error is returned. -// If the transaction itself fails, an vmErr is returned. +// If the transaction itself fails, a vmErr is returned. func AccessList(ctx context.Context, b Backend, blockNrOrHash rpc.BlockNumberOrHash, args TransactionArgs) (acl types.AccessList, gasUsed uint64, vmErr error, err error) { // Retrieve the execution context db, header, err := b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash) @@ -1857,7 +1857,7 @@ func (s *TransactionAPI) Sign(addr common.Address, data hexutil.Bytes) (hexutil. return signature, err } -// SignTransactionResult represents a RLP encoded signed transaction. +// SignTransactionResult represents an RLP encoded signed transaction. type SignTransactionResult struct { Raw hexutil.Bytes `json:"raw"` Tx *types.Transaction `json:"tx"` diff --git a/metrics/opentsdb.go b/metrics/opentsdb.go index e81690f94340..c4d89e1e13f0 100644 --- a/metrics/opentsdb.go +++ b/metrics/opentsdb.go @@ -37,7 +37,7 @@ func OpenTSDB(r Registry, d time.Duration, prefix string, addr *net.TCPAddr) { } // OpenTSDBWithConfig is a blocking exporter function just like OpenTSDB, -// but it takes a OpenTSDBConfig instead. +// but it takes an OpenTSDBConfig instead. func OpenTSDBWithConfig(c OpenTSDBConfig) { for range time.Tick(c.FlushInterval) { if err := openTSDB(&c); nil != err { diff --git a/p2p/enode/nodedb_test.go b/p2p/enode/nodedb_test.go index 38764f31b124..877581d339fa 100644 --- a/p2p/enode/nodedb_test.go +++ b/p2p/enode/nodedb_test.go @@ -242,7 +242,7 @@ var nodeDBSeedQueryNodes = []struct { } func TestDBSeedQuery(t *testing.T) { - // Querying seeds uses seeks an might not find all nodes + // Querying seeds uses seeks and might not find all nodes // every time when the database is small. Run the test multiple // times to avoid flakes. const attempts = 15 diff --git a/rpc/testservice_test.go b/rpc/testservice_test.go index 7d873af6670e..a80be58e4c9f 100644 --- a/rpc/testservice_test.go +++ b/rpc/testservice_test.go @@ -185,7 +185,7 @@ func (s *notificationTestService) SomeSubscription(ctx context.Context, n, val i return nil, ErrNotificationsUnsupported } - // By explicitly creating an subscription we make sure that the subscription id is send + // By explicitly creating a subscription we make sure that the subscription id is send // back to the client before the first subscription.Notify is called. Otherwise the // events might be send before the response for the *_subscribe method. subscription := notifier.CreateSubscription() diff --git a/signer/core/gnosis_safe.go b/signer/core/gnosis_safe.go index 310b4f1ec892..c15e854faee2 100644 --- a/signer/core/gnosis_safe.go +++ b/signer/core/gnosis_safe.go @@ -50,7 +50,7 @@ type GnosisSafeTx struct { ChainId *math.HexOrDecimal256 `json:"chainId,omitempty"` } -// ToTypedData converts the tx to a EIP-712 Typed Data structure for signing +// ToTypedData converts the tx to an EIP-712 Typed Data structure for signing func (tx *GnosisSafeTx) ToTypedData() apitypes.TypedData { var data hexutil.Bytes if tx.Data != nil { diff --git a/trie/proof.go b/trie/proof.go index a7874afd35b4..233d556987b6 100644 --- a/trie/proof.go +++ b/trie/proof.go @@ -372,7 +372,7 @@ func unset(parent node, child node, key []byte, pos int, removeLeft bool) error return unset(cld, cld.Children[key[pos]], key, pos+1, removeLeft) case *shortNode: if len(key[pos:]) < len(cld.Key) || !bytes.Equal(cld.Key, key[pos:pos+len(cld.Key)]) { - // Find the fork point, it's an non-existent branch. + // Find the fork point, it's a non-existent branch. if removeLeft { if bytes.Compare(cld.Key, key[pos:]) < 0 { // The key of fork shortnode is less than the path diff --git a/trie/trie_reader.go b/trie/trie_reader.go index d54d7b6df2fe..172bfd69efa0 100644 --- a/trie/trie_reader.go +++ b/trie/trie_reader.go @@ -54,7 +54,7 @@ func newEmptyReader() *trieReader { } // node retrieves the rlp-encoded trie node with the provided trie node -// information. An MissingNodeError will be returned in case the node is +// information. A MissingNodeError will be returned in case the node is // not found or any error is encountered. func (r *trieReader) node(path []byte, hash common.Hash) ([]byte, error) { // Perform the logics in tests for preventing trie node access. diff --git a/triedb/pathdb/database_test.go b/triedb/pathdb/database_test.go index 0f25ebcc4db1..30deadd62226 100644 --- a/triedb/pathdb/database_test.go +++ b/triedb/pathdb/database_test.go @@ -302,7 +302,7 @@ func (t *tester) generate(parent common.Hash) (common.Hash, *trienode.MergedNode return root, ctx.nodes, triestate.New(ctx.accountOrigin, ctx.storageOrigin, nil) } -// lastRoot returns the latest root hash, or empty if nothing is cached. +// lastHash returns the latest root hash, or empty if nothing is cached. func (t *tester) lastHash() common.Hash { if len(t.roots) == 0 { return common.Hash{}