Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_import_rescan.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2014-2016 The Bitcoin Core developers | # Copyright (c) 2014-2016 The Bitcoin Core 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. | ||||
''' | """Test wallet import RPCs. | ||||
Test rescan behavior of importaddress, importpubkey, importprivkey, and | Test rescan behavior of importaddress, importpubkey, importprivkey, and | ||||
importmulti RPCs with different types of keys and rescan options. | importmulti RPCs with different types of keys and rescan options. | ||||
In the first part of the test, node 0 creates an address for each type of | In the first part of the test, node 0 creates an address for each type of | ||||
import RPC call and node 0 sends BCH to it. Then other nodes import the | import RPC call and node 0 sends BCH to it. Then other nodes import the | ||||
addresses, and the test makes listtransactions and getbalance calls to confirm | addresses, and the test makes listtransactions and getbalance calls to confirm | ||||
that the importing node either did or did not execute rescans picking up the | that the importing node either did or did not execute rescans picking up the | ||||
send transactions. | send transactions. | ||||
In the second part of the test, node 0 sends more BCH to each address, and the | In the second part of the test, node 0 sends more BCH to each address, and the | ||||
test makes more listtransactions and getbalance calls to confirm that the | test makes more listtransactions and getbalance calls to confirm that the | ||||
importing nodes pick up the new transactions regardless of whether rescans | importing nodes pick up the new transactions regardless of whether rescans | ||||
happened previously. | happened previously. | ||||
''' | """ | ||||
import collections | import collections | ||||
import enum | import enum | ||||
import itertools | import itertools | ||||
from test_framework.test_framework import BitcoinTestFramework | from test_framework.test_framework import BitcoinTestFramework | ||||
from test_framework.util import ( | from test_framework.util import ( | ||||
assert_equal, | assert_equal, | ||||
▲ Show 20 Lines • Show All 177 Lines • Show Last 20 Lines |