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

Function test_grpc_custommsg_notification

tests/test_cln_rs.py:615–634  ·  view source on GitHub ↗
(node_factory)

Source from the content-addressed store, hash-verified

613
614
615def test_grpc_custommsg_notification(node_factory):
616 l1, l2 = node_factory.get_nodes(2)
617
618 # Test the connect notification
619 custommsg_stream = l1.grpc.SubscribeCustomMsg(clnpb.StreamCustomMsgRequest())
620 l2.connect(l1)
621
622 # Send the custom-msg to node l1
623 # The payload doesn't matter.
624 # It just needs to be valid hex which encodes to an odd BOLT-8 msg id
625 l2.rpc.sendcustommsg(l1.info["id"], "3131313174657374")
626
627 for custommsg in custommsg_stream:
628 # Ignore peer storage message!
629 if custommsg.payload.hex().startswith('0007'):
630 continue
631 assert custommsg.peer_id.hex() == l2.info["id"]
632 assert custommsg.payload.hex() == "3131313174657374"
633 assert custommsg.payload == b"1111test"
634 break
635
636
637def test_bip353(node_factory):

Callers

nothing calls this directly

Calls 4

get_nodesMethod · 0.80
sendcustommsgMethod · 0.80
SubscribeCustomMsgMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected