Skip to content

0.0.112 Bindings Branch #1810

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

Conversation

TheBlueMatt
Copy link
Collaborator

This is a rebase of the still-relevant commits from the 0.0.111-bindings branch as well as #1809 backported. This should suffice for 0.0.112 bindings.

TheBlueMatt and others added 7 commits October 27, 2022 20:15
+ remove MaybeReadableArgs trait as it is now unused
+ remove onion_utils::DecodeInput as it would've now needed to be parameterized
by the CustomOnionMessageHandler trait, and we'd like to avoid either
implementing DecodeInput in messenger or having onion_utils depend on
onion_message::*

Co-authored-by: Matt Corallo <[email protected]>
Co-authored-by: Valentine Wallace <[email protected]>
...as the bindings generation does not currently have the ability
to map a reference to a `NodeId` inside a tuple.
.. as the current C bindings generator isn't capable of handling
type aliases in generics in type alias definition currently.
Bindings can't handle references in return types, so reduce the
visibility to pub(crate).
Currently `Writeable` is mapped manually, making it impossible to
automatically map a trait method that is parameterized by
`Writeable` (as is true for the `write` method on `KVStore`).

Ultimately we'll want to move to automatically mapping `Writeable`
like any other trait (only manually mapping the std `Write` and
`Read` traits), so this is only a candidate for the bindings branch,
not upstream. That may take a few releases, however.
Re-exports in Rust make `use` statements a little shorter, but for
otherwise don't materially change a crate's API. Sadly, the C
bindings generator currently can't figure out re-exports, but it
also exports everything into one global namespace, so it doesn't
matter much anyway.
@TheBlueMatt TheBlueMatt force-pushed the 2022-10-112-bindings-base branch 2 times, most recently from fd03e49 to d6ae7e3 Compare October 27, 2022 21:14
This doesn't change the API expressibility as its currently the
only type of message that can be sent, but avoids a generation
failure as we can't call `&self` methods on complex enums unless
we can `clone` all the inner fields. The correct solution to this
is to simply not expose those methods (which sucks, but at least
for `OnionMessageContents` they don't really matter), but that
doesn't have to come now.
@TheBlueMatt TheBlueMatt force-pushed the 2022-10-112-bindings-base branch from d6ae7e3 to 83af710 Compare October 27, 2022 21:29
@codecov-commenter
Copy link

codecov-commenter commented Oct 27, 2022

Codecov Report

Base: 90.70% // Head: 90.73% // Increases project coverage by +0.03% 🎉

Coverage data is based on head (83af710) compared to base (42ab358).
Patch coverage: 88.46% of modified lines in pull request are covered.

Additional details and impacted files
@@                 Coverage Diff                  @@
##           0.0.112-bindings    #1810      +/-   ##
====================================================
+ Coverage             90.70%   90.73%   +0.03%     
====================================================
  Files                    87       87              
  Lines                 47364    47363       -1     
  Branches              47364    47363       -1     
====================================================
+ Hits                  42962    42977      +15     
+ Misses                 4402     4386      -16     
Impacted Files Coverage Δ
lightning-rapid-gossip-sync/src/lib.rs 91.35% <ø> (ø)
lightning/src/ln/chan_utils.rs 93.99% <0.00%> (ø)
lightning/src/ln/peer_handler.rs 55.82% <0.00%> (ø)
lightning/src/routing/scoring.rs 96.61% <ø> (ø)
lightning/src/util/persist.rs 95.23% <ø> (ø)
lightning/src/util/ser.rs 91.66% <ø> (ø)
lightning/src/ln/msgs.rs 86.24% <50.00%> (ø)
lightning/src/ln/onion_utils.rs 94.87% <100.00%> (-0.05%) ⬇️
lightning/src/onion_message/functional_tests.rs 95.48% <100.00%> (ø)
lightning/src/onion_message/messenger.rs 90.04% <100.00%> (+0.09%) ⬆️
... and 6 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@TheBlueMatt TheBlueMatt merged commit fe1be69 into lightningdevkit:0.0.112-bindings Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants