Skip to content

Commit

Permalink
pytest: listchannels filter by destination
Browse files Browse the repository at this point in the history
  • Loading branch information
m-schmoock committed Jun 25, 2021
1 parent 87e3ed2 commit 808983a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/test_gossip.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,18 @@ def test_gossip_jsonrpc(node_factory):
assert only_one(channels1)['destination'] == l2.info['id']
assert channels1 == channels2

l2.rpc.listchannels()['channels']
# Test listchannels-by-destination
channels1 = l1.rpc.listchannels(destination=l1.info['id'])['channels']
channels2 = l2.rpc.listchannels(destination=l1.info['id'])['channels']
assert only_one(channels1)['destination'] == l1.info['id']
assert only_one(channels1)['source'] == l2.info['id']
assert channels1 == channels2

# Test only one of short_channel_id, source or destination can be supplied
with pytest.raises(RpcError, match=r"Can only specify one of.*"):
l1.rpc.listchannels(source=l1.info['id'], destination=l2.info['id'])
with pytest.raises(RpcError, match=r"Can only specify one of.*"):
l1.rpc.listchannels(short_channel_id="1x1x1", source=l2.info['id'])

# Now proceed to funding-depth and do a full gossip round
l1.bitcoin.generate_block(5)
Expand Down

0 comments on commit 808983a

Please sign in to comment.