mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
resolve pr comments regarding comments and added a missing newline
This commit is contained in:
parent
23b5b4663a
commit
864ae0f3c2
2 changed files with 11 additions and 0 deletions
|
|
@ -254,25 +254,35 @@ func TestSuggestPeerFindPeers(t *testing.T) {
|
|||
|
||||
}
|
||||
|
||||
// a node should stay in the address book if it's removed from the kademlia
|
||||
func TestOffEffectingAddressBookNormalNode(t *testing.T) {
|
||||
k := newTestKademlia("00000000")
|
||||
// peer added to kademlia
|
||||
k.On(newTestKadPeer(k, "01000000", false))
|
||||
// peer should be in the address book
|
||||
if k.addrs.Size() != 1 {
|
||||
t.Fatal("known peer addresses should contain 1 entry")
|
||||
}
|
||||
// remove peer from kademlia
|
||||
k.Off(newTestKadPeer(k, "01000000", false))
|
||||
// peer should not be in the address book
|
||||
if k.addrs.Size() != 1 {
|
||||
t.Fatal("known peer addresses should contain 1 entry")
|
||||
}
|
||||
}
|
||||
|
||||
// a light node should not be in the address book
|
||||
func TestOffEffectingAddressBookLightNode(t *testing.T) {
|
||||
k := newTestKademlia("00000000")
|
||||
// light node peer added to kademlia
|
||||
k.On(newTestKadPeer(k, "01000000", true))
|
||||
// peer should not be in the address book
|
||||
if k.addrs.Size() != 0 {
|
||||
t.Fatal("known peer addresses should contain 0 entry")
|
||||
}
|
||||
// remove peer from kademlia
|
||||
k.Off(newTestKadPeer(k, "01000000", true))
|
||||
// peer should not be in the address book
|
||||
if k.addrs.Size() != 0 {
|
||||
t.Fatal("known peer addresses should contain 0 entry")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -306,6 +306,7 @@ func TestRequestFromPeersWithLightNode(t *testing.T) {
|
|||
t.Fatalf("expected '%v', got %v", expectedError, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestStreamerDownstreamChunkDeliveryMsgExchange(t *testing.T) {
|
||||
tester, streamer, localStore, teardown, err := newStreamerTester(t, &RegistryOptions{
|
||||
DoServeRetrieve: true,
|
||||
|
|
|
|||
Loading…
Reference in a new issue