7 "github.com/stretchr/testify/assert"
10 func TestBep40Priority(t *testing.T) {
11 assert.EqualValues(t, peerPriority(0xec2d7224), bep40PriorityIgnoreError(
12 IpPort{IP: net.ParseIP("123.213.32.10"), Port: 0},
13 IpPort{IP: net.ParseIP("98.76.54.32"), Port: 0},
15 assert.EqualValues(t, peerPriority(0xec2d7224), bep40PriorityIgnoreError(
16 IpPort{IP: net.ParseIP("98.76.54.32"), Port: 0},
17 IpPort{IP: net.ParseIP("123.213.32.10"), Port: 0},
19 assert.Equal(t, peerPriority(0x99568189), bep40PriorityIgnoreError(
20 IpPort{IP: net.ParseIP("123.213.32.10"), Port: 0},
21 IpPort{IP: net.ParseIP("123.213.32.234"), Port: 0},
23 assert.Equal(t, peerPriority(0x2b41d456), bep40PriorityIgnoreError(
24 IpPort{IP: net.ParseIP("206.248.98.111"), Port: 0},
25 IpPort{IP: net.ParseIP("142.147.89.224"), Port: 0},
27 assert.EqualValues(t, "\x00\x00\x00\x00", func() []byte {
28 b, _ := bep40PriorityBytes(
29 IpPort{IP: net.ParseIP("123.213.32.234"), Port: 0},
30 IpPort{IP: net.ParseIP("123.213.32.234"), Port: 0},