aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2020-06-08 19:27:16 -0400
committerfanquake <fanquake@gmail.com>2020-07-03 09:22:21 +0800
commitcf0b5a933da540416b530ca6eb0259ab18cc6548 (patch)
tree9feca7935e846429041955d37121b04eb45c0652
parent3228b59b1761a80bca6aa7309cb46db5acafc905 (diff)
downloadbitcoin-cf0b5a933da540416b530ca6eb0259ab18cc6548.tar.xz
tests: Check that segwit inputs in psbt have both UTXO types
Github-Pull: #19215 Rebased-From: 84d295e51341a126a6c3cbeea7a8caa04c7b5bc3
-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 285c38161c..b8586f255c 100755
--- a/test/functional/rpc_psbt.py
+++ b/test/functional/rpc_psbt.py
@@ -134,6 +134,10 @@ class PSBTTest(BitcoinTestFramework):
# spend single key from node 1
rawtx = self.nodes[1].walletcreatefundedpsbt([{"txid":txid,"vout":p2wpkh_pos},{"txid":txid,"vout":p2sh_p2wpkh_pos},{"txid":txid,"vout":p2pkh_pos}], {self.nodes[1].getnewaddress():29.99})['psbt']
walletprocesspsbt_out = self.nodes[1].walletprocesspsbt(rawtx)
+ # Make sure it has both types of UTXOs
+ decoded = self.nodes[1].decodepsbt(walletprocesspsbt_out['psbt'])
+ assert 'non_witness_utxo' in decoded['inputs'][0]
+ assert 'witness_utxo' in decoded['inputs'][0]
assert_equal(walletprocesspsbt_out['complete'], True)
self.nodes[1].sendrawtransaction(self.nodes[1].finalizepsbt(walletprocesspsbt_out['psbt'])['hex'])