-
Notifications
You must be signed in to change notification settings - Fork 12
Update Bindings for latest Upstream LDK #24
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
Specifically, for the LDK `EventsProvider` trait, we can't (trivially) implement the `process_pending_events` function, defined as: `fn process_pending_events<H: Deref>(&self, handler: H) where H::Target: EventHandler;` We currently do not support implementing generic methods, as we'd need to wrap them in a generic Rust-trait-to-C-trait conversion utility, which we do not currently have. Thus, because users almost certainly have no reason to implement the `EventsProvider` themselves, its simpler to simply prevent the use of the C trait struct as the Rust trait. Concretely, this means just skipping the `impl rustEventsProvider for CEventsProvider` block, which works fine as no Rust functions take an `EventsProvider` as an argument.
|
Having difficulty running this on MacOS. + cd ..
+ mv lightning-c-bindings/src/c_types/mod.rs ./
+ mv lightning-c-bindings/src/bitcoin ./
+ git checkout lightning-c-bindings/src
+ git checkout lightning-c-bindings/include
++ git describe --tag --dirty
fatal: No names found, cannot describe anything.
+ BINDINGS_GIT= |
Getting the same error on #25 |
|
Couple errors in error[E0053]: method `process_pending_events` has an incompatible type for trait
--> src/lightning/util/events.rs:1125:2
|
1125 | fn process_pending_events<H:core::ops::Deref>(&self, mut handler: crate::lightning::util::events::EventHandler) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `H`, found struct `lightning::util::events::EventHandler`
|
= note: expected fn pointer `fn(&lightning::util::events::EventsProvider, H)`
found fn pointer `fn(&lightning::util::events::EventsProvider, lightning::util::events::EventHandler)`
error[E0055]: reached the recursion limit while auto-dereferencing `lightning::util::events::EventHandler`
--> src/lightning/util/events.rs:1126:56
|
1126 | (self.process_pending_events)(self.this_arg, handler.into())
| ^^^^ deref recursion limit reached
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`ldk`)
error: aborting due to 2 previous errors |
Huh, do you need |
jkczyz
left a comment
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.
Huh, do you need
git fetch --tags?
Same issue after running that.
c-bindings-gen/src/main.rs
Outdated
| let ref_type: syn::Type = syn::parse_quote!(&#path); | ||
| assert!(!types.write_to_c_conversion_new_var(w, &format_ident!("a"), &*i.self_ty, Some(&gen_types), false), "We don't support new var conversions when comparing equality"); | ||
|
|
||
| writeln!(w, "\t// Note that we'd love to use std::collections::hash_map::DefaultHasher but its not in core").unwrap(); |
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.
nit: it's
Right, oops, just forgot to check in the latest bindings, should work with genbindings.
Maybe |
Yes, that worked. |
|
Squashed the fixup and re-bumped the git head. Will merge if CI passes: |
No description provided.