Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_psbt.py
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
[{"txid": utxo1['txid'], | [{"txid": utxo1['txid'], | ||||
"vout": utxo1['vout']}], | "vout": utxo1['vout']}], | ||||
{self.nodes[2].getnewaddress(): 90000000}) | {self.nodes[2].getnewaddress(): 90000000}) | ||||
psbtx1 = self.nodes[0].walletcreatefundedpsbt([{"txid": utxo1['txid'], "vout": utxo1['vout']}], { | psbtx1 = self.nodes[0].walletcreatefundedpsbt([{"txid": utxo1['txid'], "vout": utxo1['vout']}], { | ||||
self.nodes[2].getnewaddress(): 90000000}, 0, {"add_inputs": True})['psbt'] | self.nodes[2].getnewaddress(): 90000000}, 0, {"add_inputs": True})['psbt'] | ||||
assert_equal(len(self.nodes[0].decodepsbt(psbtx1)['tx']['vin']), 2) | 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 | # Node 1 should not be able to add anything to it but still return the | ||||
# psbtx same as before | # psbtx same as before | ||||
psbtx = self.nodes[1].walletprocesspsbt(psbtx1)['psbt'] | psbtx = self.nodes[1].walletprocesspsbt(psbtx1)['psbt'] | ||||
assert_equal(psbtx1, psbtx) | assert_equal(psbtx1, psbtx) | ||||
# Sign the transaction and send | # Sign the transaction and send | ||||
signed_tx = self.nodes[0].walletprocesspsbt(psbtx)['psbt'] | signed_tx = self.nodes[0].walletprocesspsbt(psbtx)['psbt'] | ||||
final_tx = self.nodes[0].finalizepsbt(signed_tx)['hex'] | final_tx = self.nodes[0].finalizepsbt(signed_tx)['hex'] | ||||
▲ Show 20 Lines • Show All 417 Lines • Show Last 20 Lines |