[test] Add functionality to AddrReceiver
Add two simple helper functions to `AddrReceiver` to support callers currently using `GetAddrStore` [used in next commit].
This commit is contained in:
1 parent
09dc073cff
commit
e8c67ea19a
1 file changed
+6
@@ -40,6 +40,12 @@ class AddrReceiver(P2PInterface):
|
|||||||
raise AssertionError("Invalid addr.port of {} (8333-8342 expected)".format(addr.port))
|
raise AssertionError("Invalid addr.port of {} (8333-8342 expected)".format(addr.port))
|
||||||
assert addr.ip.startswith('123.123.123.')
|
assert addr.ip.startswith('123.123.123.')
|
||||||
|
|
||||||
|
def addr_received(self):
|
||||||
|
return self.num_ipv4_received != 0
|
||||||
|
|
||||||
|
def getaddr_received(self):
|
||||||
|
return self.message_count['getaddr'] > 0
|
||||||
|
|
||||||
|
|
||||||
class GetAddrStore(P2PInterface):
|
class GetAddrStore(P2PInterface):
|
||||||
getaddr_received = False
|
getaddr_received = False
|
||||||
|
|||||||
Reference in new issue
Block a user