MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_sendpsbt_confirm

Function test_sendpsbt_confirm

tests/test_wallet.py:2541–2565  ·  view source on GitHub ↗

We should see our sendpsbt in wallet, and that it gets confirmed

(node_factory, bitcoind, restart)

Source from the content-addressed store, hash-verified

2539@pytest.mark.parametrize("restart", [False, True])
2540@unittest.skipIf(TEST_NETWORK != 'regtest', "elementsd doesn't support psbt features we need")
2541def test_sendpsbt_confirm(node_factory, bitcoind, restart):
2542 """We should see our sendpsbt in wallet, and that it gets confirmed"""
2543 l1, l2 = node_factory.get_nodes(2)
2544 l1.fundwallet(100000)
2545
2546 psbt = l1.rpc.fundpsbt(satoshi=10000,
2547 feerate=7500,
2548 startweight=42)['psbt']
2549 psbt = l2.rpc.addpsbtoutput(10000, psbt)['psbt']
2550 psbt = l1.rpc.signpsbt(psbt)['signed_psbt']
2551 sent = l1.rpc.sendpsbt(psbt)
2552
2553 # Unconfirmed
2554 lt = only_one([t for t in l1.rpc.listtransactions()['transactions'] if t['rawtx'] == sent['tx']])
2555 assert lt['blockheight'] == 0
2556
2557 if restart:
2558 l1.restart()
2559
2560 bitcoind.generate_block(1, wait_for_mempool=sent['txid'])
2561 sync_blockheight(bitcoind, [l1])
2562
2563 # Should be confirmed now!
2564 lt = only_one([t for t in l1.rpc.listtransactions()['transactions'] if t['rawtx'] == sent['tx']])
2565 assert lt['blockheight'] == bitcoind.rpc.getblockcount()
2566
2567
2568def test_old_htlcs_cleanup(node_factory, bitcoind):

Callers

nothing calls this directly

Calls 11

only_oneFunction · 0.90
sync_blockheightFunction · 0.90
get_nodesMethod · 0.80
fundwalletMethod · 0.80
fundpsbtMethod · 0.80
addpsbtoutputMethod · 0.80
signpsbtMethod · 0.80
sendpsbtMethod · 0.80
listtransactionsMethod · 0.80
restartMethod · 0.80
generate_blockMethod · 0.80

Tested by

no test coverage detected