Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_import_rescan.py
Show First 20 Lines • Show All 139 Lines • ▼ Show 20 Lines | def setup_network(self): | ||||
for i in range(1, self.num_nodes): | for i in range(1, self.num_nodes): | ||||
connect_nodes(self.nodes[i], self.nodes[0]) | connect_nodes(self.nodes[i], self.nodes[0]) | ||||
def run_test(self): | def run_test(self): | ||||
# Create one transaction on node 0 with a unique amount and label for | # Create one transaction on node 0 with a unique amount and label for | ||||
# each possible type of wallet import RPC. | # each possible type of wallet import RPC. | ||||
for i, variant in enumerate(IMPORT_VARIANTS): | for i, variant in enumerate(IMPORT_VARIANTS): | ||||
variant.label = "label {} {}".format(i, variant) | variant.label = "label {} {}".format(i, variant) | ||||
variant.address = self.nodes[1].validateaddress( | variant.address = self.nodes[1].getaddressinfo( | ||||
self.nodes[1].getnewaddress(variant.label)) | self.nodes[1].getnewaddress(variant.label)) | ||||
variant.key = self.nodes[1].dumpprivkey(variant.address["address"]) | variant.key = self.nodes[1].dumpprivkey(variant.address["address"]) | ||||
variant.initial_amount = 10 - (i + 1) / 4.0 | variant.initial_amount = 10 - (i + 1) / 4.0 | ||||
variant.initial_txid = self.nodes[0].sendtoaddress( | variant.initial_txid = self.nodes[0].sendtoaddress( | ||||
variant.address["address"], variant.initial_amount) | variant.address["address"], variant.initial_amount) | ||||
# Generate a block containing the initial transactions, then another | # Generate a block containing the initial transactions, then another | ||||
# block further in the future (past the rescan window). | # block further in the future (past the rescan window). | ||||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |