aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/simulations/http_test.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2019-02-20 16:48:12 +0800
committerGitHub <noreply@github.com>2019-02-20 16:48:12 +0800
commitc942700427557e3ff6de3aaf6b916e2f056c1ec2 (patch)
treecadf68e7206d6de42b1eefc6967214cf86e35ff2 /p2p/simulations/http_test.go
parent7fa3509e2eaf1a4ebc12344590e5699406690f15 (diff)
parentcde35439e058b4f9579830fec9fb65ae0b998346 (diff)
downloadgo-tangerine-1.8.23.tar
go-tangerine-1.8.23.tar.gz
go-tangerine-1.8.23.tar.bz2
go-tangerine-1.8.23.tar.lz
go-tangerine-1.8.23.tar.xz
go-tangerine-1.8.23.tar.zst
go-tangerine-1.8.23.zip
Merge pull request #19029 from holiman/update1.8v1.8.23
Update1.8
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: