Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_psbt.py
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
p2sh_pos = out['n'] | p2sh_pos = out['n'] | ||||
elif out['scriptPubKey']['addresses'][0] == p2pkh: | elif out['scriptPubKey']['addresses'][0] == p2pkh: | ||||
p2pkh_pos = out['n'] | p2pkh_pos = out['n'] | ||||
# spend single key from node 1 | # spend single key from node 1 | ||||
rawtx = self.nodes[1].walletcreatefundedpsbt([{"txid": txid, "vout": p2pkh_pos}], { | rawtx = self.nodes[1].walletcreatefundedpsbt([{"txid": txid, "vout": p2pkh_pos}], { | ||||
self.nodes[1].getnewaddress(): 9.99})['psbt'] | self.nodes[1].getnewaddress(): 9.99})['psbt'] | ||||
walletprocesspsbt_out = self.nodes[1].walletprocesspsbt(rawtx) | walletprocesspsbt_out = self.nodes[1].walletprocesspsbt(rawtx) | ||||
# Make sure it has UTXOs | |||||
decoded = self.nodes[1].decodepsbt(walletprocesspsbt_out['psbt']) | |||||
assert 'utxo' in decoded['inputs'][0] | |||||
assert_equal(walletprocesspsbt_out['complete'], True) | assert_equal(walletprocesspsbt_out['complete'], True) | ||||
self.nodes[1].sendrawtransaction( | self.nodes[1].sendrawtransaction( | ||||
self.nodes[1].finalizepsbt(walletprocesspsbt_out['psbt'])['hex']) | self.nodes[1].finalizepsbt(walletprocesspsbt_out['psbt'])['hex']) | ||||
# feeRate of 0.1 BCH / KB produces a total fee slightly below -maxtxfee | # feeRate of 0.1 BCH / KB produces a total fee slightly below -maxtxfee | ||||
res = self.nodes[1].walletcreatefundedpsbt( | res = self.nodes[1].walletcreatefundedpsbt( | ||||
[ | [ | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 346 Lines • Show Last 20 Lines |