Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc_p2p_getavaaddr.py
Show First 20 Lines • Show All 397 Lines • ▼ Show 20 Lines | def test_send_inbound_getavaaddr_until_quorum_is_established(self): | ||||
# Periodic send will include the inbound as well | # Periodic send will include the inbound as well | ||||
current_total = count_getavaaddr([inbound, outbound]) | current_total = count_getavaaddr([inbound, outbound]) | ||||
while count_getavaaddr([inbound]) == 0: | while count_getavaaddr([inbound]) == 0: | ||||
node.mockscheduler(MAX_GETAVAADDR_DELAY) | node.mockscheduler(MAX_GETAVAADDR_DELAY) | ||||
self.wait_until(lambda: count_getavaaddr( | self.wait_until(lambda: count_getavaaddr( | ||||
[inbound, outbound]) > current_total) | [inbound, outbound]) > current_total) | ||||
current_total = count_getavaaddr([inbound, outbound]) | current_total = count_getavaaddr([inbound, outbound]) | ||||
# Connect the minimum amount of stake | # Connect the minimum amount of stake and nodes | ||||
privkey, proof = gen_proof(node) | for _ in range(8): | ||||
assert node.addavalanchenode( | node.add_p2p_connection(AvaP2PInterface(node)) | ||||
inbound.nodeid, | self.wait_until(lambda: node.getavalancheinfo()['active'] is True) | ||||
privkey.get_pubkey().get_bytes().hex(), | |||||
proof.serialize().hex()) | |||||
assert_equal(node.getavalancheinfo()['active'], True) | |||||
# From now only the outbound is requested | # From now only the outbound is requested | ||||
count_inbound = count_getavaaddr([inbound]) | count_inbound = count_getavaaddr([inbound]) | ||||
for _ in range(10): | for _ in range(10): | ||||
# Trigger a poll | # Trigger a poll | ||||
node.generate(1) | node.generate(1) | ||||
inbound.sync_send_with_ping() | inbound.sync_send_with_ping() | ||||
Show All 23 Lines |