Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_psbt.py
Show First 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# Combine, finalize, and send the psbts | # Combine, finalize, and send the psbts | ||||
combined = self.nodes[0].combinepsbt([psbt1, psbt2]) | combined = self.nodes[0].combinepsbt([psbt1, psbt2]) | ||||
finalized = self.nodes[0].finalizepsbt(combined)['hex'] | finalized = self.nodes[0].finalizepsbt(combined)['hex'] | ||||
self.nodes[0].sendrawtransaction(finalized) | self.nodes[0].sendrawtransaction(finalized) | ||||
self.nodes[0].generate(6) | self.nodes[0].generate(6) | ||||
self.sync_all() | self.sync_all() | ||||
block_height = self.nodes[0].getblockcount() | |||||
unspent = self.nodes[0].listunspent()[0] | unspent = self.nodes[0].listunspent()[0] | ||||
# Make sure change address wallet does not have P2SH innerscript access to results in success | |||||
# when attempting BnB coin selection | |||||
self.nodes[0].walletcreatefundedpsbt( | |||||
[], | |||||
[{self.nodes[2].getnewaddress():unspent["amount"] + 1}], | |||||
block_height + 2, | |||||
{"changeAddress": self.nodes[1].getnewaddress()}, | |||||
False) | |||||
# Regression test for 14473 (mishandling of already-signed | # Regression test for 14473 (mishandling of already-signed | ||||
# transaction): | # transaction): | ||||
psbtx_info = self.nodes[0].walletcreatefundedpsbt([{"txid": unspent["txid"], "vout":unspent["vout"]}], [ | psbtx_info = self.nodes[0].walletcreatefundedpsbt([{"txid": unspent["txid"], "vout":unspent["vout"]}], [ | ||||
{self.nodes[2].getnewaddress():unspent["amount"] + 1}]) | {self.nodes[2].getnewaddress():unspent["amount"] + 1}]) | ||||
complete_psbt = self.nodes[0].walletprocesspsbt(psbtx_info["psbt"]) | complete_psbt = self.nodes[0].walletprocesspsbt(psbtx_info["psbt"]) | ||||
double_processed_psbt = self.nodes[0].walletprocesspsbt( | double_processed_psbt = self.nodes[0].walletprocesspsbt( | ||||
complete_psbt["psbt"]) | complete_psbt["psbt"]) | ||||
assert_equal(complete_psbt, double_processed_psbt) | assert_equal(complete_psbt, double_processed_psbt) | ||||
▲ Show 20 Lines • Show All 211 Lines • Show Last 20 Lines |