Commit 87e0514
Un-cfg-gate StaticInvoices
We need to include static invoices in the public API as part of the onion
messages we're adding for static invoice server support. Utilities to create
these static invoices and other parts of the async receive API will remain
cfg-gated for now. Generally, we can't totally avoid exposing half baked async
receive support in the public API because OnionMessenger is parameterized by an
async payments message handler, which can't be cfg-gated easily.
This contains the changes to the public API, to the original commit
made by Val, to fix the following clippy warning:
```
error: methods called `from_*` usually take no `self`
--> lightning/src/offers/static_invoice.rs:393:32
|
393 | pub(crate) fn from_same_offer(&self, invreq: &InvoiceRequest) -> bool {
| ^^^^^
|
= help: consider choosing a less ambiguous name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
= note: `-D clippy::wrong-self-convention` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::wrong_self_convention)]`
error: could not compile `lightning` (lib) due to 1 previous error
```
```
error[E0599]: no method named `bytes` found for reference `&InvoiceRequest` in the current scope
--> lightning/src/offers/static_invoice.rs:387:34
|
387 | Offer::tlv_stream_iter(invreq.bytes()).map(|tlv_record| tlv_record.record_bytes);
| ^^^^^-- help: remove the arguments
| |
| field, not a method
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `bytes`, perhaps you need to implement it:
candidate #1: `std::io::Read`
warning: variable does not need to be mutable
--> lightning/src/offers/offer.rs:261:4
|
261 | mut $self: $self_type, metadata: Vec<u8>,
| ----^^^^^
| |
| help: remove this `mut`
...
534 | offer_explicit_metadata_builder_methods!(self, &mut Self, (), ());
| ----------------------------------------------------------------- in this macro invocation
|
= note: `#[warn(unused_mut)]` on by default
= note: this warning originates in the macro `offer_explicit_metadata_builder_methods` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0599`.
```
Signed-off-by: Vincenzo Palazzo <[email protected]>1 parent 1fc2726 commit 87e0514
File tree
5 files changed
+9
-5
lines changed- lightning/src
- ln
- offers
5 files changed
+9
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1104 | 1104 | | |
1105 | 1105 | | |
1106 | 1106 | | |
1107 | | - | |
| 1107 | + | |
1108 | 1108 | | |
1109 | 1109 | | |
1110 | 1110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
861 | | - | |
| 861 | + | |
862 | 862 | | |
863 | 863 | | |
864 | 864 | | |
| |||
874 | 874 | | |
875 | 875 | | |
876 | 876 | | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
877 | 882 | | |
878 | 883 | | |
879 | 884 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
743 | 743 | | |
744 | 744 | | |
745 | 745 | | |
746 | | - | |
747 | 746 | | |
748 | 747 | | |
749 | 748 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
382 | | - | |
| 382 | + | |
| 383 | + | |
383 | 384 | | |
384 | 385 | | |
385 | 386 | | |
| |||
0 commit comments