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
8cf9ed0e
Commit
8cf9ed0e
authored
Nov 21, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed test
parent
9b8a12b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
trie.go
ptrie/trie.go
+2
-1
trie_test.go
ptrie/trie_test.go
+2
-2
No files found.
ptrie/trie.go
View file @
8cf9ed0e
...
...
@@ -3,6 +3,7 @@ package ptrie
import
(
"bytes"
"container/list"
"fmt"
"sync"
"github.com/ethereum/go-ethereum/crypto"
...
...
@@ -198,7 +199,7 @@ func (self *Trie) get(node Node, key []byte) Node {
case
*
FullNode
:
return
self
.
get
(
node
.
branch
(
key
[
0
]),
key
[
1
:
])
default
:
panic
(
"Invalid node"
)
panic
(
fmt
.
Sprintf
(
"%T: invalid node: %v"
,
node
,
node
)
)
}
}
...
...
ptrie/trie_test.go
View file @
8cf9ed0e
...
...
@@ -215,13 +215,13 @@ func TestOutput(t *testing.T) {
for
i
:=
0
;
i
<
50
;
i
++
{
trie
.
UpdateString
(
fmt
.
Sprintf
(
"%s%d"
,
base
,
i
),
"valueeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
)
}
trie
.
Hash
()
fmt
.
Println
(
"############################## FULL ################################"
)
fmt
.
Println
(
trie
.
root
)
trie
.
Commit
()
fmt
.
Println
(
"############################## SMALL ################################"
)
trie2
:=
New
(
trie
.
roothash
,
trie
.
cache
.
backend
)
trie2
.
GetString
(
base
+
"20"
)
fmt
.
Println
(
"############################## SMALL ################################"
)
fmt
.
Println
(
trie2
.
root
)
}
...
...
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