Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
7577b9c2
Unverified
Commit
7577b9c2
authored
2 years ago
by
Guillaume Ballet
Committed by
GitHub
2 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/state: unexport NodeIterator (#27239)
parent
d17ec0ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
iterator.go
core/state/iterator.go
+8
-8
iterator_test.go
core/state/iterator_test.go
+1
-1
sync_test.go
core/state/sync_test.go
+1
-1
No files found.
core/state/iterator.go
View file @
7577b9c2
...
...
@@ -26,9 +26,9 @@ import (
"github.com/ethereum/go-ethereum/trie"
)
//
N
odeIterator is an iterator to traverse the entire state trie post-order,
//
n
odeIterator is an iterator to traverse the entire state trie post-order,
// including all of the contract code and contract state tries.
type
N
odeIterator
struct
{
type
n
odeIterator
struct
{
state
*
StateDB
// State being iterated
stateIt
trie
.
NodeIterator
// Primary iterator for the global state trie
...
...
@@ -44,9 +44,9 @@ type NodeIterator struct {
Error
error
// Failure set in case of an internal error in the iterator
}
//
N
ewNodeIterator creates an post-order state node iterator.
func
NewNodeIterator
(
state
*
StateDB
)
*
N
odeIterator
{
return
&
N
odeIterator
{
//
n
ewNodeIterator creates an post-order state node iterator.
func
newNodeIterator
(
state
*
StateDB
)
*
n
odeIterator
{
return
&
n
odeIterator
{
state
:
state
,
}
}
...
...
@@ -54,7 +54,7 @@ func NewNodeIterator(state *StateDB) *NodeIterator {
// 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.
func
(
it
*
N
odeIterator
)
Next
()
bool
{
func
(
it
*
n
odeIterator
)
Next
()
bool
{
// If the iterator failed previously, don't do anything
if
it
.
Error
!=
nil
{
return
false
...
...
@@ -68,7 +68,7 @@ func (it *NodeIterator) Next() bool {
}
// step moves the iterator to the next entry of the state trie.
func
(
it
*
N
odeIterator
)
step
()
error
{
func
(
it
*
n
odeIterator
)
step
()
error
{
// Abort if we reached the end of the iteration
if
it
.
state
==
nil
{
return
nil
...
...
@@ -131,7 +131,7 @@ func (it *NodeIterator) step() error {
// retrieve pulls and caches the current state entry the iterator is traversing.
// The method returns whether there are any more data left for inspection.
func
(
it
*
N
odeIterator
)
retrieve
()
bool
{
func
(
it
*
n
odeIterator
)
retrieve
()
bool
{
// Clear out any previously set values
it
.
Hash
=
common
.
Hash
{}
...
...
This diff is collapsed.
Click to expand it.
core/state/iterator_test.go
View file @
7577b9c2
...
...
@@ -36,7 +36,7 @@ func TestNodeIteratorCoverage(t *testing.T) {
}
// Gather all the node hashes found by the iterator
hashes
:=
make
(
map
[
common
.
Hash
]
struct
{})
for
it
:=
N
ewNodeIterator
(
state
);
it
.
Next
();
{
for
it
:=
n
ewNodeIterator
(
state
);
it
.
Next
();
{
if
it
.
Hash
!=
(
common
.
Hash
{})
{
hashes
[
it
.
Hash
]
=
struct
{}{}
}
...
...
This diff is collapsed.
Click to expand it.
core/state/sync_test.go
View file @
7577b9c2
...
...
@@ -125,7 +125,7 @@ func checkStateConsistency(db ethdb.Database, root common.Hash) error {
if
err
!=
nil
{
return
err
}
it
:=
N
ewNodeIterator
(
state
)
it
:=
n
ewNodeIterator
(
state
)
for
it
.
Next
()
{
}
return
it
.
Error
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment