(node_factory, chainparams)
| 439 | @unittest.skipIf(not TEST_NETWORK == 'regtest', 'must be on bitcoin network') |
| 440 | @pytest.mark.developer("needs DEVELOPER=1") |
| 441 | def test_bech32_funding(node_factory, chainparams): |
| 442 | # Don't get any funds from previous runs. |
| 443 | l1, l2 = node_factory.line_graph(2, opts={'random_hsm': True}, fundchannel=False) |
| 444 | |
| 445 | # fund a bech32 address and then open a channel with it |
| 446 | res = l1.openchannel(l2, 25000, 'bech32') |
| 447 | address = res['address'] |
| 448 | assert address.startswith(chainparams['bip173_prefix']) |
| 449 | |
| 450 | # probably overly paranoid checking |
| 451 | wallettxid = res['wallettxid'] |
| 452 | |
| 453 | wallettx = l1.bitcoin.rpc.getrawtransaction(wallettxid, True) |
| 454 | fundingtx = l1.bitcoin.rpc.decoderawtransaction(res['fundingtx']) |
| 455 | |
| 456 | def is_p2wpkh(output): |
| 457 | return output['type'] == 'witness_v0_keyhash' and \ |
| 458 | address == scriptpubkey_addr(output) |
| 459 | |
| 460 | assert any(is_p2wpkh(output['scriptPubKey']) for output in wallettx['vout']) |
| 461 | assert only_one(fundingtx['vin'])['txid'] == res['wallettxid'] |
| 462 | |
| 463 | |
| 464 | def test_withdraw_misc(node_factory, bitcoind, chainparams): |
nothing calls this directly
no test coverage detected