Skip to content

Commit

Permalink
QA: rpc_psbt: Test that the wrong type cannot be given to named params
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr committed Nov 17, 2024
1 parent 450f5a1 commit 0d09c94
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/functional/rpc_psbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,16 @@ def test_psbt_input_keys(psbt_input, keys):
self.log.info("Test walletprocesspsbt raises if an invalid sighashtype is passed")
assert_raises_rpc_error(-8, "all is not a valid sighash parameter.", self.nodes[0].walletprocesspsbt, psbt, sighashtype="all")

self.log.info("Test walletprocesspsbt raises RPC error with options=boolean")
for b in (True, False):
assert_raises_rpc_error(-3, "JSON value of type bool is not of expected type object", self.nodes[0].walletprocesspsbt, psbt, options=b)

self.log.info("Test walletprocesspsbt raises RPC error with sign={options}")
assert_raises_rpc_error(-3, "JSON value of type object for field sign is not of expected type bool", self.nodes[0].walletprocesspsbt, psbt, sign={'sign': False})

self.log.info("Test walletprocesspsbt raises RPC help with both options and non-options sighashtype")
assert_raises_rpc_error(-1, "Arguments:", self.nodes[0].walletprocesspsbt, psbt, {'sign': False}, 'ALL')

self.log.info("Test decoding PSBT with per-input preimage types")
# note that the decodepsbt RPC doesn't check whether preimages and hashes match
hash_ripemd160, preimage_ripemd160 = random_bytes(20), random_bytes(50)
Expand Down

0 comments on commit 0d09c94

Please sign in to comment.