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
5183483c
Commit
5183483c
authored
Jul 22, 2019
by
Christian Muehlhaeuser
Committed by
Péter Szilágyi
Jul 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/state, p2p/discover, trie, whisper: avoid unnecessary conversions (#19870)
No need to convert these types.
parent
a1f85492
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
statedb_test.go
core/state/statedb_test.go
+3
-3
v4_udp_test.go
p2p/discover/v4_udp_test.go
+1
-1
trie_test.go
trie/trie_test.go
+1
-1
whisper_test.go
whisper/whisperv6/whisper_test.go
+1
-1
No files found.
core/state/statedb_test.go
View file @
5183483c
...
...
@@ -86,15 +86,15 @@ func TestIntermediateLeaks(t *testing.T) {
// Modify the transient state.
for
i
:=
byte
(
0
);
i
<
255
;
i
++
{
modify
(
transState
,
common
.
Address
{
byte
(
i
)
},
i
,
0
)
modify
(
transState
,
common
.
Address
{
i
},
i
,
0
)
}
// Write modifications to trie.
transState
.
IntermediateRoot
(
false
)
// Overwrite all the data with new values in the transient database.
for
i
:=
byte
(
0
);
i
<
255
;
i
++
{
modify
(
transState
,
common
.
Address
{
byte
(
i
)
},
i
,
99
)
modify
(
finalState
,
common
.
Address
{
byte
(
i
)
},
i
,
99
)
modify
(
transState
,
common
.
Address
{
i
},
i
,
99
)
modify
(
finalState
,
common
.
Address
{
i
},
i
,
99
)
}
// Commit and cross check the databases.
...
...
p2p/discover/v4_udp_test.go
View file @
5183483c
...
...
@@ -454,7 +454,7 @@ func TestUDPv4_successfulPing(t *testing.T) {
if
!
n
.
IP
()
.
Equal
(
test
.
remoteaddr
.
IP
)
{
t
.
Errorf
(
"node has wrong IP: got %v, want: %v"
,
n
.
IP
(),
test
.
remoteaddr
.
IP
)
}
if
int
(
n
.
UDP
()
)
!=
test
.
remoteaddr
.
Port
{
if
n
.
UDP
(
)
!=
test
.
remoteaddr
.
Port
{
t
.
Errorf
(
"node has wrong UDP port: got %v, want: %v"
,
n
.
UDP
(),
test
.
remoteaddr
.
Port
)
}
if
n
.
TCP
()
!=
int
(
testRemote
.
TCP
)
{
...
...
trie/trie_test.go
View file @
5183483c
...
...
@@ -52,7 +52,7 @@ func TestEmptyTrie(t *testing.T) {
var
trie
Trie
res
:=
trie
.
Hash
()
exp
:=
emptyRoot
if
res
!=
common
.
Hash
(
exp
)
{
if
res
!=
exp
{
t
.
Errorf
(
"expected %x got %x"
,
exp
,
res
)
}
}
...
...
whisper/whisperv6/whisper_test.go
View file @
5183483c
...
...
@@ -76,7 +76,7 @@ func TestWhisperBasic(t *testing.T) {
t
.
Fatalf
(
"failed w.Envelopes()."
)
}
derived
:=
pbkdf2
.
Key
(
[]
byte
(
peerID
)
,
nil
,
65356
,
aesKeyLength
,
sha256
.
New
)
derived
:=
pbkdf2
.
Key
(
peerID
,
nil
,
65356
,
aesKeyLength
,
sha256
.
New
)
if
!
validateDataIntegrity
(
derived
,
aesKeyLength
)
{
t
.
Fatalf
(
"failed validateSymmetricKey with param = %v."
,
derived
)
}
...
...
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