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

Function test_nonnumeric_uniqueid

tests/test_runes.py:633–651  ·  view source on GitHub ↗

We always use numeric uniqueids, don't allow other forms

(node_factory)

Source from the content-addressed store, hash-verified

631
632
633def test_nonnumeric_uniqueid(node_factory):
634 """We always use numeric uniqueids, don't allow other forms"""
635 l1 = node_factory.get_node()
636
637 # "zero"
638 with pytest.raises(RpcError, match='should have valid numeric unique_id'):
639 l1.rpc.showrunes('pX1h8z05kg0WZqe0ogo_8MHOa7-8gVZNXTckyyLKuLk9emVybw==')
640
641 # "0andstr"
642 with pytest.raises(RpcError, match='should have valid numeric unique_id'):
643 l1.rpc.showrunes('1dYYAIxmjRDHbXUIpztpwDA0q7RrHKbXJd9Yhj50Dfc9MGFuZHN0cmluZw==')
644
645 # "9223372036854775809"
646 with pytest.raises(RpcError, match='should have valid numeric unique_id'):
647 l1.rpc.showrunes('cr7eQmdhPVqH3-M2g67JymP2zVKyZ_n5hhFk3IMSg5o9OTIyMzM3MjAzNjg1NDc3NTgwOQ==')
648
649 # No unique id!
650 with pytest.raises(RpcError, match='should have valid numeric unique_id'):
651 l1.rpc.showrunes('SaQlgbzu6SGAhANReucs7P8GLuVbSlPg30QG78UzNcY=')
652
653
654def test_showrune_id(node_factory):

Callers

nothing calls this directly

Calls 1

get_nodeMethod · 0.45

Tested by

no test coverage detected