Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc_p2p_proof_inventory.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2021 The Bitcoin developers | # Copyright (c) 2021 The Bitcoin developers | ||||
# Distributed under the MIT software license, see the accompanying | # Distributed under the MIT software license, see the accompanying | ||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | # file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
""" | """ | ||||
Test proof inventory relaying | Test proof inventory relaying | ||||
""" | """ | ||||
from test_framework.avatools import ( | import time | ||||
gen_proof, | |||||
get_proof_ids, | |||||
wait_for_proof, | |||||
) | |||||
from test_framework.address import ADDRESS_ECREG_UNSPENDABLE | from test_framework.address import ADDRESS_ECREG_UNSPENDABLE | ||||
from test_framework.avatools import gen_proof, get_proof_ids, wait_for_proof | |||||
from test_framework.key import ECKey | from test_framework.key import ECKey | ||||
from test_framework.messages import ( | from test_framework.messages import ( | ||||
MSG_AVA_PROOF, | |||||
MSG_TYPE_MASK, | |||||
AvalancheProof, | AvalancheProof, | ||||
CInv, | CInv, | ||||
FromHex, | FromHex, | ||||
MSG_AVA_PROOF, | |||||
MSG_TYPE_MASK, | |||||
msg_avaproof, | msg_avaproof, | ||||
msg_getdata, | msg_getdata, | ||||
) | ) | ||||
from test_framework.p2p import ( | from test_framework.p2p import P2PInterface, p2p_lock | ||||
P2PInterface, | |||||
p2p_lock, | |||||
) | |||||
from test_framework.test_framework import BitcoinTestFramework | from test_framework.test_framework import BitcoinTestFramework | ||||
from test_framework.util import ( | from test_framework.util import ( | ||||
assert_equal, | assert_equal, | ||||
assert_greater_than, | assert_greater_than, | ||||
connect_nodes, | connect_nodes, | ||||
wait_until, | wait_until, | ||||
) | ) | ||||
from test_framework.wallet_util import bytes_to_wif | from test_framework.wallet_util import bytes_to_wif | ||||
import time | |||||
# Broadcast reattempt occurs every 10 to 15 minutes | # Broadcast reattempt occurs every 10 to 15 minutes | ||||
MAX_INITIAL_BROADCAST_DELAY = 15 * 60 | MAX_INITIAL_BROADCAST_DELAY = 15 * 60 | ||||
# Delay to allow the node to respond to getdata requests | # Delay to allow the node to respond to getdata requests | ||||
UNCONDITIONAL_RELAY_DELAY = 2 * 60 | UNCONDITIONAL_RELAY_DELAY = 2 * 60 | ||||
class ProofInvStoreP2PInterface(P2PInterface): | class ProofInvStoreP2PInterface(P2PInterface): | ||||
def __init__(self): | def __init__(self): | ||||
▲ Show 20 Lines • Show All 256 Lines • Show Last 20 Lines |