diff --git a/test/functional/abc-get-invalid-block.py b/test/functional/abc-get-invalid-block.py --- a/test/functional/abc-get-invalid-block.py +++ b/test/functional/abc-get-invalid-block.py @@ -5,14 +5,14 @@ """Test requesting invalid blocks behaves safely.""" from test_framework.messages import ( + MSG_BLOCK, + MSG_CMPCT_BLOCK, CInv, msg_getblocks, msg_getdata, msg_getheaders, - MSG_BLOCK, - MSG_CMPCT_BLOCK, ) -from test_framework.p2p import p2p_lock, P2PInterface +from test_framework.p2p import P2PInterface, p2p_lock from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal diff --git a/test/functional/abc-invalid-chains.py b/test/functional/abc-invalid-chains.py --- a/test/functional/abc-invalid-chains.py +++ b/test/functional/abc-invalid-chains.py @@ -5,13 +5,10 @@ import time -from test_framework.test_framework import BitcoinTestFramework +from test_framework.blocktools import create_block, create_coinbase from test_framework.p2p import P2PDataStore +from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal -from test_framework.blocktools import ( - create_block, - create_coinbase, -) class InvalidChainsTest(BitcoinTestFramework): diff --git a/test/functional/abc-invalid-message.py b/test/functional/abc-invalid-message.py --- a/test/functional/abc-invalid-message.py +++ b/test/functional/abc-invalid-message.py @@ -11,10 +11,7 @@ import struct from test_framework.messages import NODE_NETWORK, msg_version -from test_framework.p2p import ( - msg_ping, - P2PInterface, -) +from test_framework.p2p import P2PInterface, msg_ping from test_framework.test_framework import BitcoinTestFramework diff --git a/test/functional/abc-mempool-coherence-on-activations.py b/test/functional/abc-mempool-coherence-on-activations.py --- a/test/functional/abc-mempool-coherence-on-activations.py +++ b/test/functional/abc-mempool-coherence-on-activations.py @@ -36,17 +36,16 @@ ) from test_framework.p2p import P2PDataStore from test_framework.script import ( - CScript, OP_CHECKSIG, OP_TRUE, SIGHASH_ALL, SIGHASH_FORKID, + CScript, SignatureHashForkId, ) from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, assert_raises_rpc_error - # ---Code specific to the activation used for this test--- # It might change depending on the activation code currently existing in the diff --git a/test/functional/abc-minimaldata.py b/test/functional/abc-minimaldata.py --- a/test/functional/abc-minimaldata.py +++ b/test/functional/abc-minimaldata.py @@ -27,14 +27,8 @@ FromHex, ToHex, ) -from test_framework.p2p import ( - P2PDataStore, -) -from test_framework.script import ( - CScript, - OP_ADD, - OP_TRUE, -) +from test_framework.p2p import P2PDataStore +from test_framework.script import OP_ADD, OP_TRUE, CScript from test_framework.test_framework import BitcoinTestFramework from test_framework.txtools import pad_tx from test_framework.util import assert_raises_rpc_error diff --git a/test/functional/abc-parkedchain.py b/test/functional/abc-parkedchain.py --- a/test/functional/abc-parkedchain.py +++ b/test/functional/abc-parkedchain.py @@ -5,10 +5,7 @@ """Test the parckblock and unparkblock RPC calls.""" from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import ( - assert_equal, - connect_nodes, -) +from test_framework.util import assert_equal, connect_nodes class ParkedChainTest(BitcoinTestFramework): diff --git a/test/functional/abc-replay-protection.py b/test/functional/abc-replay-protection.py --- a/test/functional/abc-replay-protection.py +++ b/test/functional/abc-replay-protection.py @@ -28,11 +28,11 @@ ) from test_framework.p2p import P2PDataStore from test_framework.script import ( - CScript, OP_CHECKSIG, OP_TRUE, SIGHASH_ALL, SIGHASH_FORKID, + CScript, SignatureHashForkId, ) from test_framework.test_framework import BitcoinTestFramework diff --git a/test/functional/abc-schnorr.py b/test/functional/abc-schnorr.py --- a/test/functional/abc-schnorr.py +++ b/test/functional/abc-schnorr.py @@ -26,17 +26,15 @@ FromHex, ToHex, ) -from test_framework.p2p import ( - P2PDataStore, -) +from test_framework.p2p import P2PDataStore from test_framework.script import ( - CScript, OP_1, OP_CHECKMULTISIG, OP_CHECKSIG, OP_TRUE, SIGHASH_ALL, SIGHASH_FORKID, + CScript, SignatureHashForkId, ) from test_framework.test_framework import BitcoinTestFramework diff --git a/test/functional/abc-schnorrmultisig.py b/test/functional/abc-schnorrmultisig.py --- a/test/functional/abc-schnorrmultisig.py +++ b/test/functional/abc-schnorrmultisig.py @@ -29,23 +29,20 @@ FromHex, ToHex, ) -from test_framework.p2p import ( - P2PDataStore, -) +from test_framework.p2p import P2PDataStore from test_framework.script import ( - CScript, OP_0, OP_1, OP_CHECKMULTISIG, OP_TRUE, SIGHASH_ALL, SIGHASH_FORKID, + CScript, SignatureHashForkId, ) from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, assert_raises_rpc_error - # ECDSA checkmultisig with non-null dummy are invalid since the new mode # refuses ECDSA. ECDSA_NULLDUMMY_ERROR = 'mandatory-script-verify-flag-failed (Only Schnorr signatures allowed in this operation)' diff --git a/test/functional/abc-segwit-recovery.py b/test/functional/abc-segwit-recovery.py --- a/test/functional/abc-segwit-recovery.py +++ b/test/functional/abc-segwit-recovery.py @@ -23,20 +23,16 @@ CTxOut, ToHex, ) -from test_framework.p2p import ( - P2PDataStore, -) +from test_framework.p2p import P2PDataStore from test_framework.script import ( - CScript, - hash160, OP_EQUAL, OP_HASH160, OP_TRUE, + CScript, + hash160, ) from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import ( - assert_raises_rpc_error, -) +from test_framework.util import assert_raises_rpc_error TEST_TIME = int(time.time()) diff --git a/test/functional/abc-sync-chain.py b/test/functional/abc-sync-chain.py --- a/test/functional/abc-sync-chain.py +++ b/test/functional/abc-sync-chain.py @@ -16,7 +16,6 @@ from test_framework.p2p import P2PInterface from test_framework.test_framework import BitcoinTestFramework - NUM_IBD_BLOCKS = 50 diff --git a/test/functional/abc-transaction-ordering.py b/test/functional/abc-transaction-ordering.py --- a/test/functional/abc-transaction-ordering.py +++ b/test/functional/abc-transaction-ordering.py @@ -7,27 +7,18 @@ non topological order once the feature is activated. """ -from collections import deque import random import time +from collections import deque from test_framework.blocktools import ( create_block, create_coinbase, make_conform_to_ctor, ) -from test_framework.messages import ( - COutPoint, - CTransaction, - CTxIn, - CTxOut, -) +from test_framework.messages import COutPoint, CTransaction, CTxIn, CTxOut from test_framework.p2p import P2PDataStore -from test_framework.script import ( - CScript, - OP_RETURN, - OP_TRUE, -) +from test_framework.script import OP_RETURN, OP_TRUE, CScript from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal diff --git a/test/functional/abc_feature_minerfund.py b/test/functional/abc_feature_minerfund.py --- a/test/functional/abc_feature_minerfund.py +++ b/test/functional/abc_feature_minerfund.py @@ -3,18 +3,12 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -from test_framework.blocktools import ( - create_block, - create_coinbase, -) +from decimal import Decimal + +from test_framework.blocktools import create_block, create_coinbase from test_framework.messages import ToHex from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import ( - assert_equal, - assert_greater_than_or_equal, -) - -from decimal import Decimal +from test_framework.util import assert_equal, assert_greater_than_or_equal AXION_ACTIVATION_TIME = 2000000600 diff --git a/test/functional/abc_mining_basic.py b/test/functional/abc_mining_basic.py --- a/test/functional/abc_mining_basic.py +++ b/test/functional/abc_mining_basic.py @@ -6,13 +6,13 @@ Tests for Bitcoin ABC mining RPCs """ +from decimal import Decimal + from test_framework.cdefs import ( BLOCK_MAXBYTES_MAXSIGCHECKS_RATIO, DEFAULT_MAX_BLOCK_SIZE, ) -from test_framework.messages import ( - XEC, -) +from test_framework.messages import XEC from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_equal, @@ -20,8 +20,6 @@ connect_nodes, ) -from decimal import Decimal - AXION_ACTIVATION_TIME = 2000000600 MINER_FUND_ADDR = 'ecregtest:pqnqv9lt7e5vjyp0w88zf2af0l92l8rxdgz0wv9ltl' MINER_FUND_LEGACY_ADDR = '2MviGxxFciGeWTgkUgYgjqehWt18c4ZsShd' diff --git a/test/functional/abc_p2p_avalanche_peer_discovery.py b/test/functional/abc_p2p_avalanche_peer_discovery.py --- a/test/functional/abc_p2p_avalanche_peer_discovery.py +++ b/test/functional/abc_p2p_avalanche_peer_discovery.py @@ -12,24 +12,21 @@ from test_framework.address import ADDRESS_ECREG_UNSPENDABLE from test_framework.avatools import ( - get_ava_p2p_interface, create_coinbase_stakes, + get_ava_p2p_interface, get_proof_ids, ) -from test_framework.key import ( - ECKey, - ECPubKey, -) -from test_framework.p2p import p2p_lock +from test_framework.key import ECKey, ECPubKey from test_framework.messages import ( + MSG_AVA_PROOF, + NODE_AVALANCHE, + NODE_NETWORK, AvalancheProof, CInv, FromHex, - MSG_AVA_PROOF, msg_getdata, - NODE_AVALANCHE, - NODE_NETWORK, ) +from test_framework.p2p import p2p_lock from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal from test_framework.wallet_util import bytes_to_wif diff --git a/test/functional/abc_p2p_avalanche_voting.py b/test/functional/abc_p2p_avalanche_voting.py --- a/test/functional/abc_p2p_avalanche_voting.py +++ b/test/functional/abc_p2p_avalanche_voting.py @@ -6,13 +6,10 @@ import random from test_framework.avatools import ( - get_ava_p2p_interface, create_coinbase_stakes, + get_ava_p2p_interface, ) -from test_framework.key import ( - ECKey, - ECPubKey, -) +from test_framework.key import ECKey, ECPubKey from test_framework.messages import AvalancheVote from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal diff --git a/test/functional/abc_p2p_compactblocks.py b/test/functional/abc_p2p_compactblocks.py --- a/test/functional/abc_p2p_compactblocks.py +++ b/test/functional/abc_p2p_compactblocks.py @@ -11,9 +11,9 @@ (e.g. sigops limits). """ -from collections import deque import random import time +from collections import deque from test_framework.blocktools import ( create_block, @@ -32,12 +32,8 @@ msg_sendcmpct, ser_compact_size, ) -from test_framework.p2p import ( - p2p_lock, - P2PDataStore, - P2PInterface, -) -from test_framework.script import CScript, OP_RETURN, OP_TRUE +from test_framework.p2p import P2PDataStore, P2PInterface, p2p_lock +from test_framework.script import OP_RETURN, OP_TRUE, CScript from test_framework.test_framework import BitcoinTestFramework from test_framework.txtools import pad_tx from test_framework.util import assert_equal diff --git a/test/functional/abc_p2p_fullblocktest.py b/test/functional/abc_p2p_fullblocktest.py --- a/test/functional/abc_p2p_fullblocktest.py +++ b/test/functional/abc_p2p_fullblocktest.py @@ -11,9 +11,9 @@ (e.g. sigops limits). """ -from collections import deque import random import time +from collections import deque from test_framework.blocktools import ( create_block, @@ -21,23 +21,17 @@ create_tx_with_script, make_conform_to_ctor, ) -from test_framework.cdefs import ( - ONE_MEGABYTE, -) +from test_framework.cdefs import ONE_MEGABYTE from test_framework.messages import ( COutPoint, CTransaction, CTxIn, CTxOut, - ser_compact_size, ToHex, + ser_compact_size, ) from test_framework.p2p import P2PDataStore -from test_framework.script import ( - CScript, - OP_RETURN, - OP_TRUE, -) +from test_framework.script import OP_RETURN, OP_TRUE, CScript from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal diff --git a/test/functional/abc_p2p_proof_inventory.py b/test/functional/abc_p2p_proof_inventory.py --- a/test/functional/abc_p2p_proof_inventory.py +++ b/test/functional/abc_p2p_proof_inventory.py @@ -6,26 +6,21 @@ Test proof inventory relaying """ -from test_framework.avatools import ( - gen_proof, - get_proof_ids, - wait_for_proof, -) +import time + 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.messages import ( + MSG_AVA_PROOF, + MSG_TYPE_MASK, AvalancheProof, CInv, FromHex, - MSG_AVA_PROOF, - MSG_TYPE_MASK, msg_avaproof, msg_getdata, ) -from test_framework.p2p import ( - P2PInterface, - p2p_lock, -) +from test_framework.p2p import P2PInterface, p2p_lock from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_equal, @@ -34,8 +29,6 @@ ) from test_framework.wallet_util import bytes_to_wif -import time - # Broadcast reattempt occurs every 10 to 15 minutes MAX_INITIAL_BROADCAST_DELAY = 15 * 60 # Delay to allow the node to respond to getdata requests diff --git a/test/functional/abc_rpc_addavalanchenode.py b/test/functional/abc_rpc_addavalanchenode.py --- a/test/functional/abc_rpc_addavalanchenode.py +++ b/test/functional/abc_rpc_addavalanchenode.py @@ -16,9 +16,7 @@ ) from test_framework.p2p import P2PInterface from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import ( - assert_raises_rpc_error, -) +from test_framework.util import assert_raises_rpc_error from test_framework.wallet_util import bytes_to_wif diff --git a/test/functional/abc_rpc_avalancheproof.py b/test/functional/abc_rpc_avalancheproof.py --- a/test/functional/abc_rpc_avalancheproof.py +++ b/test/functional/abc_rpc_avalancheproof.py @@ -26,8 +26,8 @@ from test_framework.util import ( append_config, assert_equal, - connect_nodes, assert_raises_rpc_error, + connect_nodes, ) from test_framework.wallet_util import bytes_to_wif diff --git a/test/functional/abc_rpc_buildavalancheproof.py b/test/functional/abc_rpc_buildavalancheproof.py --- a/test/functional/abc_rpc_buildavalancheproof.py +++ b/test/functional/abc_rpc_buildavalancheproof.py @@ -8,9 +8,7 @@ from test_framework.avatools import create_coinbase_stakes from test_framework.key import ECKey from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import ( - assert_raises_rpc_error, -) +from test_framework.util import assert_raises_rpc_error from test_framework.wallet_util import bytes_to_wif diff --git a/test/functional/abc_rpc_getavalanchepeerinfo.py b/test/functional/abc_rpc_getavalanchepeerinfo.py --- a/test/functional/abc_rpc_getavalanchepeerinfo.py +++ b/test/functional/abc_rpc_getavalanchepeerinfo.py @@ -4,8 +4,8 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the getavalanchepeerinfo RPC.""" from test_framework.avatools import ( - get_ava_p2p_interface, create_coinbase_stakes, + get_ava_p2p_interface, ) from test_framework.key import ECKey from test_framework.test_framework import BitcoinTestFramework diff --git a/test/functional/abc_wallet_dumpcoins.py b/test/functional/abc_wallet_dumpcoins.py --- a/test/functional/abc_wallet_dumpcoins.py +++ b/test/functional/abc_wallet_dumpcoins.py @@ -6,11 +6,11 @@ Test the dumpcoins RPCs call. """ +from decimal import Decimal + from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal -from decimal import Decimal - class DumpCoinsTest(BitcoinTestFramework): def set_test_params(self): diff --git a/test/functional/abc_wallet_standardness.py b/test/functional/abc_wallet_standardness.py --- a/test/functional/abc_wallet_standardness.py +++ b/test/functional/abc_wallet_standardness.py @@ -6,29 +6,22 @@ that it might try to spend.""" from decimal import Decimal -from test_framework.messages import ( - CTransaction, - CTxOut, - FromHex, - ToHex, -) + +from test_framework.messages import CTransaction, CTxOut, FromHex, ToHex from test_framework.script import ( - CScript, OP_1, OP_5, - OP_CHECKSIG, OP_CHECKMULTISIG, + OP_CHECKSIG, OP_DUP, OP_EQUALVERIFY, OP_HASH160, OP_PUSHDATA1, + CScript, hash160, ) from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import ( - assert_raises_rpc_error, - assert_equal, -) +from test_framework.util import assert_equal, assert_raises_rpc_error SATOSHI = Decimal('0.01')