Skip to content
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

Minor bindings tweaks #3061

Merged

Conversation

TheBlueMatt
Copy link
Collaborator

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented May 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.78%. Comparing base (1890e80) to head (e1d0006).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3061      +/-   ##
==========================================
- Coverage   89.82%   89.78%   -0.05%     
==========================================
  Files         116      116              
  Lines       96466    96466              
  Branches    96466    96466              
==========================================
- Hits        86655    86616      -39     
- Misses       7264     7294      +30     
- Partials     2547     2556       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Now that `ChannelId` has useful constructors and methods we need
to start exposing it to bindings users rather than relying on using
`[u8; 32]`.
This avoids the bindings trying to figure out what a
`lightning::prelude::Vec` is rather than matching it as a `Vec`.
`Amount` is less than two pointers long, so there's no reason it
shouldn't be `Copy`. Further, because its an enum, bindings can't
map a reference to it in an `Option`. Thus, here, we simply make it
`Copy` and return it in `Option`s rather than a reference to it.
This is required for bindings as passing types from Rust to GC'd
languages can't map the concept of a type that has a lifetime of
the called function but instead needs to clone for safety.
This matches our normal API semantics and allows, for example,
`Arc`s to `EntropySource`s.
@TheBlueMatt
Copy link
Collaborator Author

Eh, fair point, I just squashed the "add clone" commits and reworded slightly.

@valentinewallace valentinewallace merged commit da7a916 into lightningdevkit:main May 14, 2024
15 of 16 checks passed
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.

None yet

3 participants