Skip to content

Commit 1f6e639

Browse files
authored
core: fix typos (#28218)
* fix(core/txpool): fix typos * core/asm: fix typos * core/bloombits: fix typos * core/rawdb: fix typos
1 parent f988b23 commit 1f6e639

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

core/asm/asm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type instructionIterator struct {
3434
started bool
3535
}
3636

37-
// NewInstructionIterator create a new instruction iterator.
37+
// NewInstructionIterator creates a new instruction iterator.
3838
func NewInstructionIterator(code []byte) *instructionIterator {
3939
it := new(instructionIterator)
4040
it.code = code

core/asm/compiler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func NewCompiler(debug bool) *Compiler {
4949
}
5050
}
5151

52-
// Feed feeds tokens in to ch and are interpreted by
52+
// Feed feeds tokens into ch and are interpreted by
5353
// the compiler.
5454
//
5555
// feed is the first pass in the compile stage as it collects the used labels in the

core/asm/lex_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ func TestLexer(t *testing.T) {
7272
input: "@label123",
7373
tokens: []token{{typ: lineStart}, {typ: label, text: "label123"}, {typ: eof}},
7474
},
75-
// comment after label
75+
// Comment after label
7676
{
7777
input: "@label123 ;; comment",
7878
tokens: []token{{typ: lineStart}, {typ: label, text: "label123"}, {typ: eof}},
7979
},
80-
// comment after instruction
80+
// Comment after instruction
8181
{
8282
input: "push 3 ;; comment\nadd",
8383
tokens: []token{{typ: lineStart}, {typ: element, text: "push"}, {typ: number, text: "3"}, {typ: lineEnd, text: "\n"}, {typ: lineStart, lineno: 1}, {typ: element, lineno: 1, text: "add"}, {typ: eof, lineno: 1}},

core/bloombits/matcher.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ type partialMatches struct {
5858
// bit with the given number of fetch elements, or a response for such a request.
5959
// It can also have the actual results set to be used as a delivery data struct.
6060
//
61-
// The contest and error fields are used by the light client to terminate matching
61+
// The context and error fields are used by the light client to terminate matching
6262
// early if an error is encountered on some path of the pipeline.
6363
type Retrieval struct {
6464
Bit uint
@@ -389,7 +389,7 @@ func (m *Matcher) distributor(dist chan *request, session *MatcherSession) {
389389
shutdown = session.quit // Shutdown request channel, will gracefully wait for pending requests
390390
)
391391

392-
// assign is a helper method fo try to assign a pending bit an actively
392+
// assign is a helper method to try to assign a pending bit an actively
393393
// listening servicer, or schedule it up for later when one arrives.
394394
assign := func(bit uint) {
395395
select {

core/bloombits/matcher_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func TestMatcherRandom(t *testing.T) {
8585
}
8686

8787
// Tests that the matcher can properly find matches if the starting block is
88-
// shifter from a multiple of 8. This is needed to cover an optimisation with
88+
// shifted from a multiple of 8. This is needed to cover an optimisation with
8989
// bitset matching https://github.com/ethereum/go-ethereum/issues/15309.
9090
func TestMatcherShifted(t *testing.T) {
9191
t.Parallel()
@@ -106,7 +106,7 @@ func TestWildcardMatcher(t *testing.T) {
106106
testMatcherBothModes(t, nil, 0, 10000, 0)
107107
}
108108

109-
// makeRandomIndexes generates a random filter system, composed on multiple filter
109+
// makeRandomIndexes generates a random filter system, composed of multiple filter
110110
// criteria, each having one bloom list component for the address and arbitrarily
111111
// many topic bloom list components.
112112
func makeRandomIndexes(lengths []int, max int) [][]bloomIndexes {

core/rawdb/chain_freezer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func (f *chainFreezer) freeze(db ethdb.KeyValueStore) {
200200
}
201201
batch.Reset()
202202

203-
// Step into the future and delete and dangling side chains
203+
// Step into the future and delete any dangling side chains
204204
if frozen > 0 {
205205
tip := frozen
206206
for len(dangling) > 0 {

core/rawdb/database.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import (
3434
"github.com/olekukonko/tablewriter"
3535
)
3636

37-
// freezerdb is a database wrapper that enabled freezer data retrievals.
37+
// freezerdb is a database wrapper that enables freezer data retrievals.
3838
type freezerdb struct {
3939
ancientRoot string
4040
ethdb.KeyValueStore
@@ -141,7 +141,7 @@ func (db *nofreezedb) ReadAncients(fn func(reader ethdb.AncientReaderOp) error)
141141
// Unlike other ancient-related methods, this method does not return
142142
// errNotSupported when invoked.
143143
// The reason for this is that the caller might want to do several things:
144-
// 1. Check if something is in freezer,
144+
// 1. Check if something is in the freezer,
145145
// 2. If not, check leveldb.
146146
//
147147
// This will work, since the ancient-checks inside 'fn' will return errors,
@@ -209,7 +209,7 @@ func NewDatabaseWithFreezer(db ethdb.KeyValueStore, ancient string, namespace st
209209
// of the freezer and database. Ensure that we don't shoot ourselves in the foot
210210
// by serving up conflicting data, leading to both datastores getting corrupted.
211211
//
212-
// - If both the freezer and key-value store is empty (no genesis), we just
212+
// - If both the freezer and key-value store are empty (no genesis), we just
213213
// initialized a new empty freezer, so everything's fine.
214214
// - If the key-value store is empty, but the freezer is not, we need to make
215215
// sure the user's genesis matches the freezer. That will be checked in the
@@ -218,7 +218,7 @@ func NewDatabaseWithFreezer(db ethdb.KeyValueStore, ancient string, namespace st
218218
// - If neither the key-value store nor the freezer is empty, cross validate
219219
// the genesis hashes to make sure they are compatible. If they are, also
220220
// ensure that there's no gap between the freezer and subsequently leveldb.
221-
// - If the key-value store is not empty, but the freezer is we might just be
221+
// - If the key-value store is not empty, but the freezer is, we might just be
222222
// upgrading to the freezer release, or we might have had a small chain and
223223
// not frozen anything yet. Ensure that no blocks are missing yet from the
224224
// key-value store, since that would mean we already had an old freezer.
@@ -634,7 +634,7 @@ func printChainMetadata(db ethdb.KeyValueStore) {
634634
fmt.Fprintf(os.Stderr, "\n\n")
635635
}
636636

637-
// ReadChainMetadata returns a set of key/value pairs that contains informatin
637+
// ReadChainMetadata returns a set of key/value pairs that contains information
638638
// about the database chain status. This can be used for diagnostic purposes
639639
// when investigating the state of the node.
640640
func ReadChainMetadata(db ethdb.KeyValueStore) [][]string {

core/rawdb/databases_64bit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/ethereum/go-ethereum/ethdb/pebble"
2424
)
2525

26-
// Pebble is unsuported on 32bit architecture
26+
// Pebble is unsupported on 32bit architecture
2727
const PebbleEnabled = true
2828

2929
// NewPebbleDBDatabase creates a persistent key-value database without a freezer

core/rawdb/table.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ func (b *tableBatch) Put(key, value []byte) error {
219219
return b.batch.Put(append([]byte(b.prefix), key...), value)
220220
}
221221

222-
// Delete inserts the a key removal into the batch for later committing.
222+
// Delete inserts a key removal into the batch for later committing.
223223
func (b *tableBatch) Delete(key []byte) error {
224224
return b.batch.Delete(append([]byte(b.prefix), key...))
225225
}

0 commit comments

Comments
 (0)