From e8c67ea19ac4c0aec4a0b449ac3a4152f80dfff5 Mon Sep 17 00:00:00 2001 From: Amiti Uttarwar Date: Tue, 15 Jun 2021 12:29:46 -0700 Subject: [PATCH] [test] Add functionality to AddrReceiver Add two simple helper functions to `AddrReceiver` to support callers currently using `GetAddrStore` [used in next commit]. --- test/functional/p2p_addr_relay.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/functional/p2p_addr_relay.py b/test/functional/p2p_addr_relay.py index a033027c71e..34c5d710538 100755 --- a/test/functional/p2p_addr_relay.py +++ b/test/functional/p2p_addr_relay.py @@ -40,6 +40,12 @@ class AddrReceiver(P2PInterface): raise AssertionError("Invalid addr.port of {} (8333-8342 expected)".format(addr.port)) 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): getaddr_received = False