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
971702e7
Commit
971702e7
authored
Apr 23, 2015
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
p2p/discovery: fix broken tests due to API update
parent
af923c96
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
table_test.go
p2p/discover/table_test.go
+3
-3
udp_test.go
p2p/discover/udp_test.go
+1
-1
No files found.
p2p/discover/table_test.go
View file @
971702e7
...
...
@@ -15,7 +15,7 @@ import (
func
TestTable_pingReplace
(
t
*
testing
.
T
)
{
doit
:=
func
(
newNodeIsResponding
,
lastInBucketIsResponding
bool
)
{
transport
:=
newPingRecorder
()
tab
:=
newTable
(
transport
,
NodeID
{},
&
net
.
UDPAddr
{})
tab
:=
newTable
(
transport
,
NodeID
{},
&
net
.
UDPAddr
{}
,
""
)
last
:=
fillBucket
(
tab
,
200
)
pingSender
:=
randomID
(
tab
.
self
.
ID
,
200
)
...
...
@@ -145,7 +145,7 @@ func TestTable_closest(t *testing.T) {
test
:=
func
(
test
*
closeTest
)
bool
{
// for any node table, Target and N
tab
:=
newTable
(
nil
,
test
.
Self
,
&
net
.
UDPAddr
{})
tab
:=
newTable
(
nil
,
test
.
Self
,
&
net
.
UDPAddr
{}
,
""
)
tab
.
add
(
test
.
All
)
// check that doClosest(Target, N) returns nodes
...
...
@@ -217,7 +217,7 @@ func TestTable_Lookup(t *testing.T) {
self
:=
gen
(
NodeID
{},
quickrand
)
.
(
NodeID
)
target
:=
randomID
(
self
,
200
)
transport
:=
findnodeOracle
{
t
,
target
}
tab
:=
newTable
(
transport
,
self
,
&
net
.
UDPAddr
{})
tab
:=
newTable
(
transport
,
self
,
&
net
.
UDPAddr
{}
,
""
)
// lookup on empty table returns no nodes
if
results
:=
tab
.
Lookup
(
target
);
len
(
results
)
>
0
{
...
...
p2p/discover/udp_test.go
View file @
971702e7
...
...
@@ -41,7 +41,7 @@ func newUDPTest(t *testing.T) *udpTest {
remotekey
:
newkey
(),
remoteaddr
:
&
net
.
UDPAddr
{
IP
:
net
.
IP
{
1
,
2
,
3
,
4
},
Port
:
30303
},
}
test
.
table
,
test
.
udp
=
newUDP
(
test
.
localkey
,
test
.
pipe
,
nil
)
test
.
table
,
test
.
udp
=
newUDP
(
test
.
localkey
,
test
.
pipe
,
nil
,
""
)
return
test
}
...
...
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