Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/avatools.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2021 The Bitcoin ABC developers | # Copyright (c) 2021 The Bitcoin ABC 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. | ||||
"""Utilities for avalanche tests.""" | """Utilities for avalanche tests.""" | ||||
from typing import Any, Optional, List, Dict | from typing import Any, Optional, List, Dict | ||||
from .messages import ( | from .messages import ( | ||||
AvalancheProof, | |||||
CTransaction, | CTransaction, | ||||
FromHex, | FromHex, | ||||
ToHex | ToHex | ||||
) | ) | ||||
from .test_node import TestNode | from .test_node import TestNode | ||||
from .util import satoshi_round | from .util import satoshi_round | ||||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | for utxo in utxos[:count]: | ||||
'vout': utxo['vout'], | 'vout': utxo['vout'], | ||||
'amount': utxo['amount'], | 'amount': utxo['amount'], | ||||
'iscoinbase': utxo['label'] == "coinbase", | 'iscoinbase': utxo['label'] == "coinbase", | ||||
'height': heights[blockhash], | 'height': heights[blockhash], | ||||
'privatekey': private_keys[utxo["address"]], | 'privatekey': private_keys[utxo["address"]], | ||||
}) | }) | ||||
return stakes | return stakes | ||||
def get_proof_ids(node): | |||||
return [FromHex(AvalancheProof(), peer['proof'] | |||||
).proofid for peer in node.getavalanchepeerinfo()] |