A PSBT w/ one of our inputs should be signable (we can fill in the required UTXO data).
(node_factory, bitcoind, chainparams)
| 949 | |
| 950 | |
| 951 | def test_sign_external_psbt(node_factory, bitcoind, chainparams): |
| 952 | """ |
| 953 | A PSBT w/ one of our inputs should be signable (we can fill |
| 954 | in the required UTXO data). |
| 955 | """ |
| 956 | l1 = node_factory.get_node(feerates=(7500, 7500, 7500, 7500)) |
| 957 | amount = 1000000 |
| 958 | total_outs = 4 |
| 959 | |
| 960 | # Add a medley of funds to withdraw later |
| 961 | for i in range(total_outs): |
| 962 | bitcoind.rpc.sendtoaddress(l1.rpc.newaddr('bech32')['bech32'], |
| 963 | amount / 10**8) |
| 964 | |
| 965 | bitcoind.generate_block(1) |
| 966 | wait_for(lambda: len(l1.rpc.listfunds()['outputs']) == total_outs) |
| 967 | |
| 968 | # Build a PSBT using all our inputs, externally |
| 969 | inputs = [] |
| 970 | for inp in l1.rpc.listfunds()['outputs']: |
| 971 | inputs.append({'txid': inp['txid'], 'vout': inp['output']}) |
| 972 | addr = l1.rpc.newaddr('bech32')['bech32'] |
| 973 | psbt = bitcoind.rpc.createpsbt(inputs, [{addr: (amount * 3) / 10**8}]) |
| 974 | |
| 975 | l1.rpc.reserveinputs(psbt) |
| 976 | l1.rpc.signpsbt(psbt) |
| 977 | |
| 978 | |
| 979 | def test_sign_signed_psbt(node_factory, bitcoind, chainparams): |
nothing calls this directly
no test coverage detected