aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOliver Gugger <gugger@gmail.com>2020-09-12 17:16:23 +0200
committerOliver Gugger <gugger@gmail.com>2020-10-02 17:15:52 +0200
commita56e9f5670136b29e48aabfc7f38569222fe4635 (patch)
tree1e78a3f9e0effd12327aa9a16913f6019d5363c1 /test
parent64bc5efd39bad3212a1d57fd6234b544a14bb974 (diff)
test: Assert exclusive PSBT funding options
Make sure the options "change_type" and "changeAddress" of the walletcreatefundedpsbt RPC cannot both be specified a the same time.
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/rpc_psbt.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py
index c2e7fac7b7..2453a947cb 100755
--- a/test/functional/rpc_psbt.py
+++ b/test/functional/rpc_psbt.py
@@ -320,6 +320,10 @@ class PSBTTest(BitcoinTestFramework):
psbtx_np2wkh = self.nodes[1].walletcreatefundedpsbt([], [small_output], 0, {"change_type":"p2sh-segwit"})
self.assert_change_type(psbtx_np2wkh, "scripthash")
+ # Make sure the change type cannot be specified if a change address is given
+ invalid_options = {"change_type":"legacy","changeAddress":self.nodes[0].getnewaddress()}
+ assert_raises_rpc_error(-8, "both change address and address type options", self.nodes[0].walletcreatefundedpsbt, [], [small_output], 0, invalid_options)
+
# Regression test for 14473 (mishandling of already-signed witness transaction):
psbtx_info = self.nodes[0].walletcreatefundedpsbt([{"txid":unspent["txid"], "vout":unspent["vout"]}], [{self.nodes[2].getnewaddress():unspent["amount"]+1}], 0, {"add_inputs": True})
complete_psbt = self.nodes[0].walletprocesspsbt(psbtx_info["psbt"])