Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_psbt.py
Show All 26 Lines | class PSBTTest(BitcoinTestFramework): | ||||
def skip_test_if_missing_module(self): | def skip_test_if_missing_module(self): | ||||
self.skip_if_no_wallet() | self.skip_if_no_wallet() | ||||
def run_test(self): | def run_test(self): | ||||
# Create and fund a raw tx for sending 10 BTC | # Create and fund a raw tx for sending 10 BTC | ||||
psbtx1 = self.nodes[0].walletcreatefundedpsbt( | psbtx1 = self.nodes[0].walletcreatefundedpsbt( | ||||
[], {self.nodes[2].getnewaddress(): 10})['psbt'] | [], {self.nodes[2].getnewaddress(): 10})['psbt'] | ||||
# Node 1 should not be able to add anything to it but still return the psbtx same as before | # 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'] | 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'] | ||||
self.nodes[0].sendrawtransaction(final_tx) | self.nodes[0].sendrawtransaction(final_tx) | ||||
▲ Show 20 Lines • Show All 159 Lines • Show Last 20 Lines |