From 0a5102881975120b5d321e40c325edba778314d8 Mon Sep 17 00:00:00 2001 From: persmor <166146971+persmor@users.noreply.github.com> Date: Tue, 16 Apr 2024 21:44:00 +0900 Subject: [PATCH] all: fix various typos (#29542) * core/rawdb: fix typos * accounts/abi: fix typos * metrics: fix typo * beacon: fix typo * crypto: fix typo * rpc: fix typo * rpc: fix typo --- accounts/abi/reflect.go | 4 ++-- beacon/light/request/scheduler.go | 2 +- core/rawdb/accessors_snapshot.go | 6 +++--- crypto/secp256k1/secp256_test.go | 2 +- metrics/sample.go | 2 +- rpc/server.go | 2 +- rpc/service.go | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/accounts/abi/reflect.go b/accounts/abi/reflect.go index 1863e5bb7d..729ca93c54 100644 --- a/accounts/abi/reflect.go +++ b/accounts/abi/reflect.go @@ -24,7 +24,7 @@ import ( "strings" ) -// ConvertType converts an interface of a runtime type into a interface of the +// ConvertType converts an interface of a runtime type into an interface of the // given type, e.g. turn this code: // // var fields []reflect.StructField @@ -33,7 +33,7 @@ import ( // Name: "X", // Type: reflect.TypeOf(new(big.Int)), // Tag: reflect.StructTag("json:\"" + "x" + "\""), -// } +// }) // // into: // diff --git a/beacon/light/request/scheduler.go b/beacon/light/request/scheduler.go index 20f811900e..4b8f6ce570 100644 --- a/beacon/light/request/scheduler.go +++ b/beacon/light/request/scheduler.go @@ -65,7 +65,7 @@ type Requester interface { // allow new operations. type Scheduler struct { lock sync.Mutex - modules []Module // first has highest priority + modules []Module // first has the highest priority names map[Module]string servers map[server]struct{} targets map[targetData]uint64 diff --git a/core/rawdb/accessors_snapshot.go b/core/rawdb/accessors_snapshot.go index 3c82b3f731..5cea581fcd 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/crypto/secp256k1/secp256_test.go b/crypto/secp256k1/secp256_test.go index 8bb870fa18..4827cc5b25 100644 --- a/crypto/secp256k1/secp256_test.go +++ b/crypto/secp256k1/secp256_test.go @@ -48,7 +48,7 @@ func randSig() []byte { } // tests for malleability -// highest bit of signature ECDSA s value must be 0, in the 33th byte +// the highest bit of signature ECDSA s value must be 0, in the 33th byte func compactSigCheck(t *testing.T, sig []byte) { var b = int(sig[32]) if b < 0 { diff --git a/metrics/sample.go b/metrics/sample.go index e4735fb6ff..17b2bee28f 100644 --- a/metrics/sample.go +++ b/metrics/sample.go @@ -153,7 +153,7 @@ func SamplePercentile(values []int64, p float64) float64 { } // CalculatePercentiles returns a slice of arbitrary percentiles of the slice of -// int64. This method returns interpolated results, so e.g if there are only two +// int64. This method returns interpolated results, so e.g. if there are only two // values, [0, 10], a 50% percentile will land between them. // // Note: As a side-effect, this method will also sort the slice of values. diff --git a/rpc/server.go b/rpc/server.go index e2f9120aa2..52866004f8 100644 --- a/rpc/server.go +++ b/rpc/server.go @@ -88,7 +88,7 @@ func (s *Server) SetHTTPBodyLimit(limit int) { } // RegisterName creates a service for the given receiver type under the given name. When no -// methods on the given receiver match the criteria to be either a RPC method or a +// methods on the given receiver match the criteria to be either an RPC method or a // subscription an error is returned. Otherwise a new service is created and added to the // service collection this server provides to clients. func (s *Server) RegisterName(name string, receiver interface{}) error { diff --git a/rpc/service.go b/rpc/service.go index c13b3c0af0..d50090e9fb 100644 --- a/rpc/service.go +++ b/rpc/service.go @@ -110,7 +110,7 @@ func (r *serviceRegistry) subscription(service, name string) *callback { } // suitableCallbacks iterates over the methods of the given type. It determines if a method -// satisfies the criteria for a RPC callback or a subscription callback and adds it to the +// satisfies the criteria for an RPC callback or a subscription callback and adds it to the // collection of callbacks. See server documentation for a summary of these criteria. func suitableCallbacks(receiver reflect.Value) map[string]*callback { typ := receiver.Type()