Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wanwiset25 committed Nov 13, 2024
1 parent 9d80798 commit b083f92
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 20 deletions.
4 changes: 0 additions & 4 deletions p2p/dial_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,6 @@ func TestDialStateDynDialFromTable(t *testing.T) {
&dialTask{flags: dynDialedConn, dest: newNode(uintID(11), nil)},
&dialTask{flags: dynDialedConn, dest: newNode(uintID(12), nil)},
},
new: []task{
&discoverTask{},
},
},
// Waiting for expiry. No waitExpireTask is launched because the
// discovery query is still running.
Expand Down Expand Up @@ -567,7 +564,6 @@ func TestDialStaticAfterReset(t *testing.T) {
for _, n := range wantStatic {
dTest.init.removeStatic(n)
dTest.init.addStatic(n)
delete(dTest.init.dialing, n.ID())
}
// without removing peers they will be considered recently dialed
runDialTest(t, dTest)
Expand Down
2 changes: 1 addition & 1 deletion p2p/discover/udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func (t *udp) sendPing(toid enode.ID, toaddr *net.UDPAddr, callback func()) <-ch
To: makeEndpoint(toaddr, 0), // TODO: maybe use known TCP port from DB
Expiration: uint64(time.Now().Add(expiration).Unix()),
}
packet, hash, err := encodePacket(t.priv, pingPacket, req)
packet, hash, err := encodePacket(t.priv, pingXDC, req)
if err != nil {
errc := make(chan error, 1)
errc <- err
Expand Down
15 changes: 0 additions & 15 deletions p2p/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,21 +197,6 @@ func TestServerDial(t *testing.T) {
t.Error("server did not launch peer within one second")
}

select {
case peer := <-connected:
if peer.ID() != enode.PubkeyToIDV4(remid) {
t.Errorf("peer has wrong id")
}
if peer.Name() != "test" {
t.Errorf("peer has wrong name")
}
if peer.RemoteAddr().String() != conn.LocalAddr().String() {
t.Errorf("peer started with wrong conn: got %v, want %v",
peer.RemoteAddr(), conn.LocalAddr())
}
case <-time.After(1 * time.Second):
t.Error("server did not launch peer within one second")
}
case <-time.After(1 * time.Second):
fmt.Println("step 1: didn't work")
t.Error("server did not connect within one second")
Expand Down

0 comments on commit b083f92

Please sign in to comment.