Skip to content

Commit

Permalink
p2p/enode: add bootnode parsing testcase (#461)
Browse files Browse the repository at this point in the history
  • Loading branch information
peekpi authored and erickyan86 committed Sep 3, 2019
1 parent 453e66e commit 647cfa1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions p2p/enode/urlv4_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import (
"strings"
"testing"
"testing/quick"

"github.com/stretchr/testify/assert"
)

var parseNodeTests = []struct {
Expand Down Expand Up @@ -276,3 +278,10 @@ func TestNodeID_logdistEqual(t *testing.T) {
t.Errorf("LogDist(x, x) != 0")
}
}

func TestBootnodes(t *testing.T) {
n, err := ParseV4("fnode://a85ccab0374c60ddea0a63b521ae3f8475100ff4e116090d6798a8618ceea193f5b7deffc14627b2f61bc374336983f6a6c6ed979478590d49906e8ce6041a18@boot.m.ft.im:30000")
assert.Equal(t, nil, err)
assert.Equal(t, 0, n.TCP())
assert.Equal(t, 30000, n.UDP())
}

0 comments on commit 647cfa1

Please sign in to comment.