Merge bitcoin/bitcoin#31635: test: add coverage for unknown address type for createwalletdescriptor

4da7bfdcc9 test: add coverage for unknown address type for `createwalletdescriptor` (brunoerg)

Pull request description:

  Calling `createwalletdescriptor` RPC with an unknown address type throws an error. This PR adds test coverage for it as done for other RPCs (`getnewaddress `, `getrawchangeaddress`, etc).

ACKs for top commit:
  maflcko:
    lgtm ACK 4da7bfdcc9
  rkrux:
    tACK 4da7bfdcc9

Tree-SHA512: 490bc3ffeb70b0f26db0a44d3950d7410fef35d4056487f2e82c081fb14ca277a18943c487235e0163a29f90fc741a262c29835beb9f41936affa4e73ddad25f
This commit is contained in:
merge-script 2025-01-23 12:50:38 +00:00
commit 188b02116d
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1

View file

@ -369,6 +369,8 @@ class AddressTypeTest(BitcoinTestFramework):
assert_raises_rpc_error(-5, "Unknown address type ''", self.nodes[3].getnewaddress, None, '')
assert_raises_rpc_error(-5, "Unknown address type ''", self.nodes[3].getrawchangeaddress, '')
assert_raises_rpc_error(-5, "Unknown address type 'bech23'", self.nodes[3].getrawchangeaddress, 'bech23')
if self.options.descriptors:
assert_raises_rpc_error(-5, "Unknown address type 'bech23'", self.nodes[3].createwalletdescriptor, "bech23")
self.log.info("Nodes with changetype=p2sh-segwit never use a P2WPKH change output")
self.test_change_output_type(4, [to_address_bech32_1], 'p2sh-segwit')