core/state: fix typos and comments (#1206)

Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
This commit is contained in:
Daniel Liu 2025-08-26 15:22:37 +08:00 committed by GitHub
parent 18d2dbad89
commit 4a4de2319f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 10 additions and 10 deletions

View file

@ -29,7 +29,7 @@ import (
"github.com/XinFinOrg/XDPoSChain/trie"
)
// DumpConfig is a set of options to control what portions of the statewill be
// DumpConfig is a set of options to control what portions of the state will be
// iterated and collected.
type DumpConfig struct {
SkipCode bool

View file

@ -33,14 +33,14 @@ type journalEntry interface {
}
// journal contains the list of state modifications applied since the last state
// commit. These are tracked to be able to be reverted in case of an execution
// exception or revertal request.
// commit. These are tracked to be able to be reverted in the case of an execution
// exception or request for reversal.
type journal struct {
entries []journalEntry // Current changes tracked by the journal
dirties map[common.Address]int // Dirty accounts and the number of changes
}
// newJournal create a new initialized journal.
// newJournal creates a new initialized journal.
func newJournal() *journal {
return &journal{
dirties: make(map[common.Address]int),

View file

@ -386,7 +386,7 @@ func (s *stateObject) deepCopy(db *StateDB) *stateObject {
// Attribute accessors
//
// Returns the address of the contract/account
// Address returns the address of the contract/account
func (s *stateObject) Address() common.Address {
return s.address
}
@ -468,7 +468,7 @@ func (s *stateObject) Root() common.Hash {
return s.data.Root
}
// Never called, but must be present to allow stateObject to be used
// Value is never called, but must be present to allow stateObject to be used
// as a vm.Account interface that also satisfies the vm.ContractRef
// interface. Interfaces are awesome.
func (s *stateObject) Value() *big.Int {

View file

@ -832,7 +832,7 @@ func (s *StateDB) Commit(deleteEmptyObjects bool) (common.Hash, error) {
log.Crit("Failed to commit dirty codes", "error", err)
}
}
// Write the account trie changes, measuing the amount of wasted time
// Write the account trie changes, measuring the amount of wasted time
start := time.Now()
root, accountCommitted, err := s.trie.Commit(func(_ [][]byte, _ []byte, leaf []byte, parent common.Hash, _ []byte) error {

View file

@ -126,7 +126,7 @@ func TestIntermediateLeaks(t *testing.T) {
t.Errorf("entry missing from the transition database: %x -> %x", key, fvalue)
}
if !bytes.Equal(fvalue, tvalue) {
t.Errorf("the value associate key %x is mismatch,: %x in transition database ,%x in final database", key, tvalue, fvalue)
t.Errorf("value mismatch at key %x: %x in transition database, %x in final database", key, tvalue, fvalue)
}
}
it.Release()
@ -139,7 +139,7 @@ func TestIntermediateLeaks(t *testing.T) {
t.Errorf("extra entry in the transition database: %x -> %x", key, it.Value())
}
if !bytes.Equal(fvalue, tvalue) {
t.Errorf("the value associate key %x is mismatch,: %x in transition database ,%x in final database", key, tvalue, fvalue)
t.Errorf("value mismatch at key %x: %x in transition database, %x in final database", key, tvalue, fvalue)
}
}
}
@ -528,7 +528,7 @@ func TestStateDBAccessList(t *testing.T) {
t.Fatalf("expected %x to be in access list", address)
}
}
// Check that only the expected addresses are present in the acesslist
// Check that only the expected addresses are present in the access list
for address := range state.accessList.addresses {
if _, exist := addressMap[address]; !exist {
t.Fatalf("extra address %x in access list", address)