aboutsummaryrefslogtreecommitdiff
path: root/test/functional/wallet_import_rescan.py
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2016-11-28 17:19:27 -0500
committerRussell Yanofsky <russ@yanofsky.org>2018-02-22 10:04:42 -0500
commit98ea64cf232c34d4b1aebe738b3956191667cd76 (patch)
treefa5a3e1778d190b28b57e77b2324bd651116684f /test/functional/wallet_import_rescan.py
parentaae64a21ba25ca86fe2bbb581681dc20d613fb44 (diff)
Let wallet importmulti RPC accept labels for standard scriptPubKeys
Allow importmulti RPC to apply address labels when importing standard scriptPubKeys. This makes the importmulti RPC less finnicky about import formats and also simpler internally.
Diffstat (limited to 'test/functional/wallet_import_rescan.py')
-rwxr-xr-xtest/functional/wallet_import_rescan.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/functional/wallet_import_rescan.py b/test/functional/wallet_import_rescan.py
index 3288ce4b60..a7095e1a24 100755
--- a/test/functional/wallet_import_rescan.py
+++ b/test/functional/wallet_import_rescan.py
@@ -26,7 +26,7 @@ import collections
import enum
import itertools
-Call = enum.Enum("Call", "single multi")
+Call = enum.Enum("Call", "single multiaddress multiscript")
Data = enum.Enum("Data", "address pub priv")
Rescan = enum.Enum("Rescan", "no yes late_timestamp")
@@ -54,11 +54,11 @@ class Variant(collections.namedtuple("Variant", "call data rescan prune")):
response = self.try_rpc(self.node.importprivkey, self.key, self.label, self.rescan == Rescan.yes)
assert_equal(response, None)
- elif self.call == Call.multi:
+ elif self.call in (Call.multiaddress, Call.multiscript):
response = self.node.importmulti([{
"scriptPubKey": {
"address": self.address["address"]
- },
+ } if self.call == Call.multiaddress else self.address["scriptPubKey"],
"timestamp": timestamp + TIMESTAMP_WINDOW + (1 if self.rescan == Rescan.late_timestamp else 0),
"pubkeys": [self.address["pubkey"]] if self.data == Data.pub else [],
"keys": [self.key] if self.data == Data.priv else [],
@@ -136,7 +136,7 @@ class ImportRescanTest(BitcoinTestFramework):
variant.label = "label {} {}".format(i, variant)
variant.address = self.nodes[1].getaddressinfo(self.nodes[1].getnewaddress(variant.label))
variant.key = self.nodes[1].dumpprivkey(variant.address["address"])
- variant.initial_amount = 10 - (i + 1) / 4.0
+ variant.initial_amount = 1 - (i + 1) / 64
variant.initial_txid = self.nodes[0].sendtoaddress(variant.address["address"], variant.initial_amount)
# Generate a block containing the initial transactions, then another
@@ -166,7 +166,7 @@ class ImportRescanTest(BitcoinTestFramework):
# Create new transactions sending to each address.
for i, variant in enumerate(IMPORT_VARIANTS):
- variant.sent_amount = 10 - (2 * i + 1) / 8.0
+ variant.sent_amount = 1 - (2 * i + 1) / 128
variant.sent_txid = self.nodes[0].sendtoaddress(variant.address["address"], variant.sent_amount)
# Generate a block containing the new transactions.