diff --git a/test/functional/feature_addressindex.py b/test/functional/feature_addressindex.py index 3775b13995..8b2a37dfc0 100755 --- a/test/functional/feature_addressindex.py +++ b/test/functional/feature_addressindex.py @@ -7,12 +7,13 @@ # Test addressindex generation and fetching # +import binascii + +from test_framework.messages import COIN, COutPoint, CTransaction, CTxIn, CTxOut from test_framework.test_framework import BitcoinTestFramework from test_framework.test_node import ErrorMatch -from test_framework.util import * -from test_framework.script import * -from test_framework.mininode import * -import binascii +from test_framework.script import CScript, OP_CHECKSIG, OP_DUP, OP_EQUAL, OP_EQUALVERIFY, OP_HASH160 +from test_framework.util import assert_equal, connect_nodes class AddressIndexTest(BitcoinTestFramework): diff --git a/test/functional/feature_bip68_sequence.py b/test/functional/feature_bip68_sequence.py index 9da634fb70..cd4fc1ac2e 100755 --- a/test/functional/feature_bip68_sequence.py +++ b/test/functional/feature_bip68_sequence.py @@ -4,10 +4,11 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test BIP68 implementation.""" +from test_framework.blocktools import create_block, create_coinbase +from test_framework.messages import COIN, COutPoint, CTransaction, CTxIn, CTxOut, FromHex, ToHex +from test_framework.script import CScript from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * -from test_framework.blocktools import * -from test_framework.messages import FromHex, ToHex +from test_framework.util import assert_equal, assert_greater_than, assert_raises_rpc_error, get_bip9_status, satoshi_round SEQUENCE_LOCKTIME_DISABLE_FLAG = (1<<31) SEQUENCE_LOCKTIME_TYPE_FLAG = (1<<22) # this means use time (0 means height) diff --git a/test/functional/feature_block.py b/test/functional/feature_block.py index ead6de0a6f..00ac4ba3df 100755 --- a/test/functional/feature_block.py +++ b/test/functional/feature_block.py @@ -8,7 +8,7 @@ import struct from test_framework.blocktools import create_block, create_coinbase, create_tx_with_script, get_legacy_sigopcount_block from test_framework.key import CECKey -from test_framework.mininode import ( +from test_framework.messages import ( CBlock, COIN, COutPoint, diff --git a/test/functional/feature_cltv.py b/test/functional/feature_cltv.py index de50c1297f..1f1cf84c52 100755 --- a/test/functional/feature_cltv.py +++ b/test/functional/feature_cltv.py @@ -8,11 +8,13 @@ Test that the CHECKLOCKTIMEVERIFY soft-fork activates at (regtest) block height 1351. """ -from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * -from test_framework.mininode import * from test_framework.blocktools import create_coinbase, create_block, create_transaction +from test_framework.messages import CTransaction, msg_block, ToHex +from test_framework.mininode import mininode_lock, P2PInterface from test_framework.script import CScript, OP_1NEGATE, OP_CHECKLOCKTIMEVERIFY, OP_DROP, CScriptNum +from test_framework.test_framework import BitcoinTestFramework +from test_framework.util import assert_equal, assert_raises_rpc_error, bytes_to_hex_str, hex_str_to_bytes, wait_until + from io import BytesIO CLTV_HEIGHT = 1351 diff --git a/test/functional/feature_csv_activation.py b/test/functional/feature_csv_activation.py index 7d612a7bae..7c0af3fc68 100755 --- a/test/functional/feature_csv_activation.py +++ b/test/functional/feature_csv_activation.py @@ -47,7 +47,7 @@ from itertools import product from io import BytesIO from test_framework.blocktools import create_coinbase, create_block, create_transaction -from test_framework.mininode import ToHex, CTransaction +from test_framework.messages import ToHex, CTransaction from test_framework.mininode import P2PDataStore from test_framework.script import ( CScript, diff --git a/test/functional/feature_dbcrash.py b/test/functional/feature_dbcrash.py index 6a39f2e5a6..ee88cac741 100755 --- a/test/functional/feature_dbcrash.py +++ b/test/functional/feature_dbcrash.py @@ -31,10 +31,9 @@ import random import sys import time -from test_framework.mininode import * -from test_framework.script import * +from test_framework.messages import COIN, COutPoint, CTransaction, CTxIn, CTxOut, ToHex from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import assert_equal, create_confirmed_utxos, hex_str_to_bytes HTTP_DISCONNECT_ERRORS = [http.client.CannotSendRequest] try: diff --git a/test/functional/feature_dersig.py b/test/functional/feature_dersig.py index f69bfb5133..0c3aa1335f 100755 --- a/test/functional/feature_dersig.py +++ b/test/functional/feature_dersig.py @@ -7,11 +7,12 @@ Test that the DERSIG soft-fork activates at (regtest) height 1251. """ -from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * -from test_framework.mininode import * from test_framework.blocktools import create_coinbase, create_block, create_transaction +from test_framework.messages import msg_block +from test_framework.mininode import mininode_lock, P2PInterface from test_framework.script import CScript +from test_framework.test_framework import BitcoinTestFramework +from test_framework.util import assert_equal, assert_raises_rpc_error, bytes_to_hex_str, wait_until DERSIG_HEIGHT = 1251 diff --git a/test/functional/feature_dip0020_activation.py b/test/functional/feature_dip0020_activation.py index cd9bfb6f5e..1e65cb36f8 100755 --- a/test/functional/feature_dip0020_activation.py +++ b/test/functional/feature_dip0020_activation.py @@ -2,8 +2,7 @@ # Copyright (c) 2015-2020 The Dash Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -from test_framework.messages import COutPoint, CTransaction, CTxIn, CTxOut, ToHex -from test_framework.mininode import COIN +from test_framework.messages import COIN, COutPoint, CTransaction, CTxIn, CTxOut, ToHex from test_framework.script import CScript, OP_CAT, OP_DROP, OP_TRUE from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, assert_raises_rpc_error, get_bip9_status, satoshi_round diff --git a/test/functional/feature_dip3_deterministicmns.py b/test/functional/feature_dip3_deterministicmns.py index 23b0ee174b..ae739314f3 100755 --- a/test/functional/feature_dip3_deterministicmns.py +++ b/test/functional/feature_dip3_deterministicmns.py @@ -6,11 +6,13 @@ # # Test deterministic masternodes # + +from decimal import Decimal + from test_framework.blocktools import create_block, create_coinbase, get_masternode_payment -from test_framework.messages import uint256_to_string -from test_framework.mininode import CTransaction, ToHex, FromHex, COIN, CCbTx +from test_framework.messages import CCbTx, COIN, CTransaction, FromHex, ToHex, uint256_to_string from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import assert_equal, connect_nodes, force_finish_mnsync, get_bip9_status, p2p_port class Masternode(object): pass diff --git a/test/functional/feature_dip4_coinbasemerkleroots.py b/test/functional/feature_dip4_coinbasemerkleroots.py index fa46c2cd9a..618608ede9 100755 --- a/test/functional/feature_dip4_coinbasemerkleroots.py +++ b/test/functional/feature_dip4_coinbasemerkleroots.py @@ -2,9 +2,6 @@ # Copyright (c) 2015-2021 The Dash Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -from test_framework.mininode import * -from test_framework.test_framework import DashTestFramework -from test_framework.util import assert_equal ''' feature_dip4_coinbasemerkleroots.py @@ -13,6 +10,14 @@ Checks DIP4 merkle roots in coinbases ''' +from io import BytesIO + +from test_framework.messages import CBlock, CBlockHeader, CCbTx, CMerkleBlock, FromHex, hash256, msg_getmnlistd, QuorumId, ser_uint256 +from test_framework.mininode import P2PInterface +from test_framework.test_framework import DashTestFramework +from test_framework.util import assert_equal, wait_until + + class TestP2PConn(P2PInterface): def __init__(self): super().__init__() diff --git a/test/functional/feature_fee_estimation.py b/test/functional/feature_fee_estimation.py index 5f99eb09ad..97509567ae 100755 --- a/test/functional/feature_fee_estimation.py +++ b/test/functional/feature_fee_estimation.py @@ -6,7 +6,7 @@ from decimal import Decimal import random -from test_framework.mininode import CTransaction, CTxIn, CTxOut, COutPoint, ToHex, COIN +from test_framework.messages import CTransaction, CTxIn, CTxOut, COutPoint, ToHex, COIN from test_framework.script import CScript, OP_1, OP_DROP, OP_2, OP_HASH160, OP_EQUAL, hash160, OP_TRUE from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( diff --git a/test/functional/feature_governance_objects.py b/test/functional/feature_governance_objects.py index d3b26d5745..5dae7e0beb 100755 --- a/test/functional/feature_governance_objects.py +++ b/test/functional/feature_governance_objects.py @@ -4,9 +4,12 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Tests around dash governance objects.""" +import json +import time + +from test_framework.messages import uint256_to_string from test_framework.test_framework import DashTestFramework -from test_framework.util import * -from test_framework.messages import * +from test_framework.util import assert_equal, assert_greater_than, assert_raises_rpc_error def validate_object(prepared, rpc_prepared): diff --git a/test/functional/feature_llmq_chainlocks.py b/test/functional/feature_llmq_chainlocks.py index 981a4f9c04..ec6776afed 100755 --- a/test/functional/feature_llmq_chainlocks.py +++ b/test/functional/feature_llmq_chainlocks.py @@ -3,12 +3,6 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -import time - -from test_framework.mininode import * -from test_framework.test_framework import DashTestFramework -from test_framework.util import * - ''' feature_llmq_chainlocks.py @@ -16,6 +10,12 @@ Checks LLMQs based ChainLocks ''' +import time + +from test_framework.test_framework import DashTestFramework +from test_framework.util import connect_nodes, isolate_node, reconnect_isolated_node + + class LLMQChainLocksTest(DashTestFramework): def set_test_params(self): self.set_dash_test_params(4, 3, fast_dip3_enforcement=True) diff --git a/test/functional/feature_llmq_connections.py b/test/functional/feature_llmq_connections.py index b57c5652ea..a0feaee7a0 100755 --- a/test/functional/feature_llmq_connections.py +++ b/test/functional/feature_llmq_connections.py @@ -3,9 +3,6 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -from test_framework.test_framework import DashTestFramework -from test_framework.util import * - ''' feature_llmq_connections.py @@ -13,6 +10,12 @@ Checks intra quorum connections ''' +import time + +from test_framework.test_framework import DashTestFramework +from test_framework.util import assert_greater_than_or_equal, connect_nodes, wait_until + + class LLMQConnections(DashTestFramework): def set_test_params(self): self.set_dash_test_params(15, 14, fast_dip3_enforcement=True) diff --git a/test/functional/feature_llmq_is_cl_conflicts.py b/test/functional/feature_llmq_is_cl_conflicts.py index 1ed260a361..22ce5601dc 100755 --- a/test/functional/feature_llmq_is_cl_conflicts.py +++ b/test/functional/feature_llmq_is_cl_conflicts.py @@ -2,13 +2,6 @@ # Copyright (c) 2015-2021 The Dash Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -import time -from decimal import Decimal - -from test_framework.blocktools import get_masternode_payment, create_coinbase, create_block -from test_framework.mininode import * -from test_framework.test_framework import DashTestFramework -from test_framework.util import assert_equal, assert_raises_rpc_error, get_bip9_status ''' feature_llmq_is_cl_conflicts.py @@ -17,6 +10,18 @@ Checks conflict handling between ChainLocks and InstantSend ''' +from codecs import encode +from decimal import Decimal +import struct +import time + +from test_framework.blocktools import get_masternode_payment, create_coinbase, create_block +from test_framework.messages import CCbTx, CInv, COIN, CTransaction, FromHex, hash256, msg_clsig, msg_inv, ser_string, ToHex, uint256_from_str, uint256_to_string +from test_framework.mininode import P2PInterface +from test_framework.test_framework import DashTestFramework +from test_framework.util import assert_equal, assert_raises_rpc_error, hex_str_to_bytes, get_bip9_status + + class TestP2PConn(P2PInterface): def __init__(self): super().__init__() diff --git a/test/functional/feature_llmq_is_retroactive.py b/test/functional/feature_llmq_is_retroactive.py index e88ab6c708..020dbd2e9e 100755 --- a/test/functional/feature_llmq_is_retroactive.py +++ b/test/functional/feature_llmq_is_retroactive.py @@ -3,10 +3,6 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -from test_framework.mininode import * -from test_framework.test_framework import DashTestFramework -from test_framework.util import set_node_times, isolate_node, reconnect_isolated_node - ''' feature_llmq_is_retroactive.py @@ -17,6 +13,12 @@ Mempool inconsistencies are simulated via disconnecting/reconnecting node 3 and by having a higher relay fee on nodes 4 and 5. ''' +import time + +from test_framework.test_framework import DashTestFramework +from test_framework.util import set_node_times, isolate_node, reconnect_isolated_node + + class LLMQ_IS_RetroactiveSigning(DashTestFramework): def set_test_params(self): # -whitelist is needed to avoid the trickling logic on node0 diff --git a/test/functional/feature_llmq_signing.py b/test/functional/feature_llmq_signing.py index 65b03b14ba..40f3018e4b 100755 --- a/test/functional/feature_llmq_signing.py +++ b/test/functional/feature_llmq_signing.py @@ -3,10 +3,6 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -from test_framework.mininode import * -from test_framework.test_framework import DashTestFramework -from test_framework.util import * - ''' feature_llmq_signing.py @@ -14,6 +10,12 @@ Checks LLMQs signing sessions ''' +from test_framework.messages import CSigShare, msg_qsigshare, uint256_to_string +from test_framework.mininode import P2PInterface +from test_framework.test_framework import DashTestFramework +from test_framework.util import assert_equal, assert_raises_rpc_error, connect_nodes, force_finish_mnsync, hex_str_to_bytes, wait_until + + class LLMQSigningTest(DashTestFramework): def set_test_params(self): self.set_dash_test_params(6, 5, fast_dip3_enforcement=True) diff --git a/test/functional/feature_llmq_simplepose.py b/test/functional/feature_llmq_simplepose.py index 6267105df3..54e2eced61 100755 --- a/test/functional/feature_llmq_simplepose.py +++ b/test/functional/feature_llmq_simplepose.py @@ -3,11 +3,6 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -import time - -from test_framework.test_framework import DashTestFramework -from test_framework.util import * - ''' feature_llmq_simplepose.py @@ -15,6 +10,12 @@ Checks simple PoSe system based on LLMQ commitments ''' +import time + +from test_framework.test_framework import DashTestFramework +from test_framework.util import connect_nodes, force_finish_mnsync, p2p_port, wait_until + + class LLMQSimplePoSeTest(DashTestFramework): def set_test_params(self): self.set_dash_test_params(6, 5, fast_dip3_enforcement=True) diff --git a/test/functional/feature_maxuploadtarget.py b/test/functional/feature_maxuploadtarget.py index a13482e9bf..3b0bae6295 100755 --- a/test/functional/feature_maxuploadtarget.py +++ b/test/functional/feature_maxuploadtarget.py @@ -12,9 +12,11 @@ if uploadtarget has been reached. """ from collections import defaultdict -from test_framework.mininode import * +from test_framework.messages import CInv, MAX_BLOCK_SIZE, msg_getdata +from test_framework.mininode import P2PInterface from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import assert_equal, mine_large_block, set_node_times + class TestP2PConn(P2PInterface): def __init__(self): diff --git a/test/functional/feature_nulldummy.py b/test/functional/feature_nulldummy.py index 1dca8170b5..94484ebf55 100755 --- a/test/functional/feature_nulldummy.py +++ b/test/functional/feature_nulldummy.py @@ -13,11 +13,12 @@ Generate 427 more blocks. [Policy/Consensus] Check that the new NULLDUMMY rules are enforced on the 432nd block. """ -from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * -from test_framework.messages import CTransaction from test_framework.blocktools import create_coinbase, create_block, create_transaction +from test_framework.messages import CTransaction from test_framework.script import CScript +from test_framework.test_framework import BitcoinTestFramework +from test_framework.util import assert_equal, assert_raises_rpc_error, bytes_to_hex_str + NULLDUMMY_ERROR = "non-mandatory-script-verify-flag (Dummy CHECKMULTISIG argument must be zero) (code 64)" diff --git a/test/functional/feature_pruning.py b/test/functional/feature_pruning.py index eef32c2d74..e51b1c09ad 100755 --- a/test/functional/feature_pruning.py +++ b/test/functional/feature_pruning.py @@ -10,7 +10,8 @@ This test takes 30 mins or more (up to 2 hours) """ from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import assert_equal, assert_greater_than, assert_raises_rpc_error, connect_nodes, mine_large_block, wait_until + import os MIN_BLOCKS_TO_KEEP = 288 diff --git a/test/functional/feature_spentindex.py b/test/functional/feature_spentindex.py index 29eb3fac8d..cd60676fb9 100755 --- a/test/functional/feature_spentindex.py +++ b/test/functional/feature_spentindex.py @@ -7,12 +7,15 @@ # Test addressindex generation and fetching # -from test_framework.test_framework import BitcoinTestFramework -from test_framework.test_node import ErrorMatch -from test_framework.util import * -from test_framework.script import * -from test_framework.mininode import * import binascii +from decimal import Decimal + +from test_framework.messages import COIN, COutPoint, CTransaction, CTxIn, CTxOut +from test_framework.script import CScript, OP_CHECKSIG, OP_DUP, OP_EQUALVERIFY, OP_HASH160 +from test_framework.test_node import ErrorMatch +from test_framework.test_framework import BitcoinTestFramework +from test_framework.util import assert_equal, connect_nodes + class SpentIndexTest(BitcoinTestFramework): diff --git a/test/functional/feature_timestampindex.py b/test/functional/feature_timestampindex.py index 51b87f0f68..5c43a5640e 100755 --- a/test/functional/feature_timestampindex.py +++ b/test/functional/feature_timestampindex.py @@ -9,7 +9,7 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.test_node import ErrorMatch -from test_framework.util import * +from test_framework.util import assert_equal, connect_nodes class TimestampIndexTest(BitcoinTestFramework): diff --git a/test/functional/feature_txindex.py b/test/functional/feature_txindex.py index d0f162ef2d..2602f7f947 100755 --- a/test/functional/feature_txindex.py +++ b/test/functional/feature_txindex.py @@ -7,12 +7,14 @@ # Test txindex generation and fetching # -from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * -from test_framework.script import * -from test_framework.mininode import * import binascii +from test_framework.messages import COutPoint, CTransaction, CTxIn, CTxOut +from test_framework.script import CScript, OP_CHECKSIG, OP_DUP, OP_EQUALVERIFY, OP_HASH160 +from test_framework.test_framework import BitcoinTestFramework +from test_framework.util import assert_equal, connect_nodes + + class TxIndexTest(BitcoinTestFramework): def set_test_params(self): diff --git a/test/functional/interface_http.py b/test/functional/interface_http.py index 66f725722e..0222e6c77e 100755 --- a/test/functional/interface_http.py +++ b/test/functional/interface_http.py @@ -5,7 +5,7 @@ """Test the RPC HTTP basics.""" from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import assert_equal, str_to_b64str import http.client import urllib.parse diff --git a/test/functional/interface_zmq.py b/test/functional/interface_zmq.py index 8ace2645b2..46fa54b677 100755 --- a/test/functional/interface_zmq.py +++ b/test/functional/interface_zmq.py @@ -9,7 +9,7 @@ from codecs import encode from test_framework.test_framework import ( BitcoinTestFramework, skip_if_no_bitcoind_zmq, skip_if_no_py3_zmq) -from test_framework.mininode import dashhash +from test_framework.messages import dashhash from test_framework.util import (assert_equal, bytes_to_hex_str, hash256, diff --git a/test/functional/mempool_limit.py b/test/functional/mempool_limit.py index 2064071c6f..d459bdbf70 100755 --- a/test/functional/mempool_limit.py +++ b/test/functional/mempool_limit.py @@ -4,8 +4,10 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test mempool limiting together/eviction with the wallet.""" +from decimal import Decimal + from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import assert_equal, assert_greater_than, assert_raises_rpc_error, create_confirmed_utxos, create_lots_of_big_transactions, gen_return_txouts class MempoolLimitTest(BitcoinTestFramework): def set_test_params(self): diff --git a/test/functional/mempool_packages.py b/test/functional/mempool_packages.py index ecc7b5be65..84faadbd25 100755 --- a/test/functional/mempool_packages.py +++ b/test/functional/mempool_packages.py @@ -4,9 +4,11 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test descendant package tracking code.""" +from decimal import Decimal + +from test_framework.messages import COIN from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * -from test_framework.mininode import COIN +from test_framework.util import assert_equal, assert_raises_rpc_error, satoshi_round MAX_ANCESTORS = 25 MAX_DESCENDANTS = 25 diff --git a/test/functional/mempool_persist.py b/test/functional/mempool_persist.py index 3b52a75f54..07f21deb6e 100755 --- a/test/functional/mempool_persist.py +++ b/test/functional/mempool_persist.py @@ -35,11 +35,12 @@ Test is as follows: node1 can't write to disk. """ +from decimal import Decimal import os import time from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import assert_equal, assert_raises_rpc_error, wait_until class MempoolPersistTest(BitcoinTestFramework): def set_test_params(self): diff --git a/test/functional/mempool_reorg.py b/test/functional/mempool_reorg.py index 5b0ab19622..303c721090 100755 --- a/test/functional/mempool_reorg.py +++ b/test/functional/mempool_reorg.py @@ -8,9 +8,9 @@ Test re-org scenarios with a mempool that contains transactions that spend (directly or indirectly) coinbase transactions. """ -from test_framework.test_framework import BitcoinTestFramework from test_framework.blocktools import create_raw_transaction -from test_framework.util import * +from test_framework.test_framework import BitcoinTestFramework +from test_framework.util import assert_equal, assert_raises_rpc_error class MempoolCoinbaseTest(BitcoinTestFramework): diff --git a/test/functional/mempool_resurrect.py b/test/functional/mempool_resurrect.py index 2840a72b14..94b038f8c3 100755 --- a/test/functional/mempool_resurrect.py +++ b/test/functional/mempool_resurrect.py @@ -4,9 +4,9 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test resurrection of mined transactions when the blockchain is re-organized.""" -from test_framework.test_framework import BitcoinTestFramework from test_framework.blocktools import create_raw_transaction -from test_framework.util import * +from test_framework.test_framework import BitcoinTestFramework +from test_framework.util import assert_equal class MempoolCoinbaseTest(BitcoinTestFramework): diff --git a/test/functional/mempool_spend_coinbase.py b/test/functional/mempool_spend_coinbase.py index 3901641652..44dd156dbe 100755 --- a/test/functional/mempool_spend_coinbase.py +++ b/test/functional/mempool_spend_coinbase.py @@ -12,9 +12,11 @@ in the next block are accepted into the memory pool, but less mature coinbase spends are NOT. """ +from decimal import Decimal + from test_framework.test_framework import BitcoinTestFramework from test_framework.blocktools import create_raw_transaction -from test_framework.util import * +from test_framework.util import assert_equal, assert_raises_rpc_error class MempoolSpendCoinbaseTest(BitcoinTestFramework): diff --git a/test/functional/mining_basic.py b/test/functional/mining_basic.py index efa47174d9..bd783bf9ff 100755 --- a/test/functional/mining_basic.py +++ b/test/functional/mining_basic.py @@ -13,7 +13,7 @@ from binascii import b2a_hex from decimal import Decimal from test_framework.blocktools import create_coinbase -from test_framework.mininode import CBlock +from test_framework.messages import CBlock from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, assert_raises_rpc_error diff --git a/test/functional/mining_getblocktemplate_longpoll.py b/test/functional/mining_getblocktemplate_longpoll.py index e9c3457c1b..d309d65051 100755 --- a/test/functional/mining_getblocktemplate_longpoll.py +++ b/test/functional/mining_getblocktemplate_longpoll.py @@ -4,8 +4,10 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test longpolling with getblocktemplate.""" +from decimal import Decimal + from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import get_rpc_proxy, random_transaction, wait_until import threading diff --git a/test/functional/mining_prioritisetransaction.py b/test/functional/mining_prioritisetransaction.py index 6c941c1fe8..28709c084a 100755 --- a/test/functional/mining_prioritisetransaction.py +++ b/test/functional/mining_prioritisetransaction.py @@ -4,9 +4,9 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the prioritisetransaction mining RPC.""" +from test_framework.messages import COIN, MAX_BLOCK_SIZE from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * -from test_framework.mininode import COIN, MAX_BLOCK_SIZE +from test_framework.util import assert_equal, assert_raises_rpc_error, create_confirmed_utxos, create_lots_of_big_transactions, gen_return_txouts class PrioritiseTransactionTest(BitcoinTestFramework): def set_test_params(self): diff --git a/test/functional/p2p_compactblocks.py b/test/functional/p2p_compactblocks.py index e217f70b66..9f80fea788 100755 --- a/test/functional/p2p_compactblocks.py +++ b/test/functional/p2p_compactblocks.py @@ -5,12 +5,14 @@ """CompactBlocksTest -- test compact blocks (BIP 152, without segwit support, version 1) """ -from test_framework.mininode import * -from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * -from test_framework.blocktools import create_block, create_coinbase -from test_framework.script import CScript, OP_TRUE, OP_DROP +import random +from test_framework.blocktools import create_block, create_coinbase +from test_framework.messages import BlockTransactions, BlockTransactionsRequest, calculate_shortid, CBlock, CBlockHeader, CInv, COutPoint, CTransaction, CTxIn, CTxOut, FromHex, HeaderAndShortIDs, msg_block, msg_blocktxn, msg_cmpctblock, msg_getblocktxn, msg_getdata, msg_getheaders, msg_headers, msg_inv, msg_sendcmpct, msg_sendheaders, msg_tx, NODE_NETWORK, P2PHeaderAndShortIDs, PrefilledTransaction, ToHex +from test_framework.mininode import mininode_lock, P2PInterface +from test_framework.script import CScript, OP_TRUE, OP_DROP +from test_framework.test_framework import BitcoinTestFramework +from test_framework.util import assert_equal, wait_until # TestP2PConn: A peer we use to send messages to dashd, and store responses. class TestP2PConn(P2PInterface): diff --git a/test/functional/p2p_fingerprint.py b/test/functional/p2p_fingerprint.py index 0f0f28ffe0..8637d96be3 100755 --- a/test/functional/p2p_fingerprint.py +++ b/test/functional/p2p_fingerprint.py @@ -10,18 +10,18 @@ the node should pretend that it does not have it to avoid fingerprinting. import time from test_framework.blocktools import (create_block, create_coinbase) +from test_framework.messages import CInv from test_framework.mininode import ( - CInv, P2PInterface, msg_headers, msg_block, msg_getdata, msg_getheaders, - wait_until, ) from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_equal, + wait_until, ) class P2PFingerprintTest(BitcoinTestFramework): diff --git a/test/functional/p2p_instantsend.py b/test/functional/p2p_instantsend.py index 28b0bb13e1..00dab217f8 100755 --- a/test/functional/p2p_instantsend.py +++ b/test/functional/p2p_instantsend.py @@ -3,10 +3,8 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -from test_framework.mininode import * from test_framework.test_framework import DashTestFramework -from test_framework.util import isolate_node, reconnect_isolated_node, assert_equal, \ - assert_raises_rpc_error +from test_framework.util import assert_equal, assert_raises_rpc_error, bytes_to_hex_str, hash256, hex_str_to_bytes, isolate_node, reconnect_isolated_node ''' p2p_instantsend.py diff --git a/test/functional/p2p_invalid_block.py b/test/functional/p2p_invalid_block.py index 704f6cac9e..3225b33ccd 100755 --- a/test/functional/p2p_invalid_block.py +++ b/test/functional/p2p_invalid_block.py @@ -13,7 +13,8 @@ re-requested. import copy from test_framework.blocktools import create_block, create_coinbase, create_tx_with_script -from test_framework.mininode import P2PDataStore, COIN +from test_framework.messages import COIN +from test_framework.mininode import P2PDataStore from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal diff --git a/test/functional/p2p_invalid_tx.py b/test/functional/p2p_invalid_tx.py index d35aa4045f..441cab8ad3 100755 --- a/test/functional/p2p_invalid_tx.py +++ b/test/functional/p2p_invalid_tx.py @@ -7,7 +7,7 @@ In this test we connect to one node over p2p, and test tx requests.""" from test_framework.blocktools import create_block, create_coinbase, create_tx_with_script -from test_framework.mininode import ( +from test_framework.messages import ( COIN, COutPoint, CTransaction, diff --git a/test/functional/p2p_leak.py b/test/functional/p2p_leak.py index d71e9f6ac9..d84134543e 100755 --- a/test/functional/p2p_leak.py +++ b/test/functional/p2p_leak.py @@ -11,9 +11,12 @@ This test connects to a node and sends it a few messages, trying to entice it into sending us something it shouldn't. """ -from test_framework.mininode import * +import time + +from test_framework.messages import msg_getaddr, msg_ping, msg_verack +from test_framework.mininode import mininode_lock, P2PInterface from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import wait_until banscore = 10 diff --git a/test/functional/p2p_mempool.py b/test/functional/p2p_mempool.py index 387a2a14b4..da20e6de2b 100755 --- a/test/functional/p2p_mempool.py +++ b/test/functional/p2p_mempool.py @@ -8,9 +8,10 @@ Test that nodes are disconnected if they send mempool messages when bloom filters are not enabled. """ -from test_framework.mininode import * +from test_framework.messages import msg_mempool +from test_framework.mininode import P2PInterface from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import assert_equal class P2PMempoolTests(BitcoinTestFramework): def set_test_params(self): diff --git a/test/functional/p2p_node_network_limited.py b/test/functional/p2p_node_network_limited.py index 5c851802e8..78345b003a 100755 --- a/test/functional/p2p_node_network_limited.py +++ b/test/functional/p2p_node_network_limited.py @@ -9,9 +9,9 @@ and that it responds to getdata requests for blocks correctly: - send a block within 288 + 2 of the tip - disconnect peers who request blocks older than that.""" from test_framework.messages import CInv, msg_getdata, NODE_BLOOM, NODE_NETWORK_LIMITED, msg_verack -from test_framework.mininode import P2PInterface, wait_until, mininode_lock +from test_framework.mininode import P2PInterface, mininode_lock from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import assert_equal, disconnect_nodes, connect_nodes_bi, sync_blocks +from test_framework.util import assert_equal, disconnect_nodes, connect_nodes_bi, sync_blocks, wait_until class P2PIgnoreInv(P2PInterface): firstAddrnServices = 0 diff --git a/test/functional/p2p_sendheaders.py b/test/functional/p2p_sendheaders.py index 2022791a7b..e4562b69c5 100755 --- a/test/functional/p2p_sendheaders.py +++ b/test/functional/p2p_sendheaders.py @@ -86,9 +86,9 @@ e. Announce one more that doesn't connect. Expect: disconnect. """ from test_framework.blocktools import create_block, create_coinbase +from test_framework.messages import CInv from test_framework.mininode import ( CBlockHeader, - CInv, P2PInterface, mininode_lock, msg_block, diff --git a/test/functional/p2p_timeouts.py b/test/functional/p2p_timeouts.py index 48250e4a54..91dd98f14c 100755 --- a/test/functional/p2p_timeouts.py +++ b/test/functional/p2p_timeouts.py @@ -23,9 +23,9 @@ from time import sleep -from test_framework.mininode import * +from test_framework.messages import msg_ping +from test_framework.mininode import P2PInterface from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * class TestP2PConn(P2PInterface): def on_version(self, message): diff --git a/test/functional/p2p_unrequested_blocks.py b/test/functional/p2p_unrequested_blocks.py index 5bff4626f9..137de5f724 100755 --- a/test/functional/p2p_unrequested_blocks.py +++ b/test/functional/p2p_unrequested_blocks.py @@ -51,10 +51,12 @@ Node1 is unused in tests 3-7: work on its chain). """ -from test_framework.mininode import * -from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * + from test_framework.blocktools import create_block, create_coinbase, create_tx_with_script +from test_framework.messages import CBlockHeader, CInv, msg_block, msg_headers, msg_inv +from test_framework.mininode import mininode_lock, P2PInterface +from test_framework.test_framework import BitcoinTestFramework +from test_framework.util import assert_equal, assert_raises_rpc_error, connect_nodes class AcceptBlockTest(BitcoinTestFramework): diff --git a/test/functional/rpc_bind.py b/test/functional/rpc_bind.py index 35decf0332..33d659725a 100755 --- a/test/functional/rpc_bind.py +++ b/test/functional/rpc_bind.py @@ -6,9 +6,9 @@ import sys +from test_framework.netutil import all_interfaces, addr_to_hex, get_bind_addrs, test_ipv6_local from test_framework.test_framework import BitcoinTestFramework, SkipTest -from test_framework.util import * -from test_framework.netutil import * +from test_framework.util import assert_equal, assert_raises_rpc_error, get_rpc_proxy, rpc_port, rpc_url class RPCBindTest(BitcoinTestFramework): def set_test_params(self): diff --git a/test/functional/rpc_decodescript.py b/test/functional/rpc_decodescript.py index 6611da8831..e67a9f5cd3 100755 --- a/test/functional/rpc_decodescript.py +++ b/test/functional/rpc_decodescript.py @@ -4,9 +4,10 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test decoding scripts via decodescript RPC command.""" +from test_framework.messages import CTransaction from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * -from test_framework.mininode import * +from test_framework.util import assert_equal, bytes_to_hex_str, hex_str_to_bytes + from io import BytesIO class DecodeScriptTest(BitcoinTestFramework): diff --git a/test/functional/rpc_fundrawtransaction_hd.py b/test/functional/rpc_fundrawtransaction_hd.py index b4545ad19c..dd3b7ba393 100755 --- a/test/functional/rpc_fundrawtransaction_hd.py +++ b/test/functional/rpc_fundrawtransaction_hd.py @@ -3,8 +3,11 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. +from decimal import Decimal + +from test_framework.authproxy import JSONRPCException from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import assert_equal, assert_greater_than, connect_nodes_bi # Create one-input, one-output, no-fee transaction: class RawTransactionsTest(BitcoinTestFramework): diff --git a/test/functional/rpc_invalidateblock.py b/test/functional/rpc_invalidateblock.py index 5e843141c3..2d16c248e6 100755 --- a/test/functional/rpc_invalidateblock.py +++ b/test/functional/rpc_invalidateblock.py @@ -4,8 +4,10 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the invalidateblock RPC.""" +import time + from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import assert_equal, connect_nodes, connect_nodes_bi, wait_until class InvalidateTest(BitcoinTestFramework): def set_test_params(self): diff --git a/test/functional/rpc_mnauth.py b/test/functional/rpc_mnauth.py index d10162015c..e97d070cfa 100755 --- a/test/functional/rpc_mnauth.py +++ b/test/functional/rpc_mnauth.py @@ -3,9 +3,10 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. -from test_framework.mininode import * +from test_framework.messages import hash256 +from test_framework.mininode import P2PInterface from test_framework.test_framework import DashTestFramework -from test_framework.util import assert_equal, assert_raises_rpc_error +from test_framework.util import assert_equal, assert_raises_rpc_error, bytes_to_hex_str, hex_str_to_bytes ''' rpc_mnauth.py diff --git a/test/functional/rpc_rawtransaction.py b/test/functional/rpc_rawtransaction.py index c7602a8ae7..264943f1fc 100755 --- a/test/functional/rpc_rawtransaction.py +++ b/test/functional/rpc_rawtransaction.py @@ -13,10 +13,11 @@ Test the following RPCs: """ from collections import OrderedDict +from decimal import Decimal from io import BytesIO from test_framework.messages import CTransaction, ToHex from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import assert_equal, assert_raises_rpc_error, bytes_to_hex_str, connect_nodes_bi, hex_str_to_bytes class multidict(dict): """Dictionary that allows duplicate keys. diff --git a/test/functional/rpc_signrawtransaction.py b/test/functional/rpc_signrawtransaction.py index de81122167..d316437678 100755 --- a/test/functional/rpc_signrawtransaction.py +++ b/test/functional/rpc_signrawtransaction.py @@ -5,7 +5,7 @@ """Test transaction signing using the signrawtransaction* RPCs.""" from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import assert_equal, assert_raises_rpc_error class SignRawTransactionsTest(BitcoinTestFramework): diff --git a/test/functional/rpc_txoutproof.py b/test/functional/rpc_txoutproof.py index 46f7a70f90..047f0b90ea 100755 --- a/test/functional/rpc_txoutproof.py +++ b/test/functional/rpc_txoutproof.py @@ -4,10 +4,11 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test gettxoutproof and verifytxoutproof RPCs.""" +from decimal import Decimal + +from test_framework.messages import CMerkleBlock, FromHex, ToHex from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * -from test_framework.mininode import FromHex, ToHex -from test_framework.messages import CMerkleBlock +from test_framework.util import assert_equal, assert_raises_rpc_error, connect_nodes class MerkleBlockTest(BitcoinTestFramework): def set_test_params(self): diff --git a/test/functional/test_framework/mininode.py b/test/functional/test_framework/mininode.py index 01f0565592..7a76fbd0c6 100755 --- a/test/functional/test_framework/mininode.py +++ b/test/functional/test_framework/mininode.py @@ -20,9 +20,10 @@ from io import BytesIO import logging import struct import sys +import time import threading -from test_framework.messages import * +from test_framework.messages import CBlockHeader, MIN_VERSION_SUPPORTED, msg_addr, msg_addrv2, msg_block, msg_blocktxn, msg_clsig, msg_cmpctblock, msg_getaddr, msg_getblocks, msg_getblocktxn, msg_getdata, msg_getheaders, msg_getmnlistd, msg_headers, msg_inv, msg_islock, msg_mempool, msg_mnlistdiff, msg_ping, msg_pong, msg_qdata, msg_qgetdata, msg_reject, msg_sendaddrv2, msg_sendcmpct, msg_sendheaders, msg_tx, msg_verack, msg_version, MY_SUBVERSION, NODE_NETWORK, sha256 from test_framework.util import wait_until MSG_TX = 1 diff --git a/test/functional/test_framework/script.py b/test/functional/test_framework/script.py index 3b41ad100c..4dfb787323 100644 --- a/test/functional/test_framework/script.py +++ b/test/functional/test_framework/script.py @@ -7,13 +7,12 @@ This file is modified from python-bitcoinlib. """ - -from .mininode import CTransaction, CTxOut, sha256, hash256 from binascii import hexlify import hashlib import struct from .bignum import bn2vch +from .messages import CTransaction, CTxOut, sha256, hash256 MAX_SCRIPT_ELEMENT_SIZE = 520 diff --git a/test/functional/wallet_abandonconflict.py b/test/functional/wallet_abandonconflict.py index 75f76e1ad6..d8bce00439 100755 --- a/test/functional/wallet_abandonconflict.py +++ b/test/functional/wallet_abandonconflict.py @@ -10,9 +10,10 @@ which are not included in a block and are not currently in the mempool. It has no effect on transactions which are already abandoned. """ -from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from decimal import Decimal +from test_framework.test_framework import BitcoinTestFramework +from test_framework.util import assert_equal, assert_raises_rpc_error, connect_nodes, disconnect_nodes class AbandonConflictTest(BitcoinTestFramework): def set_test_params(self): diff --git a/test/functional/wallet_backup.py b/test/functional/wallet_backup.py index f1bf87ce6b..052a1b2c21 100755 --- a/test/functional/wallet_backup.py +++ b/test/functional/wallet_backup.py @@ -30,11 +30,13 @@ confirm 1/2/3/4 balances are same as before. Shutdown again, restore using importwallet, and confirm again balances are correct. """ +from decimal import Decimal +import os from random import randint import shutil from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import assert_equal, assert_raises_rpc_error, connect_nodes class WalletBackupTest(BitcoinTestFramework): def set_test_params(self): diff --git a/test/functional/wallet_disable.py b/test/functional/wallet_disable.py index 8591652fc0..51656fdb23 100755 --- a/test/functional/wallet_disable.py +++ b/test/functional/wallet_disable.py @@ -9,7 +9,7 @@ """ from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import assert_raises_rpc_error class DisableWalletTest (BitcoinTestFramework): def set_test_params(self): diff --git a/test/functional/wallet_groups.py b/test/functional/wallet_groups.py index 9fa7eaf07e..12dac145bd 100755 --- a/test/functional/wallet_groups.py +++ b/test/functional/wallet_groups.py @@ -5,8 +5,7 @@ """Test wallet group functionality.""" from test_framework.test_framework import BitcoinTestFramework -from test_framework.mininode import FromHex, ToHex -from test_framework.messages import CTransaction +from test_framework.messages import CTransaction, FromHex, ToHex from test_framework.util import ( assert_equal, ) diff --git a/test/functional/wallet_importmulti.py b/test/functional/wallet_importmulti.py index 695d46048d..3eefc0070d 100755 --- a/test/functional/wallet_importmulti.py +++ b/test/functional/wallet_importmulti.py @@ -6,7 +6,7 @@ from test_framework import script from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import assert_equal, assert_greater_than, assert_raises_rpc_error, bytes_to_hex_str class ImportMultiTest (BitcoinTestFramework): def set_test_params(self): diff --git a/test/functional/wallet_keypool.py b/test/functional/wallet_keypool.py index 68f3ecbb18..62cc293c4c 100755 --- a/test/functional/wallet_keypool.py +++ b/test/functional/wallet_keypool.py @@ -4,8 +4,10 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the wallet keypool and interaction with wallet encryption/locking.""" +import time + from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import assert_equal, assert_raises_rpc_error class KeyPoolTest(BitcoinTestFramework): def set_test_params(self): diff --git a/test/functional/wallet_keypool_hd.py b/test/functional/wallet_keypool_hd.py index fc78e3f890..81bf2088a4 100755 --- a/test/functional/wallet_keypool_hd.py +++ b/test/functional/wallet_keypool_hd.py @@ -7,8 +7,11 @@ # Add python-bitcoinrpc to module search path: +import time + +from test_framework.authproxy import JSONRPCException from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import assert_equal class KeyPoolTest(BitcoinTestFramework): diff --git a/test/functional/wallet_listtransactions.py b/test/functional/wallet_listtransactions.py index b989eb9a35..b05f773e02 100755 --- a/test/functional/wallet_listtransactions.py +++ b/test/functional/wallet_listtransactions.py @@ -6,7 +6,7 @@ from decimal import Decimal from io import BytesIO -from test_framework.mininode import CTransaction +from test_framework.messages import CTransaction from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_array_result, diff --git a/test/lint/lint-python.sh b/test/lint/lint-python.sh index 683ab2df1b..1748fb9453 100755 --- a/test/lint/lint-python.sh +++ b/test/lint/lint-python.sh @@ -30,6 +30,8 @@ export LC_ALL=C # E306 expected 1 blank line before a nested definition # E401 multiple imports on one line # E402 module level import not at top of file +# F403 'from foo_module import *' used; unable to detect undefined names +# F405 foo_function may be undefined, or defined from star imports: bar_module # E502 the backslash is redundant between brackets # E701 multiple statements on one line (colon) # E702 multiple statements on one line (semicolon) @@ -85,4 +87,4 @@ elif PYTHONWARNINGS="ignore" flake8 --version | grep -q "Python 2"; then exit 0 fi -PYTHONWARNINGS="ignore" git ls-files "*.py" | xargs flake8 --ignore=B,C,E,F,I,N,W --select=E101,E112,E113,E115,E116,E125,E129,E131,E133,E223,E224,E242,E266,E271,E272,E273,E274,E275,E304,E306,E401,E402,E502,E701,E702,E703,E714,E721,E742,E743,F401,E901,E902,F402,F404,F406,F407,F601,F602,F621,F622,F631,F701,F702,F703,F704,F705,F706,F707,F811,F812,F821,F822,F823,F831,F841,W191,W291,W292,W601,W602,W603,W604,W606 #,E741,W504,W605 +PYTHONWARNINGS="ignore" git ls-files "*.py" | xargs flake8 --ignore=B,C,E,F,I,N,W --select=E101,E112,E113,E115,E116,E125,E129,E131,E133,E223,E224,E242,E266,E271,E272,E273,E274,E275,E304,E306,E401,E402,E502,E701,E702,E703,E714,E721,E742,E743,E901,E902,F401,F402,F403,F404,F405,F406,F407,F601,F602,F621,F622,F631,F701,F702,F703,F704,F705,F706,F707,F811,F812,F821,F822,F823,F831,F841,W191,W291,W292,W601,W602,W603,W604,W606 #,E741,W504,W605