(node)
| 2088 | + len(l1.rpc.listchannels()['channels']) == 4) |
| 2089 | |
| 2090 | def get_gossip(node): |
| 2091 | out = subprocess.run(['devtools/gossipwith', |
| 2092 | '--network={}'.format(TEST_NETWORK), |
| 2093 | '--all-gossip', |
| 2094 | '--timeout-after=2', |
| 2095 | '{}@localhost:{}'.format(node.info['id'], node.port)], |
| 2096 | check=True, |
| 2097 | timeout=TIMEOUT, stdout=subprocess.PIPE).stdout |
| 2098 | |
| 2099 | msgs = [] |
| 2100 | while len(out): |
| 2101 | l, t = struct.unpack('>HH', out[0:4]) |
| 2102 | msg = out[2:2 + l] |
| 2103 | out = out[2 + l:] |
| 2104 | |
| 2105 | # Ignore pings, gossip_timestamp_filter, query_channel_range |
| 2106 | if t in (18, 263, 265): |
| 2107 | continue |
| 2108 | # channel_announcement node_announcement or channel_update |
| 2109 | assert t == 256 or t == 257 or t == 258 |
| 2110 | msgs.append(msg) |
| 2111 | |
| 2112 | return msgs |
| 2113 | |
| 2114 | assert len(get_gossip(l1)) == 5 |
| 2115 |
no test coverage detected