mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-22 19:40:36 +00:00
cmd/devp2p/internal/v4test: add pong validation in bond (#26400)
This commit is contained in:
parent
dad92500e7
commit
c6a2f77c2e
@ -395,7 +395,7 @@ func FindnodePastExpiration(t *utesting.T) {
|
|||||||
|
|
||||||
// bond performs the endpoint proof with the remote node.
|
// bond performs the endpoint proof with the remote node.
|
||||||
func bond(t *utesting.T, te *testenv) {
|
func bond(t *utesting.T, te *testenv) {
|
||||||
te.send(te.l1, &v4wire.Ping{
|
pingHash := te.send(te.l1, &v4wire.Ping{
|
||||||
Version: 4,
|
Version: 4,
|
||||||
From: te.localEndpoint(te.l1),
|
From: te.localEndpoint(te.l1),
|
||||||
To: te.remoteEndpoint(),
|
To: te.remoteEndpoint(),
|
||||||
@ -417,7 +417,9 @@ func bond(t *utesting.T, te *testenv) {
|
|||||||
})
|
})
|
||||||
gotPing = true
|
gotPing = true
|
||||||
case *v4wire.Pong:
|
case *v4wire.Pong:
|
||||||
// TODO: maybe verify pong data here
|
if err := te.checkPong(req, pingHash); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
gotPong = true
|
gotPong = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user