|
11 | 11 | import json |
12 | 12 | import os |
13 | 13 |
|
| 14 | +import IPython |
| 15 | + |
14 | 16 | MAX_BIP125_RBF_SEQUENCE = 0xfffffffd |
15 | 17 |
|
16 | 18 | # Create one-input, one-output, no-fee transaction: |
@@ -50,11 +52,13 @@ def run_basic_tests(self, confidential): |
50 | 52 | psbtx1 = self.nodes[0].walletcreatefundedpsbt([], {self.get_address(confidential, 2):10})['psbt'] |
51 | 53 |
|
52 | 54 | # Node 1 should not be able to add anything to it but still return the psbtx same as before |
53 | | - psbtx = self.nodes[1].walletprocesspsbt(psbtx1)['psbt'] |
| 55 | + psbtx = self.nodes[1].walletfillpsbtdata(psbtx1)['psbt'] |
54 | 56 | assert_equal(psbtx1, psbtx) |
55 | 57 |
|
56 | 58 | # Sign the transaction and send |
57 | | - signed_tx = self.nodes[0].walletprocesspsbt(psbtx)['psbt'] |
| 59 | + filled_tx = self.nodes[0].walletfillpsbtdata(psbtx)['psbt'] |
| 60 | + blinded_tx = self.nodes[0].blindpsbt(filled_tx) |
| 61 | + signed_tx = self.nodes[0].walletsignpsbt(blinded_tx)['psbt'] |
58 | 62 | final_tx = self.nodes[0].finalizepsbt(signed_tx)['hex'] |
59 | 63 | self.nodes[0].sendrawtransaction(final_tx) |
60 | 64 |
|
@@ -109,20 +113,26 @@ def run_basic_tests(self, confidential): |
109 | 113 |
|
110 | 114 | # spend single key from node 1 |
111 | 115 | rawtx = self.nodes[1].walletcreatefundedpsbt([{"txid":txid,"vout":p2wpkh_pos},{"txid":txid,"vout":p2sh_p2wpkh_pos},{"txid":txid,"vout":p2pkh_pos}], {self.get_address(confidential, 1):29.99})['psbt'] |
112 | | - walletprocesspsbt_out = self.nodes[1].walletprocesspsbt(rawtx) |
113 | | - assert_equal(walletprocesspsbt_out['complete'], True) |
114 | | - self.nodes[1].sendrawtransaction(self.nodes[1].finalizepsbt(walletprocesspsbt_out['psbt'])['hex']) |
| 116 | + filled = self.nodes[1].walletfillpsbtdata(rawtx)['psbt'] |
| 117 | + blinded = self.nodes[1].blindpsbt(filled) |
| 118 | + walletsignpsbt_out = self.nodes[1].walletsignpsbt(blinded) |
| 119 | + assert_equal(walletsignpsbt_out['complete'], True) |
| 120 | + self.nodes[1].sendrawtransaction(self.nodes[1].finalizepsbt(walletsignpsbt_out['psbt'])['hex']) |
115 | 121 |
|
116 | 122 | # partially sign multisig things with node 1 |
117 | 123 | psbtx = self.nodes[1].walletcreatefundedpsbt([{"txid":txid,"vout":p2wsh_pos},{"txid":txid,"vout":p2sh_pos},{"txid":txid,"vout":p2sh_p2wsh_pos}], {self.get_address(confidential, 1):29.99})['psbt'] |
118 | | - walletprocesspsbt_out = self.nodes[1].walletprocesspsbt(psbtx) |
119 | | - psbtx = walletprocesspsbt_out['psbt'] |
120 | | - assert_equal(walletprocesspsbt_out['complete'], False) |
| 124 | + filled = self.nodes[1].walletfillpsbtdata(psbtx)['psbt'] |
| 125 | + # have both nodes fill before we try to blind and sign |
| 126 | + filled = self.nodes[2].walletfillpsbtdata(filled)['psbt'] |
| 127 | + blinded = self.nodes[1].blindpsbt(filled) |
| 128 | + walletsignpsbt_out = self.nodes[1].walletsignpsbt(blinded) |
| 129 | + psbtx = walletsignpsbt_out['psbt'] |
| 130 | + assert_equal(walletsignpsbt_out['complete'], False) |
121 | 131 |
|
122 | 132 | # partially sign with node 2. This should be complete and sendable |
123 | | - walletprocesspsbt_out = self.nodes[2].walletprocesspsbt(psbtx) |
124 | | - assert_equal(walletprocesspsbt_out['complete'], True) |
125 | | - self.nodes[2].sendrawtransaction(self.nodes[2].finalizepsbt(walletprocesspsbt_out['psbt'])['hex']) |
| 133 | + walletsignpsbt_out = self.nodes[2].walletsignpsbt(psbtx) |
| 134 | + assert_equal(walletsignpsbt_out['complete'], True) |
| 135 | + self.nodes[2].sendrawtransaction(self.nodes[2].finalizepsbt(walletsignpsbt_out['psbt'])['hex']) |
126 | 136 |
|
127 | 137 | # check that walletprocesspsbt fails to decode a non-psbt |
128 | 138 | rawtx = self.nodes[1].createrawtransaction([{"txid":txid,"vout":p2wpkh_pos}], {self.get_address(confidential, 1):9.99}) |
|
0 commit comments