diff options
author | MacroFake <falke.marco@gmail.com> | 2022-10-31 16:45:55 +0100 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-10-31 16:46:00 +0100 |
commit | 4ff9be5c33441007dd1503b0b0cb6a5ae4cf82b2 (patch) | |
tree | 982aa3aff0bda11a439719e56b0505778ec541c4 /test | |
parent | 6164618964549f44beb48c796ef12b14452fab4f (diff) | |
parent | 403de22119f5c65a9fd43a665c469512b967ed38 (diff) | |
download | bitcoin-4ff9be5c33441007dd1503b0b0cb6a5ae4cf82b2.tar.xz |
Merge bitcoin/bitcoin#26413: [22.1] Backports
403de22119f5c65a9fd43a665c469512b967ed38 rpc: add non-regression test about deriveaddresses crash when index is 2147483647 (muxator)
db20d278e212b2a393a331624184a61fab6c05c9 rpc: fix crash in deriveaddresses when derivation index is 2147483647 (muxator)
d174db0f3ded1055555b998225090ebb130ca00d Adjust `.tx/config` for new Transifex CLI (Hennadii Stepanov)
Pull request description:
Currently backports:
* https://github.com/bitcoin/bitcoin/pull/26275
* https://github.com/bitcoin/bitcoin/pull/26321
Will leave open to collect backports for 22.1,
ACKs for top commit:
MarcoFalke:
cherry-pick ACK 403de22119f5c65a9fd43a665c469512b967ed38 🏔
Tree-SHA512: f9095a5cad52ecb9580fcaf173a05148dce382ac773a6116e2aed47009402bdfa6cbce62e488fe96120f7a0a81a623eb3e0e4539fa88670adb8c14cf5e334fa5
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/rpc_deriveaddresses.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/functional/rpc_deriveaddresses.py b/test/functional/rpc_deriveaddresses.py index 42d7d59d56..a69326736d 100755 --- a/test/functional/rpc_deriveaddresses.py +++ b/test/functional/rpc_deriveaddresses.py @@ -44,6 +44,13 @@ class DeriveaddressesTest(BitcoinTestFramework): combo_descriptor = descsum_create("combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/0)") assert_equal(self.nodes[0].deriveaddresses(combo_descriptor), ["mtfUoUax9L4tzXARpw1oTGxWyoogp52KhJ", "mtfUoUax9L4tzXARpw1oTGxWyoogp52KhJ", address, "2NDvEwGfpEqJWfybzpKPHF2XH3jwoQV3D7x"]) + # Before #26275, bitcoind would crash when deriveaddresses was + # called with derivation index 2147483647, which is the maximum + # positive value of a signed int32, and - currently - the + # maximum value that the deriveaddresses bitcoin RPC call + # accepts as derivation index. + assert_equal(self.nodes[0].deriveaddresses(descsum_create("wpkh(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/*)"), [2147483647, 2147483647]), ["bcrt1qtzs23vgzpreks5gtygwxf8tv5rldxvvsyfpdkg"]) + hardened_without_privkey_descriptor = descsum_create("wpkh(tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B/1'/1/0)") assert_raises_rpc_error(-5, "Cannot derive script without private keys", self.nodes[0].deriveaddresses, hardened_without_privkey_descriptor) |