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

Function test_listforwards_ancient

tests/test_misc.py:3790–3809  ·  view source on GitHub ↗

Test listforwards command with old records.

(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

3788
3789@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "modifies database, which is assumed sqlite3")
3790def test_listforwards_ancient(node_factory, bitcoind):
3791 """Test listforwards command with old records."""
3792 l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True)
3793
3794 amt1 = 1000
3795 inv1 = l3.rpc.invoice(amt1, 'inv1', 'desc')
3796 l1.rpc.xpay(inv1['bolt11'])
3797
3798 forwards = l2.rpc.listforwards()['forwards']
3799 assert len(forwards) == 1
3800 assert forwards[0]['received_time']
3801
3802 # Make this forward look like an older record, with received_time default 0.
3803 l2.stop()
3804 l2.db_manip("UPDATE forwards SET received_time=0;")
3805 l2.start()
3806
3807 forwards = l2.rpc.listforwards()['forwards']
3808 assert len(forwards) == 1
3809 assert forwards[0]['received_time'] == 0
3810
3811
3812@pytest.mark.openchannel('v1')

Callers

nothing calls this directly

Calls 7

line_graphMethod · 0.80
listforwardsMethod · 0.80
db_manipMethod · 0.80
invoiceMethod · 0.45
xpayMethod · 0.45
stopMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected