@@ -24,6 +24,7 @@ import (
2424 "testing"
2525
2626 "github.com/XinFinOrg/XDPoSChain/crypto"
27+ "github.com/XinFinOrg/XDPoSChain/p2p/discover/v4wire"
2728 "github.com/XinFinOrg/XDPoSChain/p2p/enode"
2829 "github.com/XinFinOrg/XDPoSChain/p2p/enr"
2930)
@@ -135,15 +136,15 @@ func TestUDPv4_LookupIteratorClose(t *testing.T) {
135136
136137func serveTestnet (test * udpTest , testnet * preminedTestnet ) {
137138 for done := false ; ! done ; {
138- done = test .waitPacketOut (func (p packetV4 , to * net.UDPAddr , hash []byte ) {
139+ done = test .waitPacketOut (func (p v4wire. Packet , to * net.UDPAddr , hash []byte ) {
139140 n , key := testnet .nodeByAddr (to )
140141 switch p .(type ) {
141- case * pingV4 :
142- test .packetInFrom (nil , key , to , & pongV4 {Expiration : futureExp , ReplyTok : hash })
143- case * findnodeV4 :
142+ case * v4wire. Ping :
143+ test .packetInFrom (nil , key , to , & v4wire. Pong {Expiration : futureExp , ReplyTok : hash })
144+ case * v4wire. Findnode :
144145 dist := enode .LogDist (n .ID (), testnet .target .id ())
145146 nodes := testnet .nodesAtDistance (dist - 1 )
146- test .packetInFrom (nil , key , to , & neighborsV4 {Expiration : futureExp , Nodes : nodes })
147+ test .packetInFrom (nil , key , to , & v4wire. Neighbors {Expiration : futureExp , Nodes : nodes })
147148 }
148149 })
149150 }
@@ -270,8 +271,8 @@ func (tn *preminedTestnet) nodeByAddr(addr *net.UDPAddr) (*enode.Node, *ecdsa.Pr
270271 return tn .node (dist , index ), key
271272}
272273
273- func (tn * preminedTestnet ) nodesAtDistance (dist int ) []rpcNode {
274- result := make ([]rpcNode , len (tn .dists [dist ]))
274+ func (tn * preminedTestnet ) nodesAtDistance (dist int ) []v4wire. Node {
275+ result := make ([]v4wire. Node , len (tn .dists [dist ]))
275276 for i := range result {
276277 result [i ] = nodeToRPC (wrapNode (tn .node (dist , i )))
277278 }
0 commit comments