test: Remove unused imports
This commit is contained in:
parent
fa16a09215
commit
fafe5f0d09
28 changed files with 79 additions and 41 deletions
|
@ -10,7 +10,13 @@ from test_framework.blocktools import create_block, create_coinbase, add_witness
|
|||
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 assert_equal, assert_greater_than, assert_raises_rpc_error, get_bip9_status, satoshi_round, sync_blocks
|
||||
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)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2014-2018 The Bitcoin Core developers
|
||||
# Copyright (c) 2014-2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test fee estimation code."""
|
||||
|
@ -15,8 +15,6 @@ from test_framework.util import (
|
|||
assert_greater_than_or_equal,
|
||||
connect_nodes,
|
||||
satoshi_round,
|
||||
sync_blocks,
|
||||
sync_mempools,
|
||||
)
|
||||
|
||||
# Construct 2 trivial P2SH's and the ScriptSigs that spend them
|
||||
|
|
|
@ -14,7 +14,14 @@ from test_framework.blocktools import create_coinbase
|
|||
from test_framework.messages import CBlock, ToHex
|
||||
from test_framework.script import CScript, OP_RETURN, OP_NOP
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import assert_equal, assert_greater_than, assert_raises_rpc_error, connect_nodes, disconnect_nodes, sync_blocks, wait_until
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
assert_greater_than,
|
||||
assert_raises_rpc_error,
|
||||
connect_nodes,
|
||||
disconnect_nodes,
|
||||
wait_until,
|
||||
)
|
||||
|
||||
MIN_BLOCKS_TO_KEEP = 288
|
||||
|
||||
|
|
|
@ -18,7 +18,13 @@ from test_framework.blocktools import witness_script, send_to_witness
|
|||
from test_framework.messages import COIN, COutPoint, CTransaction, CTxIn, CTxOut, FromHex, sha256, ToHex
|
||||
from test_framework.script import CScript, OP_HASH160, OP_CHECKSIG, OP_0, hash160, OP_EQUAL, OP_DUP, OP_EQUALVERIFY, OP_1, OP_2, OP_CHECKMULTISIG, OP_TRUE, OP_DROP
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import assert_equal, assert_raises_rpc_error, connect_nodes, hex_str_to_bytes, sync_blocks, try_rpc
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
assert_raises_rpc_error,
|
||||
connect_nodes,
|
||||
hex_str_to_bytes,
|
||||
try_rpc,
|
||||
)
|
||||
|
||||
NODE_0 = 0
|
||||
NODE_2 = 2
|
||||
|
|
|
@ -8,7 +8,11 @@ from decimal import Decimal
|
|||
|
||||
from test_framework.messages import COIN
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import assert_equal, assert_raises_rpc_error, satoshi_round, sync_blocks, sync_mempools
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
assert_raises_rpc_error,
|
||||
satoshi_round,
|
||||
)
|
||||
|
||||
MAX_ANCESTORS = 25
|
||||
MAX_DESCENDANTS = 25
|
||||
|
|
|
@ -10,7 +10,7 @@ import time
|
|||
from test_framework.messages import msg_feefilter
|
||||
from test_framework.mininode import mininode_lock, P2PInterface
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import sync_blocks, sync_mempools
|
||||
|
||||
|
||||
def hashToHex(hash):
|
||||
return format(hash, '064x')
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2017-2018 The Bitcoin Core developers
|
||||
# Copyright (c) 2017-2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Tests NODE_NETWORK_LIMITED.
|
||||
|
@ -11,7 +11,13 @@ and that it responds to getdata requests for blocks correctly:
|
|||
from test_framework.messages import CInv, msg_getdata, msg_verack, NODE_BLOOM, NODE_NETWORK_LIMITED, NODE_WITNESS
|
||||
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, wait_until
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
disconnect_nodes,
|
||||
connect_nodes_bi,
|
||||
wait_until,
|
||||
)
|
||||
|
||||
|
||||
class P2PIgnoreInv(P2PInterface):
|
||||
firstAddrnServices = 0
|
||||
|
|
|
@ -77,8 +77,6 @@ from test_framework.util import (
|
|||
disconnect_nodes,
|
||||
get_bip9_status,
|
||||
hex_str_to_bytes,
|
||||
sync_blocks,
|
||||
sync_mempools,
|
||||
)
|
||||
|
||||
# The versionbit bit used to signal activation of SegWit
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2014-2018 The Bitcoin Core developers
|
||||
# Copyright (c) 2014-2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test behavior of headers messages to announce blocks.
|
||||
|
@ -103,7 +103,6 @@ from test_framework.mininode import (
|
|||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
sync_blocks,
|
||||
wait_until,
|
||||
)
|
||||
|
||||
|
|
|
@ -57,7 +57,11 @@ from test_framework.blocktools import create_block, create_coinbase, create_tx_w
|
|||
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, sync_blocks
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
assert_raises_rpc_error,
|
||||
connect_nodes,
|
||||
)
|
||||
|
||||
|
||||
class AcceptBlockTest(BitcoinTestFramework):
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2014-2018 The Bitcoin Core developers
|
||||
# Copyright (c) 2014-2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test the getchaintips RPC.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2014-2018 The Bitcoin Core developers
|
||||
# Copyright (c) 2014-2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test the invalidateblock RPC."""
|
||||
|
@ -9,7 +9,6 @@ from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE
|
|||
from test_framework.util import (
|
||||
assert_equal,
|
||||
connect_nodes_bi,
|
||||
sync_blocks,
|
||||
wait_until,
|
||||
)
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ from test_framework.test_framework import BitcoinTestFramework
|
|||
from test_framework.util import (
|
||||
assert_equal,
|
||||
connect_nodes_bi,
|
||||
sync_blocks,
|
||||
)
|
||||
|
||||
def unidirectional_node_sync_via_rpc(node_src, node_dest):
|
||||
|
|
|
@ -7,7 +7,13 @@
|
|||
|
||||
from decimal import Decimal
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import assert_equal, assert_raises_rpc_error, connect_nodes_bi, disconnect_nodes, find_output, sync_blocks
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
assert_raises_rpc_error,
|
||||
connect_nodes_bi,
|
||||
disconnect_nodes,
|
||||
find_output,
|
||||
)
|
||||
|
||||
import json
|
||||
import os
|
||||
|
|
|
@ -18,8 +18,6 @@ from test_framework.util import (
|
|||
assert_raises_rpc_error,
|
||||
connect_nodes,
|
||||
disconnect_nodes,
|
||||
sync_blocks,
|
||||
sync_mempools,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -63,8 +63,6 @@ from test_framework.util import (
|
|||
assert_greater_than,
|
||||
assert_raises_rpc_error,
|
||||
connect_nodes_bi,
|
||||
sync_blocks,
|
||||
sync_mempools,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2014-2018 The Bitcoin Core developers
|
||||
# Copyright (c) 2014-2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test the wallet backup features.
|
||||
|
@ -36,7 +36,12 @@ from random import randint
|
|||
import shutil
|
||||
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import assert_equal, assert_raises_rpc_error, connect_nodes, sync_blocks, sync_mempools
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
assert_raises_rpc_error,
|
||||
connect_nodes,
|
||||
)
|
||||
|
||||
|
||||
class WalletBackupTest(BitcoinTestFramework):
|
||||
def set_test_params(self):
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2018 The Bitcoin Core developers
|
||||
# Copyright (c) 2018-2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test the wallet balance RPC methods."""
|
||||
|
|
|
@ -13,7 +13,6 @@ from test_framework.util import (
|
|||
assert_fee_amount,
|
||||
assert_raises_rpc_error,
|
||||
connect_nodes_bi,
|
||||
sync_blocks,
|
||||
wait_until,
|
||||
)
|
||||
|
||||
|
|
|
@ -19,7 +19,13 @@ import io
|
|||
from test_framework.blocktools import add_witness_commitment, create_block, create_coinbase, send_to_witness
|
||||
from test_framework.messages import BIP125_SEQUENCE_NUMBER, CTransaction
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import assert_equal, assert_greater_than, assert_raises_rpc_error, connect_nodes_bi, hex_str_to_bytes, sync_mempools
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
assert_greater_than,
|
||||
assert_raises_rpc_error,
|
||||
connect_nodes_bi,
|
||||
hex_str_to_bytes,
|
||||
)
|
||||
|
||||
WALLET_PASSPHRASE = "test"
|
||||
WALLET_PASSPHRASE_TIMEOUT = 3600
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2014-2018 The Bitcoin Core developers
|
||||
# Copyright (c) 2014-2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test wallet import RPCs.
|
||||
|
@ -20,7 +20,12 @@ 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)
|
||||
from test_framework.util import (
|
||||
assert_raises_rpc_error,
|
||||
connect_nodes,
|
||||
assert_equal,
|
||||
set_node_times,
|
||||
)
|
||||
|
||||
import collections
|
||||
import enum
|
||||
|
|
|
@ -17,7 +17,6 @@ from test_framework.test_framework import BitcoinTestFramework
|
|||
from test_framework.util import (
|
||||
assert_equal,
|
||||
connect_nodes_bi,
|
||||
sync_blocks,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2014-2018 The Bitcoin Core developers
|
||||
# Copyright (c) 2014-2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test the listreceivedbyaddress RPC."""
|
||||
|
@ -10,7 +10,6 @@ from test_framework.util import (
|
|||
assert_array_result,
|
||||
assert_equal,
|
||||
assert_raises_rpc_error,
|
||||
sync_blocks,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2017-2018 The Bitcoin Core developers
|
||||
# Copyright (c) 2017-2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test the listsincelast RPC."""
|
||||
|
|
|
@ -12,7 +12,6 @@ from test_framework.util import (
|
|||
assert_array_result,
|
||||
assert_equal,
|
||||
hex_str_to_bytes,
|
||||
sync_mempools,
|
||||
)
|
||||
|
||||
def tx_from_hex(hexstring):
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2017-2018 The Bitcoin Core developers
|
||||
# Copyright (c) 2017-2019 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test that the wallet resends transactions periodically."""
|
||||
|
|
|
@ -10,7 +10,6 @@ from test_framework.util import (
|
|||
assert_equal,
|
||||
connect_nodes,
|
||||
disconnect_nodes,
|
||||
sync_blocks,
|
||||
)
|
||||
from test_framework.messages import CTransaction, COIN
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ from test_framework.util import (
|
|||
connect_nodes,
|
||||
disconnect_nodes,
|
||||
find_output,
|
||||
sync_blocks,
|
||||
)
|
||||
|
||||
class TxnMallTest(BitcoinTestFramework):
|
||||
|
|
Loading…
Reference in a new issue