-
Notifications
You must be signed in to change notification settings - Fork 403
Minor bindings tweaks #3061
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
Merged
valentinewallace
merged 8 commits into
lightningdevkit:main
from
TheBlueMatt:2024-05-bindings-upstream
May 14, 2024
Merged
Minor bindings tweaks #3061
valentinewallace
merged 8 commits into
lightningdevkit:main
from
TheBlueMatt:2024-05-bindings-upstream
May 14, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c6b5dc2
to
fd8a2d9
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ 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. |
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.
8721dee
to
ea0e287
Compare
valentinewallace
approved these changes
May 13, 2024
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.
ea0e287
to
e1d0006
Compare
Eh, fair point, I just squashed the "add clone" commits and reworded slightly. |
da7a916
into
lightningdevkit:main
15 of 16 checks passed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.