Skip to content

0.0.117 Bindings Changes #2644

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

Luckily a bit less than 0.0.116 now that we landed some bits upstream.

TheBlueMatt and others added 14 commits October 3, 2023 23:22
...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).
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.
The bindings currently get confused by the implicit `Sign` type, so
we temporarily remove it on the `impl` here.
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.
Having struct fields with references to other structs is tough in
our bindings logic, but even worse if the fields are in an enum.
Its simplest to just take the clone penalty here.
These really could be handled in the bindings, but for lack of
immediate users there's not a strong reason to, so instead we just
disable them for now.
The scorer currently relies on an associated type for the fee
parameters. This isn't supportable at all in bindings, and for
lack of a better option we simply hard-code the parameter for all
scorers  to `ProbabilisticScoringFeeParameters`.
These are not expressible in C/most languages, and thus must be
hidden.
Rather than `ChannelMonitor` only being clonable when the signer is
clonable, we require all signers to be clonable and then make all
`ChannelMonitor`s clonable.
@@ -418,6 +420,8 @@ impl Utxo {
}

/// Returns a `Utxo` with the `satisfaction_weight` estimate for a SegWit v0 P2WPKH output.
///
/// This is not exported to bindings users as WPubkeyHash is not yet exported
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't you need to add the #cfg here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"This is not exported to bindings users" is a magic string for the bindings generator.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jesus christ. But ok

@@ -402,6 +402,8 @@ impl Utxo {
}

/// Returns a `Utxo` with the `satisfaction_weight` estimate for a P2WPKH nested in P2SH output.
///
/// This is not exported to bindings users as WPubkeyHash is not yet exported
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto here?

@TheBlueMatt TheBlueMatt merged commit 4b81eb2 into lightningdevkit:0.0.117-bindings Oct 4, 2023
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.

3 participants