Skip to content

Commit 4a4de23

Browse files
gzliudangballet
andauthored
core/state: fix typos and comments (#1206)
Co-authored-by: Guillaume Ballet <[email protected]>
1 parent 18d2dba commit 4a4de23

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

core/state/dump.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
"github.com/XinFinOrg/XDPoSChain/trie"
3030
)
3131

32-
// DumpConfig is a set of options to control what portions of the statewill be
32+
// DumpConfig is a set of options to control what portions of the state will be
3333
// iterated and collected.
3434
type DumpConfig struct {
3535
SkipCode bool

core/state/journal.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ type journalEntry interface {
3333
}
3434

3535
// journal contains the list of state modifications applied since the last state
36-
// commit. These are tracked to be able to be reverted in case of an execution
37-
// exception or revertal request.
36+
// commit. These are tracked to be able to be reverted in the case of an execution
37+
// exception or request for reversal.
3838
type journal struct {
3939
entries []journalEntry // Current changes tracked by the journal
4040
dirties map[common.Address]int // Dirty accounts and the number of changes
4141
}
4242

43-
// newJournal create a new initialized journal.
43+
// newJournal creates a new initialized journal.
4444
func newJournal() *journal {
4545
return &journal{
4646
dirties: make(map[common.Address]int),

core/state/state_object.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ func (s *stateObject) deepCopy(db *StateDB) *stateObject {
386386
// Attribute accessors
387387
//
388388

389-
// Returns the address of the contract/account
389+
// Address returns the address of the contract/account
390390
func (s *stateObject) Address() common.Address {
391391
return s.address
392392
}
@@ -468,7 +468,7 @@ func (s *stateObject) Root() common.Hash {
468468
return s.data.Root
469469
}
470470

471-
// Never called, but must be present to allow stateObject to be used
471+
// Value is never called, but must be present to allow stateObject to be used
472472
// as a vm.Account interface that also satisfies the vm.ContractRef
473473
// interface. Interfaces are awesome.
474474
func (s *stateObject) Value() *big.Int {

core/state/statedb.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ func (s *StateDB) Commit(deleteEmptyObjects bool) (common.Hash, error) {
832832
log.Crit("Failed to commit dirty codes", "error", err)
833833
}
834834
}
835-
// Write the account trie changes, measuing the amount of wasted time
835+
// Write the account trie changes, measuring the amount of wasted time
836836
start := time.Now()
837837

838838
root, accountCommitted, err := s.trie.Commit(func(_ [][]byte, _ []byte, leaf []byte, parent common.Hash, _ []byte) error {

core/state/statedb_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func TestIntermediateLeaks(t *testing.T) {
126126
t.Errorf("entry missing from the transition database: %x -> %x", key, fvalue)
127127
}
128128
if !bytes.Equal(fvalue, tvalue) {
129-
t.Errorf("the value associate key %x is mismatch,: %x in transition database ,%x in final database", key, tvalue, fvalue)
129+
t.Errorf("value mismatch at key %x: %x in transition database, %x in final database", key, tvalue, fvalue)
130130
}
131131
}
132132
it.Release()
@@ -139,7 +139,7 @@ func TestIntermediateLeaks(t *testing.T) {
139139
t.Errorf("extra entry in the transition database: %x -> %x", key, it.Value())
140140
}
141141
if !bytes.Equal(fvalue, tvalue) {
142-
t.Errorf("the value associate key %x is mismatch,: %x in transition database ,%x in final database", key, tvalue, fvalue)
142+
t.Errorf("value mismatch at key %x: %x in transition database, %x in final database", key, tvalue, fvalue)
143143
}
144144
}
145145
}
@@ -528,7 +528,7 @@ func TestStateDBAccessList(t *testing.T) {
528528
t.Fatalf("expected %x to be in access list", address)
529529
}
530530
}
531-
// Check that only the expected addresses are present in the acesslist
531+
// Check that only the expected addresses are present in the access list
532532
for address := range state.accessList.addresses {
533533
if _, exist := addressMap[address]; !exist {
534534
t.Fatalf("extra address %x in access list", address)

0 commit comments

Comments
 (0)