diff --git a/accounts/abi/bind/v2/dep_tree_test.go b/accounts/abi/bind/v2/dep_tree_test.go index b2470d8a16..8c2510d7a8 100644 --- a/accounts/abi/bind/v2/dep_tree_test.go +++ b/accounts/abi/bind/v2/dep_tree_test.go @@ -329,7 +329,7 @@ func TestContractLinking(t *testing.T) { map[rune]struct{}{}, }, // two contracts ('a' and 'f') share some dependencies. contract 'a' is marked as an override. expect that any of - // its depdencies that aren't shared with 'f' are not deployed. + // its dependencies that aren't shared with 'f' are not deployed. linkTestCaseInput{map[rune][]rune{ 'a': {'b', 'c', 'd', 'e'}, 'f': {'g', 'c', 'd', 'h'}}, diff --git a/cmd/devp2p/internal/ethtest/suite.go b/cmd/devp2p/internal/ethtest/suite.go index 4bcfd06d7f..20a03529ea 100644 --- a/cmd/devp2p/internal/ethtest/suite.go +++ b/cmd/devp2p/internal/ethtest/suite.go @@ -338,7 +338,7 @@ func (s *Suite) checkHeadersAgainstChain(req *eth.GetBlockHeadersPacket, resp *e } // collectResponses waits for n messages of type T on the given connection. -// The messsages are collected according to the 'identity' function. +// The messages are collected according to the 'identity' function. // // This function is written in a generic way to handle func collectHeaderResponses(conn *Conn, n int, identity func(*eth.BlockHeadersPacket) uint64) (map[uint64]*eth.BlockHeadersPacket, error) { @@ -665,7 +665,7 @@ func (s *Suite) TestBlockRangeUpdateInvalid(t *utesting.T) { func (s *Suite) TestBlockRangeUpdateFuture(t *utesting.T) { t.Log(`This test sends a BlockRangeUpdate that is beyond the chain head. -The node should accept the update and should not disonnect.`) +The node should accept the update and should not disconnect.`) conn, err := s.dialAndPeer(nil) if err != nil { t.Fatal(err) @@ -701,7 +701,7 @@ The node should accept the update and should not disonnect.`) func (s *Suite) TestBlockRangeUpdateHistoryExp(t *utesting.T) { t.Log(`This test sends a BlockRangeUpdate announcing incomplete (expired) history. -The node should accept the update and should not disonnect.`) +The node should accept the update and should not disconnect.`) conn, err := s.dialAndPeer(nil) if err != nil { t.Fatal(err) diff --git a/core/blockchain_test.go b/core/blockchain_test.go index 26a6df5755..4530895b9d 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -4412,9 +4412,9 @@ func testInsertChainWithCutoff(t *testing.T, cutoff uint64, ancientLimit uint64, if receipts == nil || len(receipts) != 1 { t.Fatalf("Missed block receipts: %d, cutoff: %d", num, cutoffBlock.NumberU64()) } - for indx, receipt := range receipts { - receiptByLookup, err := chain.GetCanonicalReceipt(body.Transactions[indx], receipt.BlockHash, - receipt.BlockNumber.Uint64(), uint64(indx)) + for index, receipt := range receipts { + receiptByLookup, err := chain.GetCanonicalReceipt(body.Transactions[index], receipt.BlockHash, + receipt.BlockNumber.Uint64(), uint64(index)) assert.NoError(t, err) assert.Equal(t, receipt, receiptByLookup) } diff --git a/core/dao_test.go b/core/dao_test.go index 2d4a20e6b9..6ecf4cbf17 100644 --- a/core/dao_test.go +++ b/core/dao_test.go @@ -119,7 +119,7 @@ func TestDAOForkRangeExtradata(t *testing.T) { t.Fatalf("pro-fork chain didn't accepted pro-fork block: %v", err) } } - // Verify that contra-forkers accept pro-fork extra-datas after forking finishes + // Verify that contra-forkers accept pro-fork extra-data after forking finishes bc, _ := NewBlockChain(rawdb.NewMemoryDatabase(), congspec, ethash.NewFaker(), nil) defer bc.Stop() @@ -137,7 +137,7 @@ func TestDAOForkRangeExtradata(t *testing.T) { if _, err := conBc.InsertChain(blocks); err != nil { t.Fatalf("contra-fork chain didn't accept pro-fork block post-fork: %v", err) } - // Verify that pro-forkers accept contra-fork extra-datas after forking finishes + // Verify that pro-forkers accept contra-fork extra-data after forking finishes bc, _ = NewBlockChain(rawdb.NewMemoryDatabase(), progspec, ethash.NewFaker(), nil) defer bc.Stop() diff --git a/core/filtermaps/matcher.go b/core/filtermaps/matcher.go index 238723fe1d..f4d630b590 100644 --- a/core/filtermaps/matcher.go +++ b/core/filtermaps/matcher.go @@ -445,7 +445,7 @@ func (m *singleMatcherInstance) cleanMapIndices() { m.mapIndices = m.mapIndices[:j] } -// matchAny combinines a set of matchers and returns a match for every position +// matchAny combines a set of matchers and returns a match for every position // where any of the underlying matchers signaled a match. A zero-length matchAny // acts as a "wild card" that signals a potential match at every position. type matchAny []matcher diff --git a/core/rawdb/accessors_indexes.go b/core/rawdb/accessors_indexes.go index 8c8c3ec9bb..154516a6a4 100644 --- a/core/rawdb/accessors_indexes.go +++ b/core/rawdb/accessors_indexes.go @@ -563,7 +563,7 @@ func DeleteBlockLvPointers(db ethdb.KeyValueStore, blocks common.Range[uint64], } // FilterMapsRange is a storage representation of the block range covered by the -// filter maps structure and the corresponting log value index range. +// filter maps structure and the corresponding log value index range. type FilterMapsRange struct { Version uint32 HeadIndexed bool diff --git a/core/rawdb/database.go b/core/rawdb/database.go index 56ab72d2b7..bf19f41c44 100644 --- a/core/rawdb/database.go +++ b/core/rawdb/database.go @@ -748,7 +748,7 @@ func ReadChainMetadata(db ethdb.KeyValueStore) [][]string { // is periodically called and if it returns an error then SafeDeleteRange // stops and also returns that error. The callback is not called if native // range delete is used or there are a small number of keys only. The bool -// argument passed to the callback is true if enrties have actually been +// argument passed to the callback is true if entries have actually been // deleted already. func SafeDeleteRange(db ethdb.KeyValueStore, start, end []byte, hashScheme bool, stopCallback func(bool) bool) error { if !hashScheme { diff --git a/core/state/snapshot/generate_test.go b/core/state/snapshot/generate_test.go index 3421169116..b768c7183b 100644 --- a/core/state/snapshot/generate_test.go +++ b/core/state/snapshot/generate_test.go @@ -722,7 +722,7 @@ func testGenerateWithExtraBeforeAndAfter(t *testing.T, scheme string) { } } -// TestGenerateWithMalformedSnapdata tests what happes if we have some junk +// TestGenerateWithMalformedSnapdata tests what happens if we have some junk // in the snapshot database, which cannot be parsed back to an account func TestGenerateWithMalformedSnapdata(t *testing.T) { testGenerateWithMalformedSnapdata(t, rawdb.HashScheme) diff --git a/core/state/snapshot/iterator.go b/core/state/snapshot/iterator.go index cd9c225844..f0170aad9f 100644 --- a/core/state/snapshot/iterator.go +++ b/core/state/snapshot/iterator.go @@ -89,7 +89,7 @@ func (dl *diffLayer) AccountIterator(seek common.Hash) AccountIterator { index := sort.Search(len(hashes), func(i int) bool { return bytes.Compare(seek[:], hashes[i][:]) <= 0 }) - // Assemble and returned the already seeked iterator + // Assemble and returned the already sought iterator return &diffAccountIterator{ layer: dl, keys: hashes[index:], @@ -252,7 +252,7 @@ func (dl *diffLayer) StorageIterator(account common.Hash, seek common.Hash) Stor index := sort.Search(len(hashes), func(i int) bool { return bytes.Compare(seek[:], hashes[i][:]) <= 0 }) - // Assemble and returned the already seeked iterator + // Assemble and returned the already sought iterator return &diffStorageIterator{ layer: dl, account: account, diff --git a/core/state_transition.go b/core/state_transition.go index 51c5836892..724b9963f8 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -728,7 +728,7 @@ func (st *stateTransition) validateAuthorization(auth *types.SetCodeAuthorizatio return authority, fmt.Errorf("%w: %v", ErrAuthorizationInvalidSignature, err) } // Check the authority account - // 1) doesn't have code or has exisiting delegation + // 1) doesn't have code or has existing delegation // 2) matches the auth's nonce // // Note it is added to the access list even if the authorization is invalid. diff --git a/core/stateless.go b/core/stateless.go index 805ef7ffbe..f8a3f81b12 100644 --- a/core/stateless.go +++ b/core/stateless.go @@ -38,7 +38,7 @@ import ( // need the other side to explicitly check. // // This method is a bit of a sore thumb here, but: -// - It cannot be placed in core/stateless, because state.New prodces a circular dep +// - It cannot be placed in core/stateless, because state.New produces a circular dep // - It cannot be placed outside of core, because it needs to construct a dud headerchain // // TODO(karalabe): Would be nice to resolve both issues above somehow and move it. diff --git a/core/txpool/blobpool/blobpool.go b/core/txpool/blobpool/blobpool.go index 60006130ed..1ae2ef906a 100644 --- a/core/txpool/blobpool/blobpool.go +++ b/core/txpool/blobpool/blobpool.go @@ -109,7 +109,7 @@ const ( // notifyThreshold is the eviction priority threshold above which a transaction // is considered close enough to being includable to be announced to peers. - // Setting this to zero will disable announcements for anyting not immediately + // Setting this to zero will disable announcements for anything not immediately // includable. Setting it to -1 allows transactions that are close to being // includable, maybe already in the next block if fees go down, to be announced. @@ -1897,7 +1897,7 @@ func (p *BlobPool) addLocked(tx *types.Transaction, checkGapped bool) (err error addValidMeter.Mark(1) - // Transaction was addded successfully, but we only announce if it is (close to being) + // Transaction was added successfully, but we only announce if it is (close to being) // includable and the previous one was already announced. if p.isAnnouncable(meta) && (meta.nonce == next || (len(txs) > 1 && txs[offset-1].announced)) { meta.announced = true diff --git a/core/txpool/blobpool/blobpool_test.go b/core/txpool/blobpool/blobpool_test.go index 49ff4bfe1c..dfdaaf51b6 100644 --- a/core/txpool/blobpool/blobpool_test.go +++ b/core/txpool/blobpool/blobpool_test.go @@ -242,7 +242,7 @@ func encodeForPool(tx *types.Transaction) []byte { return blob } -// makeMultiBlobTx is a utility method to construct a ramdom blob tx with +// makeMultiBlobTx is a utility method to construct a random blob tx with // certain number of blobs in its sidecar. func makeMultiBlobTx(nonce uint64, gasTipCap uint64, gasFeeCap uint64, blobFeeCap uint64, blobCount int, blobOffset int, key *ecdsa.PrivateKey, version byte) *types.Transaction { var ( @@ -559,7 +559,7 @@ func TestOpenDrops(t *testing.T) { id, _ := store.Put(blob) dangling[id] = struct{}{} } - // Insert a sequence of transactions with already passed nonces to veirfy + // Insert a sequence of transactions with already passed nonces to verify // that the entire set will get dropped (case 4). var ( filler, _ = crypto.GenerateKey() diff --git a/core/txpool/blobpool/lookup.go b/core/txpool/blobpool/lookup.go index 7607cd487a..2911d696d2 100644 --- a/core/txpool/blobpool/lookup.go +++ b/core/txpool/blobpool/lookup.go @@ -21,7 +21,7 @@ import ( ) type txMetadata struct { - id uint64 // the billy id of transction + id uint64 // the billy id of transaction size uint64 // the RLP encoded size of transaction (blobs are included) } diff --git a/core/txpool/legacypool/legacypool_test.go b/core/txpool/legacypool/legacypool_test.go index f8592ba001..49b5ec5fe7 100644 --- a/core/txpool/legacypool/legacypool_test.go +++ b/core/txpool/legacypool/legacypool_test.go @@ -2428,7 +2428,7 @@ func TestSetCodeTransactions(t *testing.T) { if err := pool.addRemoteSync(pricedSetCodeTx(0, 250000, uint256.NewInt(3000), uint256.NewInt(300), keyA, []unsignedAuth{{0, keyC}})); err != nil { t.Fatalf("%s: failed to add with remote setcode transaction: %v", name, err) } - // B should not be considred as having an in-flight delegation, so + // B should not be considered as having an in-flight delegation, so // should allow more than one pooled transaction. if err := pool.addRemoteSync(pricedTransaction(0, 100000, big.NewInt(10), keyB)); err != nil { t.Fatalf("%s: failed to replace with remote transaction: %v", name, err) diff --git a/core/vm/runtime/runtime_test.go b/core/vm/runtime/runtime_test.go index bc2ffd622d..c55e7ec3f0 100644 --- a/core/vm/runtime/runtime_test.go +++ b/core/vm/runtime/runtime_test.go @@ -475,7 +475,7 @@ func BenchmarkSimpleLoop(b *testing.B) { Op(vm.POP).Jump(lbl).Bytes() // pop return value and jump to label p, lbl = program.New().Jumpdest() - callInexistant := p. + callInexistent := p. Call(nil, 0xff, 0, 0, 0, 0, 0). Op(vm.POP).Jump(lbl).Bytes() // pop return value and jump to label @@ -515,7 +515,7 @@ func BenchmarkSimpleLoop(b *testing.B) { benchmarkNonModifyingCode(100000000, callIdentity, "call-identity-100M", "", b) benchmarkNonModifyingCode(100000000, loopingCode, "loop-100M", "", b) benchmarkNonModifyingCode(100000000, loopingCode2, "loop2-100M", "", b) - benchmarkNonModifyingCode(100000000, callInexistant, "call-nonexist-100M", "", b) + benchmarkNonModifyingCode(100000000, callInexistent, "call-nonexist-100M", "", b) benchmarkNonModifyingCode(100000000, callEOA, "call-EOA-100M", "", b) benchmarkNonModifyingCode(100000000, callRevertingContractWithInput, "call-reverting-100M", "", b) diff --git a/eth/dropper.go b/eth/dropper.go index dada5d07c0..4cbe52ed98 100644 --- a/eth/dropper.go +++ b/eth/dropper.go @@ -53,7 +53,7 @@ var ( // - during sync the Downloader handles peer connections, so dropper is disabled // - if not syncing and the peer count is close to the limit, it drops peers // randomly every peerDropInterval to make space for new peers -// - peers are dropped separately from the inboud pool and from the dialed pool +// - peers are dropped separately from the inbound pool and from the dialed pool type dropper struct { maxDialPeers int // maximum number of dialed peers maxInboundPeers int // maximum number of inbound peers diff --git a/eth/protocols/snap/sync.go b/eth/protocols/snap/sync.go index 841bfb446e..39534865c1 100644 --- a/eth/protocols/snap/sync.go +++ b/eth/protocols/snap/sync.go @@ -82,7 +82,7 @@ const ( minTrienodeHealThrottle = 1 // maxTrienodeHealThrottle is the maximum divisor for throttling trie node - // heal requests to avoid overloading the local node and exessively expanding + // heal requests to avoid overloading the local node and excessively expanding // the state trie bedth wise. maxTrienodeHealThrottle = maxTrieRequestCount diff --git a/eth/tracers/api_test.go b/eth/tracers/api_test.go index 0e62b9631d..932719bbed 100644 --- a/eth/tracers/api_test.go +++ b/eth/tracers/api_test.go @@ -1473,7 +1473,7 @@ func TestStandardTraceBlockToFile(t *testing.T) { }, }, } - txHashs := make([]common.Hash, 0, 2) + txHashes := make([]common.Hash, 0, 2) backend := newTestBackend(t, 1, genesis, func(i int, b *core.BlockGen) { b.SetCoinbase(common.Address{1}) // first tx to aa @@ -1486,7 +1486,7 @@ func TestStandardTraceBlockToFile(t *testing.T) { Data: nil, }), types.HomesteadSigner{}, key) b.AddTx(tx) - txHashs = append(txHashs, tx.Hash()) + txHashes = append(txHashes, tx.Hash()) // second tx to bb tx, _ = types.SignTx(types.NewTx(&types.LegacyTx{ Nonce: 1, @@ -1497,7 +1497,7 @@ func TestStandardTraceBlockToFile(t *testing.T) { Data: nil, }), types.HomesteadSigner{}, key) b.AddTx(tx) - txHashs = append(txHashs, tx.Hash()) + txHashes = append(txHashes, tx.Hash()) }) defer backend.teardown() @@ -1526,7 +1526,7 @@ func TestStandardTraceBlockToFile(t *testing.T) { { // test that only a specific tx is traced if specified blockNumber: rpc.LatestBlockNumber, - config: &StdTraceConfig{TxHash: txHashs[1]}, + config: &StdTraceConfig{TxHash: txHashes[1]}, want: []string{ `{"pc":0,"op":97,"gas":"0x13498","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH2"} {"pc":3,"op":80,"gas":"0x13495","gasCost":"0x2","memSize":0,"stack":["0x1"],"depth":1,"refund":0,"opName":"POP"} @@ -1563,7 +1563,7 @@ func TestTraceBadBlock(t *testing.T) { accounts = newAccounts(2) storageContract = common.HexToAddress("0x00000000000000000000000000000000deadbeef") signer = types.HomesteadSigner{} - txHashs = make([]common.Hash, 0, 2) + txHashes = make([]common.Hash, 0, 2) genesis = &core.Genesis{ Config: params.TestChainConfig, Alloc: types.GenesisAlloc{ @@ -1593,7 +1593,7 @@ func TestTraceBadBlock(t *testing.T) { Data: nil}), signer, accounts[0].key) b.AddTx(tx) - txHashs = append(txHashs, tx.Hash()) + txHashes = append(txHashes, tx.Hash()) // tx 1: call storage contract (executes PUSH1, PUSH1, SSTORE, STOP) tx, _ = types.SignTx(types.NewTx(&types.LegacyTx{ @@ -1605,7 +1605,7 @@ func TestTraceBadBlock(t *testing.T) { Data: nil}), signer, accounts[0].key) b.AddTx(tx) - txHashs = append(txHashs, tx.Hash()) + txHashes = append(txHashes, tx.Hash()) }) defer backend.teardown() @@ -1635,8 +1635,8 @@ func TestTraceBadBlock(t *testing.T) { if err := json.Unmarshal(have, &traces); err != nil { t.Fatalf("failed to unmarshal traces: %v", err) } - if traces[0].TxHash != txHashs[0] { - t.Errorf("tx 0: hash mismatch, have %v, want %v", traces[0].TxHash, txHashs[0]) + if traces[0].TxHash != txHashes[0] { + t.Errorf("tx 0: hash mismatch, have %v, want %v", traces[0].TxHash, txHashes[0]) } if traces[0].Result.Gas != params.TxGas { t.Errorf("tx 0: gas mismatch, have %d, want %d", traces[0].Result.Gas, params.TxGas) @@ -1646,8 +1646,8 @@ func TestTraceBadBlock(t *testing.T) { } // Second tx: contract call - if traces[1].TxHash != txHashs[1] { - t.Errorf("tx 1: hash mismatch, have %v, want %v", traces[1].TxHash, txHashs[1]) + if traces[1].TxHash != txHashes[1] { + t.Errorf("tx 1: hash mismatch, have %v, want %v", traces[1].TxHash, txHashes[1]) } if traces[1].Result.Failed { t.Error("tx 1: expected success, got failed") @@ -1811,7 +1811,7 @@ func TestStandardTraceBadBlockToFile(t *testing.T) { }, }, } - txHashs := make([]common.Hash, 0, 2) + txHashes := make([]common.Hash, 0, 2) backend := newTestBackend(t, 1, genesis, func(i int, b *core.BlockGen) { b.SetCoinbase(common.Address{1}) tx, _ := types.SignTx(types.NewTx(&types.LegacyTx{ @@ -1823,7 +1823,7 @@ func TestStandardTraceBadBlockToFile(t *testing.T) { Data: nil, }), types.HomesteadSigner{}, key) b.AddTx(tx) - txHashs = append(txHashs, tx.Hash()) + txHashes = append(txHashes, tx.Hash()) tx, _ = types.SignTx(types.NewTx(&types.LegacyTx{ Nonce: 1, @@ -1834,7 +1834,7 @@ func TestStandardTraceBadBlockToFile(t *testing.T) { Data: nil, }), types.HomesteadSigner{}, key) b.AddTx(tx) - txHashs = append(txHashs, tx.Hash()) + txHashes = append(txHashes, tx.Hash()) }) defer backend.teardown() @@ -1864,7 +1864,7 @@ func TestStandardTraceBadBlockToFile(t *testing.T) { }, { // Specific tx traced - config: &StdTraceConfig{TxHash: txHashs[1]}, + config: &StdTraceConfig{TxHash: txHashes[1]}, want: []string{ `{"pc":0,"op":97,"gas":"0x13498","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH2"} {"pc":3,"op":80,"gas":"0x13495","gasCost":"0x2","memSize":0,"stack":["0x1"],"depth":1,"refund":0,"opName":"POP"} diff --git a/internal/build/archive.go b/internal/build/archive.go index 645921c690..4fbb74eb3f 100644 --- a/internal/build/archive.go +++ b/internal/build/archive.go @@ -272,7 +272,7 @@ func extractFile(arpath string, armode os.FileMode, data io.Reader, dest string) return fmt.Errorf("path %q escapes archive destination", target) } - // Remove the preivously-extracted file if it exists + // Remove the previously-extracted file if it exists if err := os.RemoveAll(target); err != nil { return err } diff --git a/tests/fuzzers/bn256/bn256_fuzz.go b/tests/fuzzers/bn256/bn256_fuzz.go index d53bdbb4b9..542eea46b1 100644 --- a/tests/fuzzers/bn256/bn256_fuzz.go +++ b/tests/fuzzers/bn256/bn256_fuzz.go @@ -184,7 +184,7 @@ func fuzzUnmarshalG1(input []byte) int { } return 1 } else { - panic(fmt.Sprintf("error missmatch: cf: %v g: %v gn: %v", errC, errG, errS)) + panic(fmt.Sprintf("error mismatch: cf: %v g: %v gn: %v", errC, errG, errS)) } } @@ -211,7 +211,7 @@ func fuzzUnmarshalG2(input []byte) int { } return 1 } else { - panic(fmt.Sprintf("error missmatch: cf: %v g: %v gn: %v", errC, errG, errS)) + panic(fmt.Sprintf("error mismatch: cf: %v g: %v gn: %v", errC, errG, errS)) } } diff --git a/trie/iterator_test.go b/trie/iterator_test.go index 3e0ef126be..66e1795bed 100644 --- a/trie/iterator_test.go +++ b/trie/iterator_test.go @@ -1128,7 +1128,7 @@ func TestPrefixIteratorWithDescend(t *testing.T) { // Count nodes at each level nodesVisited := 0 - leafsFound := make(map[string]bool) + leavesFound := make(map[string]bool) // First call with descend=true to enter the "a" subtree if !iter.Next(true) { @@ -1141,20 +1141,20 @@ func TestPrefixIteratorWithDescend(t *testing.T) { for i := 0; iter.Next(descendPattern[i%len(descendPattern)]); i++ { nodesVisited++ if iter.Leaf() { - leafsFound[string(iter.LeafKey())] = true + leavesFound[string(iter.LeafKey())] = true } } // We should still respect the prefix boundary even when skipping prefix := []byte("a") - for key := range leafsFound { + for key := range leavesFound { if !bytes.HasPrefix([]byte(key), prefix) { t.Errorf("Found key outside prefix when using descend=false: %s", key) } } // Should not have found "b" even if we skip some subtrees - if leafsFound["b"] { + if leavesFound["b"] { t.Error("Iterator leaked outside prefix boundary with descend=false") } }) diff --git a/trie/node_test.go b/trie/node_test.go index b4f427ca77..c19458adba 100644 --- a/trie/node_test.go +++ b/trie/node_test.go @@ -283,7 +283,7 @@ func TestNodeDifference(t *testing.T) { t.Fatalf("Expect error, got nil %d", i) } if !test.expErr && err != nil { - t.Fatalf("Unexpect error, %v", err) + t.Fatalf("Unexpected error, %v", err) } if err == nil { if !slices.Equal(indices, test.expIndices) { @@ -342,7 +342,7 @@ func TestReassembleFullNode(t *testing.T) { fn.encode(buf2) enc2 := buf2.ToBytes() if !reflect.DeepEqual(enc2, reassembled) { - t.Fatalf("Unexpeted reassembled node") + t.Fatalf("Unexpected reassembled node") } } @@ -374,7 +374,7 @@ func TestReassembleShortNode(t *testing.T) { ln.encode(buf2) enc2 := buf2.ToBytes() if !reflect.DeepEqual(enc2, reassembled) { - t.Fatalf("Unexpeted reassembled node") + t.Fatalf("Unexpected reassembled node") } } diff --git a/triedb/pathdb/history_index_block_test.go b/triedb/pathdb/history_index_block_test.go index 923ae29348..4de5a41c47 100644 --- a/triedb/pathdb/history_index_block_test.go +++ b/triedb/pathdb/history_index_block_test.go @@ -222,18 +222,18 @@ func testBlockWriterDelete(t *testing.T, bitmapSize int) { } newMax := uint64(i - 1) if bw.desc.max != newMax { - t.Fatalf("Maxmium element is not matched, want: %d, got: %d", newMax, bw.desc.max) + t.Fatalf("Maximum element is not matched, want: %d, got: %d", newMax, bw.desc.max) } } } -func TestBlcokWriterDeleteWithData(t *testing.T) { - testBlcokWriterDeleteWithData(t, 0) - testBlcokWriterDeleteWithData(t, 2) - testBlcokWriterDeleteWithData(t, 34) +func TestBlockWriterDeleteWithData(t *testing.T) { + testBlockWriterDeleteWithData(t, 0) + testBlockWriterDeleteWithData(t, 2) + testBlockWriterDeleteWithData(t, 34) } -func testBlcokWriterDeleteWithData(t *testing.T, bitmapSize int) { +func testBlockWriterDeleteWithData(t *testing.T, bitmapSize int) { elements := []uint64{ 1, 5, 10, 11, 20, } diff --git a/triedb/pathdb/iterator.go b/triedb/pathdb/iterator.go index 2d333dfa1b..9ca56c6995 100644 --- a/triedb/pathdb/iterator.go +++ b/triedb/pathdb/iterator.go @@ -63,7 +63,7 @@ func newDiffAccountIterator(seek common.Hash, accountList []common.Hash, fn load index := sort.Search(len(accountList), func(i int) bool { return bytes.Compare(seek[:], accountList[i][:]) <= 0 }) - // Assemble and returned the already seeked iterator + // Assemble and returned the already sought iterator return &diffAccountIterator{ keys: accountList[index:], loadFn: fn, @@ -206,7 +206,7 @@ func newDiffStorageIterator(account common.Hash, seek common.Hash, storageList [ index := sort.Search(len(storageList), func(i int) bool { return bytes.Compare(seek[:], storageList[i][:]) <= 0 }) - // Assemble and returned the already seeked iterator + // Assemble and returned the already sought iterator return &diffStorageIterator{ account: account, keys: storageList[index:],