aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/simulations/http_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'p2p/simulations/http_test.go')
-rw-r--r--p2p/simulations/http_test.go18
1 files changed, 10 insertions, 8 deletions
diff --git a/p2p/simulations/http_test.go b/p2p/simulations/http_test.go
index c0a5acb3d..ed43c0ed7 100644
--- a/p2p/simulations/http_test.go
+++ b/p2p/simulations/http_test.go
@@ -421,14 +421,15 @@ type expectEvents struct {
}
func (t *expectEvents) nodeEvent(id string, up bool) *Event {
+ node := Node{
+ Config: &adapters.NodeConfig{
+ ID: enode.HexID(id),
+ },
+ up: up,
+ }
return &Event{
Type: EventTypeNode,
- Node: &Node{
- Config: &adapters.NodeConfig{
- ID: enode.HexID(id),
- },
- Up: up,
- },
+ Node: &node,
}
}
@@ -480,6 +481,7 @@ loop:
}
func (t *expectEvents) expect(events ...*Event) {
+ t.Helper()
timeout := time.After(10 * time.Second)
i := 0
for {
@@ -501,8 +503,8 @@ func (t *expectEvents) expect(events ...*Event) {
if event.Node.ID() != expected.Node.ID() {
t.Fatalf("expected node event %d to have id %q, got %q", i, expected.Node.ID().TerminalString(), event.Node.ID().TerminalString())
}
- if event.Node.Up != expected.Node.Up {
- t.Fatalf("expected node event %d to have up=%t, got up=%t", i, expected.Node.Up, event.Node.Up)
+ if event.Node.Up() != expected.Node.Up() {
+ t.Fatalf("expected node event %d to have up=%t, got up=%t", i, expected.Node.Up(), event.Node.Up())
}
case EventTypeConn: