-
Notifications
You must be signed in to change notification settings - Fork 411
Small bindings tweaks for 0.0.118 #2679
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
Small bindings tweaks for 0.0.118 #2679
Conversation
Bindings aren't currently able to handle a struct with a generic which is actually exposed - we map all structs concretely to a single type, whereas having fluctuating types on a struct requires mapping the inner field to a trait first. Since this isn't super practical, we make `PendingOnionMessage` a tuple in bindings, rather than a struct.
rustc doesn't allow `--features` with `-p`, so we simply skip the steps that rely on it.
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #2679 +/- ##
==========================================
- Coverage 88.76% 88.75% -0.02%
==========================================
Files 112 112
Lines 88460 88474 +14
Branches 88460 88474 +14
==========================================
Hits 78525 78525
- Misses 7698 7707 +9
- Partials 2237 2242 +5
☔ View full report in Codecov by Sentry. |
/// Typically, this is used for messages initiating a message flow rather than in response to | ||
/// another message. The latter should use the return value of [`Self::handle_custom_message`]. | ||
#[cfg(c_bindings)] | ||
fn release_pending_custom_messages(&self) -> Vec<(Self::CustomMessage, Destination, Option<BlindedPath>)>; |
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.
Does this need to change if PendingOnionMessage
is a type alias for a tuple in bindings? If it does, then it doesn't seem like PendingOnionMessage
needs to be pub
for bindings.
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.
Right, that is the first thing I tried and it didn't really work. Type aliases in bindings are handled a bit specifically for cases we rely on (eg the scorer), so it didn't quite work here. I will drop it to not be pub.
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.
Actually, reverted this. onion_messages/mod.rs re-exports it as pub
so it doesnt compile as pub-crate, and I'd rather not have any more diff than is required. There's no reason not to export it, the bindings won't include it anyway.
35eb38d
to
c40fc0f
Compare
$ git diff-tree -U1 35eb38df c40fc0fb
diff --git a/lightning/src/onion_message/messenger.rs b/lightning/src/onion_message/messenger.rs
index cf0f9e086..10991e037 100644
--- a/lightning/src/onion_message/messenger.rs
+++ b/lightning/src/onion_message/messenger.rs
@@ -178,3 +178,3 @@ pub struct PendingOnionMessage<T: OnionMessageContents> {
/// enqueued for sending.
-pub type PendingOnionMessage<T: OnionMessageContents> = (T, Destination, Option<BlindedPath>);
+pub(crate) type PendingOnionMessage<T: OnionMessageContents> = (T, Destination, Option<BlindedPath>);
$ |
c40fc0f
to
35eb38d
Compare
Okay, actually the last PR, I promise.