MCPcopy Create free account
hub / github.com/CPChain/chain / Next

Method Next

core/state/iterator.go:56–67  ·  view source on GitHub ↗

Next moves the iterator to the next node, returning whether there are any further nodes. In case of an internal error this method returns false and sets the Error field to the encountered failure.

()

Source from the content-addressed store, hash-verified

54// further nodes. In case of an internal error this method returns false and
55// sets the Error field to the encountered failure.
56func (it *NodeIterator) Next() bool {
57 // If the iterator failed previously, don't do anything
58 if it.Error != nil {
59 return false
60 }
61 // Otherwise step forward with the iterator and report any errors
62 if err := it.step(); err != nil {
63 it.Error = err
64 return false
65 }
66 return it.retrieve()
67}
68
69// step moves the iterator to the next entry of the state trie.
70func (it *NodeIterator) step() error {

Callers 6

TestNodeIteratorCoverageFunction · 0.95
checkStateConsistencyFunction · 0.95
stepMethod · 0.45
ForEachStorageMethod · 0.45
RawDumpMethod · 0.45
checkTrieConsistencyFunction · 0.45

Calls 2

stepMethod · 0.95
retrieveMethod · 0.95

Tested by 3

TestNodeIteratorCoverageFunction · 0.76
checkStateConsistencyFunction · 0.76
checkTrieConsistencyFunction · 0.36