Closed rorp closed 1 month ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 86.00%. Comparing base (
c8184b3
) to head (6d01eee
).
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
You seem to be doing more than just adding a
parseoffer
API in this PR, you're also adding support for Bolt 12 invoices which is arguably not a good idea...
Not at all. Only parseinvoice
was changed to support Bolt 12 invoices. The changes in other RPCs were made just to prevent MatchError
exceptions and avoid compiler errors.
Only parseinvoice was changed to support Bolt 12 invoices.
This is what threw me off, I don't think we should do this. But I may be wrong, @thomash-acinq do you think this would be useful?
If there was an explicit decision to hide Bolt 12 invoices from the user (I didn't realize it was removed from the spec), then we shouldn't expose them.
If it's only for debugging purposes, what I usually do is run this test:
test("show invoice"){
val encodedInvoice = "lni1qqgds4gw..."
val invoice = Bolt12Invoice.fromString(encodedInvoice).get
invoice.records.records.foreach(println)
}
Shelving this for now, as Bolt 12 invoices aren't supposed to be exposed yet. We can reopen this in the future when concrete use-cases need it.
This PR adds the ability to parse BOLT12 invoices to
parseinvoice
RPC call, and introducesparseoffer
RPC call, that parses BOLT12 offers.