Skip to content

Remove mod/uni payjoin-ffi distinction#899

Merged
DanGould merged 6 commits intopayjoin:masterfrom
DanGould:no-uni-mod-distinction
Jul 26, 2025
Merged

Remove mod/uni payjoin-ffi distinction#899
DanGould merged 6 commits intopayjoin:masterfrom
DanGould:no-uni-mod-distinction

Conversation

@DanGould
Copy link
Contributor

@DanGould DanGould commented Jul 25, 2025

None of our bindings depend on a non-uniffi interface any longer. Remove it

Perhaps we still want language-specific features so dart isn't alwaysa dependency but this was my first step. I'd also like to separate the bindings modules to reflect the multiple files in the payjoin source as well. There are definitely a lot of formatting changes I'd like to see but I avoided as many as possible so that the logic can be compared on its own for reviewers. This is big enough as-is.

The bdk integration test was only testing the non-uniffi interface.
Because this is tested at the terminal bindings, this test has been
removed.

I chose to do this now because I'm overhauling the sender and FFI changes are way harder to review in two layers than one.

@coveralls
Copy link
Collaborator

coveralls commented Jul 25, 2025

Pull Request Test Coverage Report for Build 16542822689

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 85.783%

Totals Coverage Status
Change from base Build 16504632716: 0.0%
Covered Lines: 7862
Relevant Lines: 9165

💛 - Coveralls

@DanGould DanGould force-pushed the no-uni-mod-distinction branch 3 times, most recently from 77d434e to c16d8e2 Compare July 25, 2025 18:15
Copy link
Collaborator

@spacebear21 spacebear21 left a comment

Choose a reason for hiding this comment

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

concept ACK, looks like there are some missing uniffi exports causing the Python tests to fail.

@DanGould DanGould force-pushed the no-uni-mod-distinction branch from c16d8e2 to db58671 Compare July 25, 2025 20:26
@DanGould
Copy link
Contributor Author

Ok it passes but I committed a bunch of formatting changes in dart by mistake. Troubleshooting that now

They had fallen by the wayside since they're not checked in CI.
@DanGould DanGould force-pushed the no-uni-mod-distinction branch from db58671 to 68cd128 Compare July 25, 2025 20:54
@DanGould DanGould marked this pull request as ready for review July 25, 2025 22:21
DanGould added 4 commits July 26, 2025 14:43
- Note that this may break the uniffi feature-disabled code path which
  is intended and ok because it's being removed.
- Make features enabled by payjoin_ffi/uniffi non-optional in Cargo.toml
- Keep the feature, but empty, so that feature gates can be removed
  using controlled demolition for easier review.
- Remove `not(feature = "uniffi")`-switched code.
- Remove `uniffi` from python,dart generate scripts.
- Remove bdk_integration_test which runs only without uniffi since
  the same behavior is run in each target foreign language.
Only touch files where all uniffi feature removal is trivial to enable
by default.
@DanGould DanGould force-pushed the no-uni-mod-distinction branch from 68cd128 to 1b1376f Compare July 26, 2025 18:46
@DanGould DanGould force-pushed the no-uni-mod-distinction branch from 1b1376f to 774b541 Compare July 26, 2025 18:47
@DanGould
Copy link
Contributor Author

Rebased in chunks to make it easier to review

@DanGould DanGould requested a review from spacebear21 July 26, 2025 18:49
Copy link
Collaborator

@spacebear21 spacebear21 left a comment

Choose a reason for hiding this comment

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

This is huge! Thanks for the clean commit history, made it a breeze to review.

utACK 774b541

#[cfg(feature = "uniffi")]
uniffi_bindgen()
}
fn main() { uniffi_bindgen() }
Copy link
Collaborator

Choose a reason for hiding this comment

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

uniffi_bindgen() helper is no longer needed since it was only introduced to simplify the feature gate.

@spacebear21
Copy link
Collaborator

Re: removing the BDK integration test, I wonder if this bumps the priority of #741 so we can continue ensuring compatibility with BDK. Also re: https://github.com/orgs/payjoin/discussions/900 maybe consider other backends like Electrum? Maybe the better way to do this, instead of integration tests, would be to make the payjoin-cli wallet backend modular.

@DanGould DanGould merged commit 57ec41b into payjoin:master Jul 26, 2025
15 checks passed
@DanGould DanGould deleted the no-uni-mod-distinction branch July 26, 2025 19:48
@DanGould
Copy link
Contributor Author

We do have a smoke test in BDK compatibility in bull bitcoin mobile because they use BDK.

I really like the idea of making payjoin-cli wallet backend modular, but I'm not sure if it can go into payjoin as a trait or if it'd need to be a special utility thing that we only have in tests for payjoin-cli e2e tests.

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