Skip to content

Commit

Permalink
Merge bitcoin/bitcoin#26723: test: call keypoolrefill with priv key…
Browse files Browse the repository at this point in the history
… disabled should throw an error

ec63a48 test: call `keypoolrefill` with private keys disabled should throw an error (brunoerg)

Pull request description:

  This PR adds test coverage for the following error:
  https://github.com/bitcoin/bitcoin/blob/cb32328d1b80d0ccd6eb9532bd8fe4e0a4de385e/src/wallet/rpc/addresses.cpp#L332-L334

ACKs for top commit:
  aureleoules:
    ACK ec63a48

Tree-SHA512: b5deda8981ff472f290e6e16c8723a58e02cbe099afd1f672c099f4add0a1d9b192b11a2c3f0e11b96794671f6b9efa75812b7a174248d7c58d7fd7d3310e7b9
  • Loading branch information
MarcoFalke committed Dec 19, 2022
2 parents 3d97496 + ec63a48 commit 8ab1923
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/functional/wallet_keypool.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ def run_test(self):
res = w2.walletcreatefundedpsbt(inputs=[], outputs=[{destination: 0.00010000}], options={"subtractFeeFromOutputs": [0], "feeRate": 0.00010, "changeAddress": addr.pop()})
assert_equal("psbt" in res, True)

if not self.options.descriptors:
msg = "Error: Private keys are disabled for this wallet"
assert_raises_rpc_error(-4, msg, w2.keypoolrefill, 100)

if __name__ == '__main__':
KeyPoolTest().main()

0 comments on commit 8ab1923

Please sign in to comment.