(node_factory)
| 89 | |
| 90 | |
| 91 | def test_invoice_weirdstring(node_factory): |
| 92 | l1 = node_factory.get_node() |
| 93 | |
| 94 | weird_label = 'label \\ " \t \n' |
| 95 | weird_desc = 'description \\ " \t \n' |
| 96 | l1.rpc.invoice(123000, weird_label, weird_desc) |
| 97 | # FIXME: invoice RPC should return label! |
| 98 | |
| 99 | # Can find by this label. |
| 100 | inv = only_one(l1.rpc.listinvoices(weird_label)['invoices']) |
| 101 | assert inv['label'] == weird_label |
| 102 | |
| 103 | # Can find this in list. |
| 104 | inv = only_one(l1.rpc.listinvoices()['invoices']) |
| 105 | assert inv['label'] == weird_label |
| 106 | |
| 107 | b11 = l1.rpc.decode(inv['bolt11']) |
| 108 | assert b11['description'] == weird_desc |
| 109 | |
| 110 | # Can delete by weird label. |
| 111 | l1.rpc.delinvoice(weird_label, "unpaid") |
| 112 | |
| 113 | # We can also use numbers as labels. |
| 114 | weird_label = 25 |
| 115 | weird_desc = '"' |
| 116 | l1.rpc.invoice(123000, weird_label, weird_desc) |
| 117 | # FIXME: invoice RPC should return label! |
| 118 | |
| 119 | # Can find by this label. |
| 120 | inv = only_one(l1.rpc.listinvoices(weird_label)['invoices']) |
| 121 | assert inv['label'] == str(weird_label) |
| 122 | |
| 123 | # Can find this in list. |
| 124 | inv = only_one(l1.rpc.listinvoices()['invoices']) |
| 125 | assert inv['label'] == str(weird_label) |
| 126 | |
| 127 | b11 = l1.rpc.decode(inv['bolt11']) |
| 128 | assert b11['description'] == weird_desc |
| 129 | |
| 130 | # Can delete by weird label. |
| 131 | l1.rpc.delinvoice(weird_label, "unpaid") |
| 132 | |
| 133 | |
| 134 | def test_invoice_preimage(node_factory): |
nothing calls this directly
no test coverage detected