(node_factory)
| 1393 | |
| 1394 | |
| 1395 | def test_gossipwith(node_factory): |
| 1396 | l1, l2 = node_factory.line_graph(2, wait_for_announce=True) |
| 1397 | |
| 1398 | out = subprocess.run(['devtools/gossipwith', |
| 1399 | '--all-gossip', |
| 1400 | '--network={}'.format(TEST_NETWORK), |
| 1401 | '--timeout-after={}'.format(int(math.sqrt(TIMEOUT) + 1)), |
| 1402 | '{}@localhost:{}'.format(l1.info['id'], l1.port)], |
| 1403 | check=True, |
| 1404 | timeout=TIMEOUT, stdout=subprocess.PIPE).stdout |
| 1405 | |
| 1406 | msgs = set() |
| 1407 | while len(out): |
| 1408 | l, t = struct.unpack('>HH', out[0:4]) |
| 1409 | msg = out[2:2 + l] |
| 1410 | out = out[2 + l:] |
| 1411 | |
| 1412 | # Ignore pings, gossip_timestamp_filter, query_channel_range |
| 1413 | if t in (18, 263, 265): |
| 1414 | continue |
| 1415 | # channel_announcement node_announcement or channel_update |
| 1416 | assert t == 256 or t == 257 or t == 258 |
| 1417 | msgs.add(msg) |
| 1418 | |
| 1419 | # one channel announcement, two channel_updates, two node announcements. |
| 1420 | # due to initial blast, we can have duplicates! |
| 1421 | assert len(msgs) == 5 |
| 1422 | |
| 1423 | |
| 1424 | def test_gossip_notices_close(node_factory, bitcoind): |
nothing calls this directly
no test coverage detected