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

Function test_splice_sent_sigs_flag

tests/test_splicing.py:735–758  ·  view source on GitHub ↗
(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

733@pytest.mark.openchannel('v2')
734@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
735def test_splice_sent_sigs_flag(node_factory, bitcoind):
736 l1, l2 = node_factory.line_graph(2, fundamount=1000000,
737 wait_for_announce=True,
738 opts={'may_reconnect': True,
739 'allow_warning': True})
740
741 chan_id = l1.get_channel_id(l2)
742
743 funds_result = l1.rpc.fundpsbt("109000sat", 0, 0, excess_as_change=True)
744
745 result = l1.rpc.splice_init(chan_id, 100000, funds_result['psbt'])
746 result = l1.rpc.splice_update(chan_id, result['psbt'])
747 assert result['commitments_secured'] is False
748 result = l1.rpc.splice_update(chan_id, result['psbt'])
749 assert result['commitments_secured'] is True
750
751 # l2 contributed nothing so it signs first. These two lines bracket that:
752 # it has sent tx_signatures and is now waiting for l1's.
753 l2.daemon.wait_for_logs([r'peer_out WIRE_TX_SIGNATURES',
754 r'Splice: Awaiting signature message'])
755 assert l2.db_query("SELECT count(*) as c FROM channel_funding_inflights;")[0]['c'] == 1
756
757 assert l1.db_query("SELECT i_sent_sigs FROM channel_funding_inflights;")[0]['i_sent_sigs'] == 0
758 assert l2.db_query("SELECT i_sent_sigs FROM channel_funding_inflights;")[0]['i_sent_sigs'] == 1
759
760
761@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')

Callers

nothing calls this directly

Calls 7

line_graphMethod · 0.80
get_channel_idMethod · 0.80
fundpsbtMethod · 0.80
wait_for_logsMethod · 0.80
db_queryMethod · 0.80
splice_initMethod · 0.45
splice_updateMethod · 0.45

Tested by

no test coverage detected