diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-11-13 21:31:51 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-11-13 21:34:23 +0100 |
commit | f617e05c38c9c7e663b824fefe5329cc5cbbf26a (patch) | |
tree | 68c51fe724176b72c4c00ae73e9ea2261160af92 /test/functional/wallet_importmulti.py | |
parent | c651265c934c84c683aa054f2a456b12acc41590 (diff) | |
parent | 7afddfa8cefd01249ad59cf2370e7cec90b34f6f (diff) |
Merge #14679: importmulti: Don't add internal addresses to address book
7afddfa8cefd01249ad59cf2370e7cec90b34f6f importmulti: Don't add internal addresses to address book (Gregory Sanders)
Pull request description:
Currently anything imported with `internal` will not be treated as change since checking the address book is a primary test of this.
Added basic tests of all combinations of arguments and change identification.
Resolves https://github.com/bitcoin/bitcoin/issues/14662
Tree-SHA512: a1f08dc624a3fadee93cc5392d50c4796b0c5eedf38e295382f71570f2066d9e978ed6e3962084b902989863fe1273a8642d8fdb094a266d69de10622a4176b0
Diffstat (limited to 'test/functional/wallet_importmulti.py')
-rwxr-xr-x | test/functional/wallet_importmulti.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/functional/wallet_importmulti.py b/test/functional/wallet_importmulti.py index 9ba6860306..f2855b6e89 100755 --- a/test/functional/wallet_importmulti.py +++ b/test/functional/wallet_importmulti.py @@ -54,7 +54,7 @@ class ImportMultiTest(BitcoinTestFramework): # RPC importmulti ----------------------------------------------- - # Bitcoin Address + # Bitcoin Address (implicit non-internal) self.log.info("Should import an address") address = self.nodes[0].getaddressinfo(self.nodes[0].getnewaddress()) result = self.nodes[1].importmulti([{ @@ -68,6 +68,7 @@ class ImportMultiTest(BitcoinTestFramework): assert_equal(address_assert['iswatchonly'], True) assert_equal(address_assert['ismine'], False) assert_equal(address_assert['timestamp'], timestamp) + assert_equal(address_assert['ischange'], False) watchonly_address = address['address'] watchonly_timestamp = timestamp @@ -95,6 +96,7 @@ class ImportMultiTest(BitcoinTestFramework): assert_equal(address_assert['iswatchonly'], True) assert_equal(address_assert['ismine'], False) assert_equal(address_assert['timestamp'], timestamp) + assert_equal(address_assert['ischange'], True) # ScriptPubKey + internal + label self.log.info("Should not allow a label to be specified when internal is true") @@ -126,7 +128,7 @@ class ImportMultiTest(BitcoinTestFramework): assert_equal('timestamp' in address_assert, False) - # Address + Public key + !Internal + # Address + Public key + !Internal(explicit) self.log.info("Should import an address with public key") address = self.nodes[0].getaddressinfo(self.nodes[0].getnewaddress()) result = self.nodes[1].importmulti([{ @@ -134,7 +136,8 @@ class ImportMultiTest(BitcoinTestFramework): "address": address['address'] }, "timestamp": "now", - "pubkeys": [ address['pubkey'] ] + "pubkeys": [ address['pubkey'] ], + "internal": False }]) assert_equal(result[0]['success'], True) address_assert = self.nodes[1].getaddressinfo(address['address']) |