diff --git a/test/functional/wallet_abandonconflict.py b/test/functional/wallet_abandonconflict.py --- a/test/functional/wallet_abandonconflict.py +++ b/test/functional/wallet_abandonconflict.py @@ -10,9 +10,18 @@ which are not included in a block and are not currently in the mempool. It has no effect on transactions which are already conflicted or abandoned. """ +from decimal import Decimal + +from test_framework.messages import CTransaction, FromHex from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * -from test_framework.mininode import * +from test_framework.util import ( + assert_equal, + connect_nodes, + disconnect_nodes, + satoshi_round, + sync_blocks, + sync_mempools, +) class AbandonConflictTest(BitcoinTestFramework): diff --git a/test/functional/wallet_backup.py b/test/functional/wallet_backup.py --- a/test/functional/wallet_backup.py +++ b/test/functional/wallet_backup.py @@ -30,11 +30,19 @@ 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, + sync_blocks, + sync_mempools, +) class WalletBackupTest(BitcoinTestFramework): diff --git a/test/functional/wallet_basic.py b/test/functional/wallet_basic.py --- a/test/functional/wallet_basic.py +++ b/test/functional/wallet_basic.py @@ -3,9 +3,21 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the wallet.""" +from decimal import Decimal +import time + +from test_framework.messages import FromHex, CTransaction from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * -from test_framework.mininode import * +from test_framework.util import ( + assert_array_result, + assert_equal, + assert_fee_amount, + assert_raises_rpc_error, + connect_nodes_bi, + count_bytes, + sync_blocks, + sync_mempools, +) class WalletTest(BitcoinTestFramework): diff --git a/test/functional/wallet_disable.py b/test/functional/wallet_disable.py --- 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): diff --git a/test/functional/wallet_dump.py b/test/functional/wallet_dump.py --- a/test/functional/wallet_dump.py +++ b/test/functional/wallet_dump.py @@ -7,7 +7,7 @@ import os from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import (assert_equal, assert_raises_rpc_error) +from test_framework.util import assert_equal, assert_raises_rpc_error def read_dump(file_name, addrs, script_addrs, hd_master_addr_old): diff --git a/test/functional/wallet_hd.py b/test/functional/wallet_hd.py --- a/test/functional/wallet_hd.py +++ b/test/functional/wallet_hd.py @@ -4,13 +4,11 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test Hierarchical Deterministic wallet function.""" -from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import ( - assert_equal, - connect_nodes_bi, -) -import shutil import os +import shutil + +from test_framework.test_framework import BitcoinTestFramework +from test_framework.util import assert_equal, connect_nodes_bi class WalletHDTest(BitcoinTestFramework): diff --git a/test/functional/wallet_import_rescan.py b/test/functional/wallet_import_rescan.py --- a/test/functional/wallet_import_rescan.py +++ b/test/functional/wallet_import_rescan.py @@ -18,14 +18,20 @@ happened previously. ''' -from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import ( - assert_raises_rpc_error, connect_nodes, sync_blocks, assert_equal, set_node_times) - import collections import enum import itertools +from test_framework.test_framework import BitcoinTestFramework +from test_framework.util import ( + assert_equal, + assert_raises_rpc_error, + connect_nodes, + set_node_times, + sync_blocks, +) + + Call = enum.Enum("Call", "single multi") Data = enum.Enum("Data", "address pub priv") Rescan = enum.Enum("Rescan", "no yes late_timestamp") diff --git a/test/functional/wallet_importmulti.py b/test/functional/wallet_importmulti.py --- a/test/functional/wallet_importmulti.py +++ b/test/functional/wallet_importmulti.py @@ -4,7 +4,11 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. 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, +) class ImportMultiTest (BitcoinTestFramework): diff --git a/test/functional/wallet_importprunedfunds.py b/test/functional/wallet_importprunedfunds.py --- a/test/functional/wallet_importprunedfunds.py +++ b/test/functional/wallet_importprunedfunds.py @@ -3,8 +3,10 @@ # 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.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import assert_equal, assert_raises_rpc_error class ImportPrunedFundsTest(BitcoinTestFramework): diff --git a/test/functional/wallet_keypool.py b/test/functional/wallet_keypool.py --- a/test/functional/wallet_keypool.py +++ b/test/functional/wallet_keypool.py @@ -4,9 +4,10 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise 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): diff --git a/test/functional/wallet_listreceivedby.py b/test/functional/wallet_listreceivedby.py --- a/test/functional/wallet_listreceivedby.py +++ b/test/functional/wallet_listreceivedby.py @@ -7,10 +7,11 @@ from decimal import Decimal from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import (assert_array_result, - assert_equal, - assert_raises_rpc_error, - ) +from test_framework.util import ( + assert_array_result, + assert_equal, + assert_raises_rpc_error, +) class ReceivedByTest(BitcoinTestFramework): diff --git a/test/functional/wallet_txn_clone.py b/test/functional/wallet_txn_clone.py --- a/test/functional/wallet_txn_clone.py +++ b/test/functional/wallet_txn_clone.py @@ -5,7 +5,12 @@ """Test the wallet accounts properly when there are cloned transactions with malleated scriptsigs.""" from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import ( + assert_equal, + connect_nodes, + disconnect_nodes, + sync_blocks, +) class TxnMallTest(BitcoinTestFramework): diff --git a/test/functional/wallet_txn_doublespend.py b/test/functional/wallet_txn_doublespend.py --- a/test/functional/wallet_txn_doublespend.py +++ b/test/functional/wallet_txn_doublespend.py @@ -3,9 +3,16 @@ # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the wallet accounts properly when there is a double-spend conflict.""" +from decimal import Decimal from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import * +from test_framework.util import ( + assert_equal, + connect_nodes, + disconnect_nodes, + find_output, + sync_blocks, +) class TxnMallTest(BitcoinTestFramework):