Test that msat fields are integers in notifications also.
(node_factory)
| 408 | |
| 409 | |
| 410 | def test_numeric_msat_notification(node_factory): |
| 411 | """Test that msat fields are integers in notifications also.""" |
| 412 | # start a node with clnrest |
| 413 | rest_port = str(node_factory.get_unused_port()) |
| 414 | base_url = 'http://127.0.0.1:' + rest_port |
| 415 | l1, l2 = node_factory.get_nodes(2, opts=[{}, {'clnrest-port': rest_port, 'clnrest-protocol': 'http'}]) |
| 416 | node_factory.join_nodes([l1, l2], wait_for_announce=True) |
| 417 | http_session = http_session_with_retry() |
| 418 | |
| 419 | # create an invoice on l2 |
| 420 | inv = l2.rpc.invoice(5000000, 'test_invoice_payment_notification', 'test_invoice_payment_notification_description') |
| 421 | |
| 422 | # create rune authorizing listclnrest-notifications method |
| 423 | rune_clnrest_notifications = l2.rpc.createrune(restrictions=[["method=listclnrest-notifications"]])['rune'] |
| 424 | http_session.headers.update({"rune": rune_clnrest_notifications}) |
| 425 | notifications = notifications_received_via_websocket(l1, base_url, http_session, 'pay', [inv['bolt11']]) |
| 426 | filtered_notifications = [n for n in notifications if 'invoice_payment' in n] |
| 427 | |
| 428 | assert isinstance(filtered_notifications[0]['invoice_payment']['msat'], int) |
| 429 | assert filtered_notifications[0]['invoice_payment']['msat'] == 5000000 |
| 430 | |
| 431 | |
| 432 | def test_options(node_factory): |
nothing calls this directly
no test coverage detected