1- package multiaddr
1+ package filter
22
33import (
44 "net"
55 "testing"
6+
7+ ma "github.com/multiformats/go-multiaddr"
68)
79
810func TestFilterListing (t * testing.T ) {
@@ -66,7 +68,7 @@ func TestFilterBlocking(t *testing.T) {
6668 "/ip6/fd00::2/tcp/321" ,
6769 "/ip6/fc00::1/udp/321" ,
6870 } {
69- maddr , err := NewMultiaddr (blocked )
71+ maddr , err := ma . NewMultiaddr (blocked )
7072 if err != nil {
7173 t .Error (err )
7274 }
@@ -82,7 +84,7 @@ func TestFilterBlocking(t *testing.T) {
8284 "/ip6/fe00::1/tcp/321" ,
8385 "/ip6/fc00::2/udp/321" ,
8486 } {
85- maddr , err := NewMultiaddr (addr )
87+ maddr , err := ma . NewMultiaddr (addr )
8688 if err != nil {
8789 t .Error (err )
8890 }
@@ -112,7 +114,7 @@ func TestFilterWhitelisting(t *testing.T) {
112114 "/ip4/1.2.3.254/tcp/123" ,
113115 "/ip4/1.2.3.254/udp/321" ,
114116 } {
115- maddr , err := NewMultiaddr (addr )
117+ maddr , err := ma . NewMultiaddr (addr )
116118 if err != nil {
117119 t .Error (err )
118120 }
@@ -128,7 +130,7 @@ func TestFilterWhitelisting(t *testing.T) {
128130 "/ip6/fd00::2/tcp/321" ,
129131 "/ip6/fc00::1/udp/321" ,
130132 } {
131- maddr , err := NewMultiaddr (blocked )
133+ maddr , err := ma . NewMultiaddr (blocked )
132134 if err != nil {
133135 t .Error (err )
134136 }
@@ -159,7 +161,7 @@ func TestFiltersRemoveRules(t *testing.T) {
159161
160162 // these are all whitelisted, should be OK
161163 for _ , addr := range ips {
162- maddr , err := NewMultiaddr (addr )
164+ maddr , err := ma . NewMultiaddr (addr )
163165 if err != nil {
164166 t .Error (err )
165167 }
@@ -174,7 +176,7 @@ func TestFiltersRemoveRules(t *testing.T) {
174176
175177 // Show that they all apply, these are now blacklisted & should fail
176178 for _ , addr := range ips {
177- maddr , err := NewMultiaddr (addr )
179+ maddr , err := ma . NewMultiaddr (addr )
178180 if err != nil {
179181 t .Error (err )
180182 }
@@ -191,7 +193,7 @@ func TestFiltersRemoveRules(t *testing.T) {
191193 // our default is reject, so the 1.2.3.0/24 should be rejected now,
192194 // along with everything else
193195 for _ , addr := range ips {
194- maddr , err := NewMultiaddr (addr )
196+ maddr , err := ma . NewMultiaddr (addr )
195197 if err != nil {
196198 t .Error (err )
197199 }
0 commit comments