feat: uniffi wrapper for payment preimage #6
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.
What this PR does
In a bid to create a uniffi wrapper for
PaymentPreimageas aninterface object, we also create bindings-specific variants for the
following types:
LightningBalance,PaymentKind, andEvent,All of which have fields that hold object/interface instances -
PaymentPreimage,ConfirmationStatusandClosureReason.This is not currently supported in uniffi 0.27.3
To workaround this limitation, we
Arcthese types and implement type conversionfor the new FFI types created.
Unfortunately this also does not build. Even though, according to the uniffi docs:
this
Arc-ing the fields that holdPaymentPreimage,ConfirmationStatus,&
ClosureReasonin the related enums is not sufficient to circumventthe error associated with objects not being supported in enum variants.
Update
We discover that support for interface in enum variant fields have been added to uniffi 0.30.0
but this upgrade will bring in a significant amount of changes to the entire library, discounting
the boilerplate required to support exposing
PaymentPreimageto FFI as an interface object.Following conversations with maintainer, we agree to pause this feature work so that blocked
PRs can move forward. See some related conversation here.