lnd icon indicating copy to clipboard operation
lnd copied to clipboard

lnrpc: Add metadata field to `AddInvoice` and `DecodePayReq`

Open Polsaker opened this issue 8 months ago • 1 comments

Change Description

Add the ability to set the invoice Metadata field in the AddInvoice RPC and to see said metadata via DecodePayReq. This is very useful when needing to send some bytes with the invoice while still allowing the user to use the Memo field for messages

Steps to Test

  1. Create an invoice using the AddInvoice RPC and using the metadata field.
  2. Decode said invoice with DecodePayReq and observe the metadata field.

Pull Request Checklist

Testing

  • [X] Your PR passes all CI checks.
  • [X] Tests covering the positive and negative (error paths) are included.
  • [ ] Bug fixes contain tests triggering the bug to prevent regressions.

Code Style and Documentation

📝 Please see our Contribution Guidelines for further guidance.

Polsaker avatar Jun 27 '24 19:06 Polsaker