@@ -58,7 +58,7 @@ func (n *proofList) Delete(key []byte) error {
58
58
panic ("not supported" )
59
59
}
60
60
61
- // StateDBs within the ethereum protocol are used to store anything
61
+ // StateDB structs within the ethereum protocol are used to store anything
62
62
// within the merkle trie. StateDBs take care of caching and storing
63
63
// nested states. It's the general query interface to retrieve:
64
64
// * Contracts
@@ -115,7 +115,7 @@ type StateDB struct {
115
115
SnapshotCommits time.Duration
116
116
}
117
117
118
- // Create a new state from a given trie.
118
+ // New creates a new state from a given trie.
119
119
func New (root common.Hash , db Database , snaps * snapshot.Tree ) (* StateDB , error ) {
120
120
tr , err := db .OpenTrie (root )
121
121
if err != nil {
@@ -250,7 +250,7 @@ func (s *StateDB) Empty(addr common.Address) bool {
250
250
return so == nil || so .empty ()
251
251
}
252
252
253
- // Retrieve the balance from the given address or 0 if object not found
253
+ // GetBalance retrieves the balance from the given address or 0 if object not found
254
254
func (s * StateDB ) GetBalance (addr common.Address ) * big.Int {
255
255
stateObject := s .getStateObject (addr )
256
256
if stateObject != nil {
@@ -318,7 +318,7 @@ func (s *StateDB) GetProof(a common.Address) ([][]byte, error) {
318
318
return [][]byte (proof ), err
319
319
}
320
320
321
- // GetProof returns the StorageProof for given key
321
+ // GetStorageProof returns the StorageProof for given key
322
322
func (s * StateDB ) GetStorageProof (a common.Address , key common.Hash ) ([][]byte , error ) {
323
323
var proof proofList
324
324
trie := s .StorageTrie (a )
@@ -560,7 +560,7 @@ func (s *StateDB) setStateObject(object *stateObject) {
560
560
s .stateObjects [object .Address ()] = object
561
561
}
562
562
563
- // Retrieve a state object or create a new state object if nil.
563
+ // GetOrNewStateObject retrieves a state object or create a new state object if nil.
564
564
func (s * StateDB ) GetOrNewStateObject (addr common.Address ) * stateObject {
565
565
stateObject := s .getStateObject (addr )
566
566
if stateObject == nil {
0 commit comments