Skip to content

Commit 84d295e

Browse files
committed
tests: Check that segwit inputs in psbt have both UTXO types
1 parent 4600479 commit 84d295e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/functional/rpc_psbt.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ def run_test(self):
157157
# spend single key from node 1
158158
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']
159159
walletprocesspsbt_out = self.nodes[1].walletprocesspsbt(rawtx)
160+
# Make sure it has both types of UTXOs
161+
decoded = self.nodes[1].decodepsbt(walletprocesspsbt_out['psbt'])
162+
assert 'non_witness_utxo' in decoded['inputs'][0]
163+
assert 'witness_utxo' in decoded['inputs'][0]
160164
assert_equal(walletprocesspsbt_out['complete'], True)
161165
self.nodes[1].sendrawtransaction(self.nodes[1].finalizepsbt(walletprocesspsbt_out['psbt'])['hex'])
162166

0 commit comments

Comments
 (0)