diff --git a/core/state/dump.go b/core/state/dump.go index a3cbbbb1dc..7e7b494238 100644 --- a/core/state/dump.go +++ b/core/state/dump.go @@ -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 diff --git a/core/state/journal.go b/core/state/journal.go index bcade2f456..19b57a9e4d 100644 --- a/core/state/journal.go +++ b/core/state/journal.go @@ -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), diff --git a/core/state/state_object.go b/core/state/state_object.go index 2c27caf3e8..8accaed408 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -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 { diff --git a/core/state/statedb.go b/core/state/statedb.go index 0e607bde34..9a86ef0e26 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -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 { diff --git a/core/state/statedb_test.go b/core/state/statedb_test.go index ac818a23b4..4349a95465 100644 --- a/core/state/statedb_test.go +++ b/core/state/statedb_test.go @@ -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)