Test listforwards command with old records.
(node_factory, bitcoind)
| 3788 | |
| 3789 | @unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "modifies database, which is assumed sqlite3") |
| 3790 | def 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') |
nothing calls this directly
no test coverage detected