-
Notifications
You must be signed in to change notification settings - Fork 411
Invoices crate #870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invoices crate #870
Conversation
Codecov Report
@@ Coverage Diff @@
## main #870 +/- ##
==========================================
- Coverage 90.62% 90.21% -0.42%
==========================================
Files 51 55 +4
Lines 27509 28904 +1395
==========================================
+ Hits 24931 26075 +1144
- Misses 2578 2829 +251
Continue to review full report at Codecov.
|
license = "Apache-2.0" | ||
documentation = "https://docs.rs/lightning-invoice/" | ||
repository = "https://github.com/rust-bitcoin/rust-lightning-invoice" | ||
license = "MIT OR Apache-2.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know much about licenses, but if you need my ok for this you hereby have it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sanity, can you git commit --amend --author="Sebastian <[email protected]>"
for the first commit and include a pointer in the commit message to the original repo?
Now that I'm thinking more about it, and its pretty much "the wrong way", but I think we could accomplish all we want by (a) adapting bindings to use all the workspace battery crates (which we should do anyway), (b) adapting this crate to be bindings-able, or adapt the bindings to it, either way its a bunch of work and, (c) making this crate depend on the main lightning crate to use its types and expose some utilities that build invoices automagically.
Certainly (c) is a somewhat-awkward "dependency flows the wrong way"-type thing, but rustc should take care of the binary size if a downstream user doesn't use the dependency bits, and it also avoids having to merge the crates entirely, which maybe @sgeisler would prefer, and certainly seems kinda nice in terms of keeping the actual API surface "small".
Yes, I'd prefer it to stay a separate crate, merging the repos makes sense though. Making it depend on rust-lightning isn't that pretty, but possibly necessary. Idk if splitting rust-lightning is anything you'd want to do at some point, sometimes that's possible for some base types and could avoid some of the weirdness in the dependency graph (e.g. lightning-invoice would only depend on lightning-types). Thinking about it a bit more, why is it being a separate crate still useful when it depends on the whole of rust-lightning anyway? Maybe I'm not that opposed to uniting them if it would help, as the standalone use-case would be impacted either way. Once this lands we should remember to archive the repo and redirect people here. |
Right, in order to do this we'd have to create a crate that basically only provides
I guess its more subjective - I'm also happy with merging it wholesale, but if we do think there is value in a standalone/lightweight "invoice" crate, then its mostly a question of having it have a small API surface. Taking a full lightning dependency doesn't matter much because |
I think as longs as you see merit in it and it's only currently not really a priority enough keeping lightning-invoice separate keeps this option a bit more open. So I still have a slight preference for that. Otherwise modules tend to grow into each other (often needlessly) in my experience. |
Which, how do you feel about invoice depending on |
Sorry for being vague, I must have been quite tired. I meant that I have a preference for lightning-invoice being its own crate. The dependency on rust-lightning is ok for now imo and I'd hope once rust-lightning settles a bit and there is more time to address minor inconveniences, the "extra features crate" solution will become worth it. |
Right, then lets go for that for now. We can take this PR as-is once comments are addressed then make it depend on |
0d124d3
to
c3d25ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK under the assumption that f00bb10 is a pure copy operation which I did not check.
Add the invoices crate to Rust-Lightning. cc @sgeisler We've had some user requests for using these features to RL language bindings, so the first step'd be pulling in the repo here.