all: fix various typos (#29600)
* core: fix typo * rpc: fix typo * snap: fix typo * trie: fix typo * main: fix typo * abi: fix typo * main: fix field comment for basicOp
This commit is contained in:
parent
709e0b3997
commit
b2b0e1da8c
|
@ -25,7 +25,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
// typeWithoutStringer is a alias for the Type type which simply doesn't implement
|
// typeWithoutStringer is an alias for the Type type which simply doesn't implement
|
||||||
// the stringer interface to allow printing type details in the tests below.
|
// the stringer interface to allow printing type details in the tests below.
|
||||||
type typeWithoutStringer Type
|
type typeWithoutStringer Type
|
||||||
|
|
||||||
|
|
|
@ -170,7 +170,7 @@ func (it *insertIterator) current() *types.Header {
|
||||||
return it.chain[it.index].Header()
|
return it.chain[it.index].Header()
|
||||||
}
|
}
|
||||||
|
|
||||||
// first returns the first block in the it.
|
// first returns the first block in it.
|
||||||
func (it *insertIterator) first() *types.Block {
|
func (it *insertIterator) first() *types.Block {
|
||||||
return it.chain[0]
|
return it.chain[0]
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ type nodeIterator struct {
|
||||||
Error error // Failure set in case of an internal error in the iterator
|
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 {
|
func newNodeIterator(state *StateDB) *nodeIterator {
|
||||||
return &nodeIterator{
|
return &nodeIterator{
|
||||||
state: state,
|
state: state,
|
||||||
|
|
|
@ -46,7 +46,7 @@ type generatorStats struct {
|
||||||
storage common.StorageSize // Total account and storage slot size(generation or recovery)
|
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.
|
// from the internally maintained statistics.
|
||||||
func (gs *generatorStats) Log(msg string, root common.Hash, marker []byte) {
|
func (gs *generatorStats) Log(msg string, root common.Hash, marker []byte) {
|
||||||
var ctx []interface{}
|
var ctx []interface{}
|
||||||
|
|
|
@ -68,7 +68,7 @@ func (dl *diffLayer) initBinaryStorageIterator(account common.Hash) Iterator {
|
||||||
parent, ok := dl.parent.(*diffLayer)
|
parent, ok := dl.parent.(*diffLayer)
|
||||||
if !ok {
|
if !ok {
|
||||||
// If the storage in this layer is already destructed, discard all
|
// 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{})
|
a, destructed := dl.StorageIterator(account, common.Hash{})
|
||||||
if destructed {
|
if destructed {
|
||||||
l := &binaryIterator{
|
l := &binaryIterator{
|
||||||
|
@ -92,7 +92,7 @@ func (dl *diffLayer) initBinaryStorageIterator(account common.Hash) Iterator {
|
||||||
return l
|
return l
|
||||||
}
|
}
|
||||||
// If the storage in this layer is already destructed, discard all
|
// 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{})
|
a, destructed := dl.StorageIterator(account, common.Hash{})
|
||||||
if destructed {
|
if destructed {
|
||||||
l := &binaryIterator{
|
l := &binaryIterator{
|
||||||
|
|
|
@ -25,7 +25,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
// weightedIterator is a iterator with an assigned weight. It is used to prioritise
|
// weightedIterator is an iterator with an assigned weight. It is used to prioritise
|
||||||
// which account or storage slot is the correct one if multiple iterators find the
|
// which account or storage slot is the correct one if multiple iterators find the
|
||||||
// same one (modified in multiple consecutive blocks).
|
// same one (modified in multiple consecutive blocks).
|
||||||
type weightedIterator struct {
|
type weightedIterator struct {
|
||||||
|
|
|
@ -835,7 +835,7 @@ func (t *Tree) disklayer() *diskLayer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// diskRoot is a internal helper function to return the disk layer root.
|
// diskRoot is an internal helper function to return the disk layer root.
|
||||||
// The lock of snapTree is assumed to be held already.
|
// The lock of snapTree is assumed to be held already.
|
||||||
func (t *Tree) diskRoot() common.Hash {
|
func (t *Tree) diskRoot() common.Hash {
|
||||||
disklayer := t.disklayer()
|
disklayer := t.disklayer()
|
||||||
|
|
|
@ -376,7 +376,7 @@ func (s *stateObject) updateTrie() (Trie, error) {
|
||||||
// new storage trie root.
|
// new storage trie root.
|
||||||
func (s *stateObject) updateRoot() {
|
func (s *stateObject) updateRoot() {
|
||||||
// Flush cached storage mutations into trie, short circuit if any error
|
// Flush cached storage mutations into trie, short circuit if any error
|
||||||
// is occurred or there is not change in the trie.
|
// is occurred or there is no change in the trie.
|
||||||
tr, err := s.updateTrie()
|
tr, err := s.updateTrie()
|
||||||
if err != nil || tr == nil {
|
if err != nil || tr == nil {
|
||||||
return
|
return
|
||||||
|
|
|
@ -132,7 +132,7 @@ func (t *pathTrie) onTrieNode(path []byte, hash common.Hash, blob []byte) {
|
||||||
//
|
//
|
||||||
// The extension node is detected if its path is the prefix of last committed
|
// The extension node is detected if its path is the prefix of last committed
|
||||||
// one and path gap is larger than one. If the path gap is only one byte,
|
// one and path gap is larger than one. If the path gap is only one byte,
|
||||||
// the current node could either be a full node, or a extension with single
|
// the current node could either be a full node, or an extension with single
|
||||||
// byte key. In either case, no gaps will be left in the path.
|
// byte key. In either case, no gaps will be left in the path.
|
||||||
if t.last != nil && bytes.HasPrefix(t.last, path) && len(t.last)-len(path) > 1 {
|
if t.last != nil && bytes.HasPrefix(t.last, path) && len(t.last)-len(path) > 1 {
|
||||||
for i := len(path) + 1; i < len(t.last); i++ {
|
for i := len(path) + 1; i < len(t.last); i++ {
|
||||||
|
|
|
@ -158,7 +158,7 @@ type op interface {
|
||||||
// basicOp handles basic types bool, uint*, string.
|
// basicOp handles basic types bool, uint*, string.
|
||||||
type basicOp struct {
|
type basicOp struct {
|
||||||
typ types.Type
|
typ types.Type
|
||||||
writeMethod string // calle write the value
|
writeMethod string // EncoderBuffer writer method name
|
||||||
writeArgType types.Type // parameter type of writeMethod
|
writeArgType types.Type // parameter type of writeMethod
|
||||||
decMethod string
|
decMethod string
|
||||||
decResultType types.Type // return type of decMethod
|
decResultType types.Type // return type of decMethod
|
||||||
|
|
|
@ -97,7 +97,7 @@ func NotifierFromContext(ctx context.Context) (*Notifier, bool) {
|
||||||
return n, ok
|
return n, ok
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notifier is tied to a RPC connection that supports subscriptions.
|
// Notifier is tied to an RPC connection that supports subscriptions.
|
||||||
// Server callbacks use the notifier to send notifications.
|
// Server callbacks use the notifier to send notifications.
|
||||||
type Notifier struct {
|
type Notifier struct {
|
||||||
h *handler
|
h *handler
|
||||||
|
|
|
@ -38,7 +38,7 @@ type API struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServerCodec implements reading, parsing and writing RPC messages for the server side of
|
// ServerCodec implements reading, parsing and writing RPC messages for the server side of
|
||||||
// a RPC session. Implementations must be go-routine safe since the codec can be called in
|
// an RPC session. Implementations must be go-routine safe since the codec can be called in
|
||||||
// multiple go-routines concurrently.
|
// multiple go-routines concurrently.
|
||||||
type ServerCodec interface {
|
type ServerCodec interface {
|
||||||
peerInfo() PeerInfo
|
peerInfo() PeerInfo
|
||||||
|
|
|
@ -23,7 +23,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ErrCommitted is returned when a already committed trie is requested for usage.
|
// ErrCommitted is returned when an already committed trie is requested for usage.
|
||||||
// The potential usages can be `Get`, `Update`, `Delete`, `NodeIterator`, `Prove`
|
// The potential usages can be `Get`, `Update`, `Delete`, `NodeIterator`, `Prove`
|
||||||
// and so on.
|
// and so on.
|
||||||
var ErrCommitted = errors.New("trie is already committed")
|
var ErrCommitted = errors.New("trie is already committed")
|
||||||
|
|
|
@ -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)
|
return unset(cld, cld.Children[key[pos]], key, pos+1, removeLeft)
|
||||||
case *shortNode:
|
case *shortNode:
|
||||||
if len(key[pos:]) < len(cld.Key) || !bytes.Equal(cld.Key, key[pos:pos+len(cld.Key)]) {
|
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 removeLeft {
|
||||||
if bytes.Compare(cld.Key, key[pos:]) < 0 {
|
if bytes.Compare(cld.Key, key[pos:]) < 0 {
|
||||||
// The key of fork shortnode is less than the path
|
// The key of fork shortnode is less than the path
|
||||||
|
|
Loading…
Reference in New Issue