[rpc] walletcreatefundedpsbt: allow inputs to be null

This is of neglible use here, but it allows new RPC methods to take outputs as their first argument and make inputs optional.
This commit is contained in:
Sjors Provoost committed 2020-09-07 20:33:16 +02:00
1 parent 2583966130
commit 1bc8d0fd59
3 files changed
+12 -4

No files matched your search

+3
View File
@@ -94,6 +94,9 @@ class PSBTTest(BitcoinTestFramework):
psbtx1 = self.nodes[0].walletcreatefundedpsbt([{"txid": utxo1['txid'], "vout": utxo1['vout']}], {self.nodes[2].getnewaddress():90}, 0, {"add_inputs": True})['psbt']
assert_equal(len(self.nodes[0].decodepsbt(psbtx1)['tx']['vin']), 2)
# Inputs argument can be null
self.nodes[0].walletcreatefundedpsbt(None, {self.nodes[2].getnewaddress():10})
# Node 1 should not be able to add anything to it but still return the psbtx same as before
psbtx = self.nodes[1].walletprocesspsbt(psbtx1)['psbt']
assert_equal(psbtx1, psbtx)