Hide InvoiceFeatures behind InvoiceBuilder API
authorJeffrey Czyz <jkczyz@gmail.com>
Wed, 28 Apr 2021 16:22:02 +0000 (09:22 -0700)
committerJeffrey Czyz <jkczyz@gmail.com>
Mon, 3 May 2021 23:23:24 +0000 (16:23 -0700)
commitb5f0ebab77961ce243fcf5a5fad3d4e161f4952a
tree5dc426adf43aeea69089f19adfe907337909098b
parent7310e2684c854e4da170e417715cf426206f2b5d
Hide InvoiceFeatures behind InvoiceBuilder API

Instead of relying on users to set an invoice's features correctly,
enforce the semantics inside InvoiceBuilder. For instance, if the user
sets a PaymentSecret then InvoiceBuilder should ensure the appropriate
feature bits are set. Thus, for this example, the TaggedField
abstraction can be retained while still ensuring BOLT 11 semantics at
the builder abstraction.
lightning-invoice/src/lib.rs
lightning-invoice/src/utils.rs
lightning-invoice/tests/ser_de.rs
lightning/src/ln/features.rs