diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-04-24 23:04:41 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-04-24 23:04:41 +0800 |
commit | 8646365b42ddae30e596835b4512792ca11196a5 (patch) | |
tree | 03977b5bf677fa2a7e57953fba28c0aa21da6a88 /p2p/discover/udp_test.go | |
parent | 6def110c37d4d43402c4b658ce6b291400f840e5 (diff) | |
download | dexon-8646365b42ddae30e596835b4512792ca11196a5.tar.gz dexon-8646365b42ddae30e596835b4512792ca11196a5.tar.zst dexon-8646365b42ddae30e596835b4512792ca11196a5.zip |
cmd/bootnode, eth, p2p, p2p/discover: use a fancier db design
Diffstat (limited to 'p2p/discover/udp_test.go')
-rw-r--r-- | p2p/discover/udp_test.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/p2p/discover/udp_test.go b/p2p/discover/udp_test.go index 299f94543..47e04b85a 100644 --- a/p2p/discover/udp_test.go +++ b/p2p/discover/udp_test.go @@ -41,7 +41,7 @@ func newUDPTest(t *testing.T) *udpTest { remotekey: newkey(), remoteaddr: &net.UDPAddr{IP: net.IP{1, 2, 3, 4}, Port: 30303}, } - test.table, test.udp = newUDP(test.localkey, test.pipe, nil, nil) + test.table, test.udp = newUDP(test.localkey, test.pipe, nil, "") return test } @@ -157,8 +157,12 @@ func TestUDP_findnode(t *testing.T) { // ensure there's a bond with the test node, // findnode won't be accepted otherwise. - test.table.cache.add(PubkeyID(&test.remotekey.PublicKey), test.remoteaddr, 99) - + test.table.db.updateNode(&Node{ + ID: PubkeyID(&test.remotekey.PublicKey), + IP: test.remoteaddr.IP, + DiscPort: test.remoteaddr.Port, + TCPPort: 99, + }) // check that closest neighbors are returned. test.packetIn(nil, findnodePacket, &findnode{Target: testTarget, Expiration: futureExp}) test.waitPacketOut(func(p *neighbors) { |