Skip to content

Commit da9d464

Browse files
committed
all: fix bad usage of an and replace with a
1 parent c135de7 commit da9d464

File tree

26 files changed

+29
-29
lines changed

26 files changed

+29
-29
lines changed

accounts/abi/bind/template.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ var (
114114
115115
{{$structs := .Structs}}
116116
{{range $structs}}
117-
// {{.Name}} is an auto generated low-level Go binding around an user-defined struct.
117+
// {{.Name}} is an auto generated low-level Go binding around a user-defined struct.
118118
type {{.Name}} struct {
119119
{{range $field := .Fields}}
120120
{{$field.Name}} {{$field.Type}}{{end}}

accounts/usbwallet/wallet.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ func (w *wallet) selfDerive() {
442442

443443
// Contains implements accounts.Wallet, returning whether a particular account is
444444
// or is not pinned into this wallet instance. Although we could attempt to resolve
445-
// unpinned accounts, that would be an non-negligible hardware operation.
445+
// unpinned accounts, that would be a non-negligible hardware operation.
446446
func (w *wallet) Contains(account accounts.Account) bool {
447447
w.stateLock.RLock()
448448
defer w.stateLock.RUnlock()

beacon/types/header.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ type headerMarshaling struct {
6565

6666
// Hash calculates the block root of the header.
6767
//
68-
// TODO(zsfelfoldi): Remove this when an SSZ encoder lands.
68+
// TODO(zsfelfoldi): Remove this when a SSZ encoder lands.
6969
func (h *Header) Hash() common.Hash {
7070
var values [16]merkle.Value // values corresponding to indices 8 to 15 of the beacon header tree
7171
binary.LittleEndian.PutUint64(values[headerIndexSlot][:8], h.Slot)

cmd/clef/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ var (
129129
stdiouiFlag = &cli.BoolFlag{
130130
Name: "stdio-ui",
131131
Usage: "Use STDIN/STDOUT as a channel for an external UI. " +
132-
"This means that an STDIN/STDOUT is used for RPC-communication with a e.g. a graphical user " +
132+
"This means that a STDIN/STDOUT is used for RPC-communication with a e.g. a graphical user " +
133133
"interface, and can be used when Clef is started by an external process.",
134134
}
135135
testFlag = &cli.BoolFlag{

cmd/evm/internal/t8ntool/tracewriter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"github.com/ava-labs/libevm/log"
2828
)
2929

30-
// traceWriter is an vm.EVMLogger which also holds an inner logger/tracer.
30+
// traceWriter is a vm.EVMLogger which also holds an inner logger/tracer.
3131
// When the TxEnd event happens, the inner tracer result is written to the file, and
3232
// the file is closed.
3333
type traceWriter struct {

common/lru/lru.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type Cache[K comparable, V any] struct {
2525
mu sync.Mutex
2626
}
2727

28-
// NewCache creates an LRU cache.
28+
// NewCache creates a LRU cache.
2929
func NewCache[K comparable, V any](capacity int) *Cache[K, V] {
3030
return &Cache[K, V]{cache: NewBasicLRU[K, V](capacity)}
3131
}

consensus/clique/clique.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ var (
114114
// errInvalidMixDigest is returned if a block's mix digest is non-zero.
115115
errInvalidMixDigest = errors.New("non-zero mix digest")
116116

117-
// errInvalidUncleHash is returned if a block contains an non-empty uncle list.
117+
// errInvalidUncleHash is returned if a block contains a non-empty uncle list.
118118
errInvalidUncleHash = errors.New("non empty uncle hash")
119119

120120
// errInvalidDifficulty is returned if the difficulty of a block neither 1 or 2.

core/rawdb/accessors_snapshot.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,20 @@ func DeleteAccountSnapshot(db ethdb.KeyValueWriter, hash common.Hash) {
9292
}
9393
}
9494

95-
// ReadStorageSnapshot retrieves the snapshot entry of an storage trie leaf.
95+
// ReadStorageSnapshot retrieves the snapshot entry of a storage trie leaf.
9696
func ReadStorageSnapshot(db ethdb.KeyValueReader, accountHash, storageHash common.Hash) []byte {
9797
data, _ := db.Get(storageSnapshotKey(accountHash, storageHash))
9898
return data
9999
}
100100

101-
// WriteStorageSnapshot stores the snapshot entry of an storage trie leaf.
101+
// WriteStorageSnapshot stores the snapshot entry of a storage trie leaf.
102102
func WriteStorageSnapshot(db ethdb.KeyValueWriter, accountHash, storageHash common.Hash, entry []byte) {
103103
if err := db.Put(storageSnapshotKey(accountHash, storageHash), entry); err != nil {
104104
log.Crit("Failed to store storage snapshot", "err", err)
105105
}
106106
}
107107

108-
// DeleteStorageSnapshot removes the snapshot entry of an storage trie leaf.
108+
// DeleteStorageSnapshot removes the snapshot entry of a storage trie leaf.
109109
func DeleteStorageSnapshot(db ethdb.KeyValueWriter, accountHash, storageHash common.Hash) {
110110
if err := db.Delete(storageSnapshotKey(accountHash, storageHash)); err != nil {
111111
log.Crit("Failed to delete storage snapshot", "err", err)

core/rawdb/freezer_table.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ func (t *freezerTable) repair() error {
239239
firstIndex.unmarshalBinary(buffer)
240240

241241
// Assign the tail fields with the first stored index.
242-
// The total removed items is represented with an uint32,
242+
// The total removed items is represented with a uint32,
243243
// which is not enough in theory but enough in practice.
244244
// TODO: use uint64 to represent total removed items.
245245
t.tailId = firstIndex.filenum

core/state/iterator.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ type nodeIterator struct {
4646
Error error // Failure set in case of an internal error in the iterator
4747
}
4848

49-
// newNodeIterator creates an post-order state node iterator.
49+
// newNodeIterator creates a post-order state node iterator.
5050
func newNodeIterator(state *StateDB) *nodeIterator {
5151
return &nodeIterator{
5252
state: state,

core/state/snapshot/context.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ type generatorStats struct {
4646
storage common.StorageSize // Total account and storage slot size(generation or recovery)
4747
}
4848

49-
// Log creates an contextual log with the given message and the context pulled
49+
// Log creates a contextual log with the given message and the context pulled
5050
// from the internally maintained statistics.
5151
func (gs *generatorStats) Log(msg string, root common.Hash, marker []byte) {
5252
var ctx []interface{}

core/state/snapshot/iterator_binary.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func (dl *diffLayer) initBinaryStorageIterator(account common.Hash) Iterator {
6868
parent, ok := dl.parent.(*diffLayer)
6969
if !ok {
7070
// If the storage in this layer is already destructed, discard all
71-
// deeper layers but still return an valid single-branch iterator.
71+
// deeper layers but still return a valid single-branch iterator.
7272
a, destructed := dl.StorageIterator(account, common.Hash{})
7373
if destructed {
7474
l := &binaryIterator{
@@ -92,7 +92,7 @@ func (dl *diffLayer) initBinaryStorageIterator(account common.Hash) Iterator {
9292
return l
9393
}
9494
// If the storage in this layer is already destructed, discard all
95-
// deeper layers but still return an valid single-branch iterator.
95+
// deeper layers but still return a valid single-branch iterator.
9696
a, destructed := dl.StorageIterator(account, common.Hash{})
9797
if destructed {
9898
l := &binaryIterator{

core/state/trie_prefetcher.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func (p *triePrefetcher) used(owner common.Hash, root common.Hash, used [][]byte
203203
}
204204
}
205205

206-
// trieID returns an unique trie identifier consists the trie owner and root hash.
206+
// trieID returns a unique trie identifier consists the trie owner and root hash.
207207
func (p *triePrefetcher) trieID(owner common.Hash, root common.Hash) string {
208208
trieID := make([]byte, common.HashLength*2)
209209
copy(trieID, owner.Bytes())

core/vm/contracts.libevm_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ func TestPrecompileMakeCall(t *testing.T) {
702702
func TestPrecompileCallWithTracer(t *testing.T) {
703703
// The native pre-state tracer, when logging storage, assumes an invariant
704704
// that is broken by a precompile calling another contract. This is a test
705-
// of the fix, ensuring that an SLOADed value is properly handled by the
705+
// of the fix, ensuring that a SLOADed value is properly handled by the
706706
// tracer.
707707

708708
rng := ethtest.NewPseudoRand(42 * 142857)

crypto/secp256k1/curve.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ func (BitCurve *BitCurve) Marshal(x, y *big.Int) []byte {
262262
return ret
263263
}
264264

265-
// Unmarshal converts a point, serialised by Marshal, into an x, y pair. On
265+
// Unmarshal converts a point, serialised by Marshal, into a x, y pair. On
266266
// error, x = nil.
267267
func (BitCurve *BitCurve) Unmarshal(data []byte) (x, y *big.Int) {
268268
byteLen := (BitCurve.BitSize + 7) >> 3

crypto/secp256k1/libsecp256k1/src/scalar.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static int secp256k1_scalar_is_zero(const secp256k1_scalar *a);
7272
/** Check whether a scalar equals one. */
7373
static int secp256k1_scalar_is_one(const secp256k1_scalar *a);
7474

75-
/** Check whether a scalar, considered as an nonnegative integer, is even. */
75+
/** Check whether a scalar, considered as a nonnegative integer, is even. */
7676
static int secp256k1_scalar_is_even(const secp256k1_scalar *a);
7777

7878
/** Check whether a scalar is higher than the group order divided by 2. */

eth/catalyst/queue.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func (q *payloadQueue) has(id engine.PayloadID) bool {
107107
return false
108108
}
109109

110-
// headerQueueItem represents an hash->header tuple to store until it's retrieved
110+
// headerQueueItem represents a hash->header tuple to store until it's retrieved
111111
// or evicted.
112112
type headerQueueItem struct {
113113
hash common.Hash

eth/fetcher/block_fetcher_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ func verifyFetchingEvent(t *testing.T, fetching chan []common.Hash, arrive bool)
286286
}
287287
}
288288

289-
// verifyCompletingEvent verifies that one single event arrive on an completing channel.
289+
// verifyCompletingEvent verifies that one single event arrive on a completing channel.
290290
func verifyCompletingEvent(t *testing.T, completing chan []common.Hash, arrive bool) {
291291
t.Helper()
292292

eth/fetcher/tx_fetcher.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ type TxFetcher struct {
171171

172172
// Stage 1: Waiting lists for newly discovered transactions that might be
173173
// broadcast without needing explicit request/reply round trips.
174-
waitlist map[common.Hash]map[string]struct{} // Transactions waiting for an potential broadcast
174+
waitlist map[common.Hash]map[string]struct{} // Transactions waiting for a potential broadcast
175175
waittime map[common.Hash]mclock.AbsTime // Timestamps when transactions were added to the waitlist
176176
waitslots map[string]map[common.Hash]*txMetadata // Waiting announcements grouped by peer (DoS protection)
177177

eth/fetcher/tx_fetcher_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ func TestTransactionFetcherFailedRescheduling(t *testing.T) {
562562
"A": {{0x01}, {0x02}},
563563
},
564564
},
565-
// While the original peer is stuck in the request, push in an second
565+
// While the original peer is stuck in the request, push in a second
566566
// data source.
567567
doTxNotify{peer: "B", hashes: []common.Hash{{0x02}}},
568568
isWaiting(nil),

eth/protocols/snap/protocol.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func (p *AccountRangePacket) Unpack() ([]common.Hash, [][]byte, error) {
113113
return hashes, accounts, nil
114114
}
115115

116-
// GetStorageRangesPacket represents an storage slot query.
116+
// GetStorageRangesPacket represents a storage slot query.
117117
type GetStorageRangesPacket struct {
118118
ID uint64 // Request ID to match up responses with
119119
Root common.Hash // Root hash of the account trie to serve

ethstats/ethstats.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ func (s *Service) readLoop(conn *connWrapper) {
419419
if !ok {
420420
log.Warn("Invalid stats history request", "msg", msg["emit"][1])
421421
select {
422-
case s.histCh <- nil: // Treat it as an no indexes request
422+
case s.histCh <- nil: // Treat it as a no indexes request
423423
default:
424424
}
425425
continue

internal/ethapi/api.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ func (s *BlockChainAPI) CreateAccessList(ctx context.Context, args TransactionAr
14781478

14791479
// AccessList creates an access list for the given transaction.
14801480
// If the accesslist creation fails an error is returned.
1481-
// If the transaction itself fails, an vmErr is returned.
1481+
// If the transaction itself fails, a vmErr is returned.
14821482
func AccessList(ctx context.Context, b Backend, blockNrOrHash rpc.BlockNumberOrHash, args TransactionArgs) (acl types.AccessList, gasUsed uint64, vmErr error, err error) {
14831483
// Retrieve the execution context
14841484
db, header, err := b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash)

rpc/testservice_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func (s *notificationTestService) SomeSubscription(ctx context.Context, n, val i
185185
return nil, ErrNotificationsUnsupported
186186
}
187187

188-
// By explicitly creating an subscription we make sure that the subscription id is send
188+
// By explicitly creating a subscription we make sure that the subscription id is send
189189
// back to the client before the first subscription.Notify is called. Otherwise the
190190
// events might be send before the response for the *_subscribe method.
191191
subscription := notifier.CreateSubscription()

trie/proof.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ func unset(parent node, child node, key []byte, pos int, removeLeft bool) error
372372
return unset(cld, cld.Children[key[pos]], key, pos+1, removeLeft)
373373
case *shortNode:
374374
if len(key[pos:]) < len(cld.Key) || !bytes.Equal(cld.Key, key[pos:pos+len(cld.Key)]) {
375-
// Find the fork point, it's an non-existent branch.
375+
// Find the fork point, it's a non-existent branch.
376376
if removeLeft {
377377
if bytes.Compare(cld.Key, key[pos:]) < 0 {
378378
// The key of fork shortnode is less than the path

trie/trie_reader.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func newEmptyReader() *trieReader {
5454
}
5555

5656
// node retrieves the rlp-encoded trie node with the provided trie node
57-
// information. An MissingNodeError will be returned in case the node is
57+
// information. A MissingNodeError will be returned in case the node is
5858
// not found or any error is encountered.
5959
func (r *trieReader) node(path []byte, hash common.Hash) ([]byte, error) {
6060
// Perform the logics in tests for preventing trie node access.

0 commit comments

Comments
 (0)