Skip to content

Uniffi dart#829

Merged
spacebear21 merged 4 commits intopayjoin:masterfrom
spacebear21:uniffi-dart
Jul 15, 2025
Merged

Uniffi dart#829
spacebear21 merged 4 commits intopayjoin:masterfrom
spacebear21:uniffi-dart

Conversation

@spacebear21
Copy link
Copy Markdown
Collaborator

@spacebear21 spacebear21 commented Jun 30, 2025

This adds support for producing dart bindings with uniffi via https://github.com/Uniffi-Dart/uniffi-dart.git (pinned commit for now until official releases exist). The unit and integration tests in dart are passing.

Note that the integration test is currently flaky due to issues with testcontainers, so the dart Github workflow is not introduced in this PR to keep CI reliably passing. #876 adds the workflow separately but should wait until the testcontainers issue is resolved.

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Jun 30, 2025

Pull Request Test Coverage Report for Build 16273590740

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.735%

Totals Coverage Status
Change from base Build 16271409661: 0.0%
Covered Lines: 7621
Relevant Lines: 8889

💛 - Coveralls

@spacebear21 spacebear21 force-pushed the uniffi-dart branch 9 times, most recently from 1f36647 to a0be22e Compare July 1, 2025 21:12
@spacebear21 spacebear21 force-pushed the uniffi-dart branch 3 times, most recently from eb1c264 to febe14e Compare July 11, 2025 00:42
@spacebear21 spacebear21 marked this pull request as ready for review July 11, 2025 15:22
spacebear21 and others added 3 commits July 11, 2025 16:19
Specify the language to create bindings for at the creation step

Co-authored-by: user <benalleng@gmail.com>
Co-authored-by: spacebear <git@spacebear.dev>
Copy link
Copy Markdown
Collaborator

@arminsabouri arminsabouri left a comment

Choose a reason for hiding this comment

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

Amazing work! A nit and a question but everything else looked clean and correct to me.
It would be useful to have build and test instructions in a README similar to what we do for python. That can be left as a follow up item.

utACK 20fd94f

@@ -0,0 +1,11 @@


#!/bin/bash
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: Move shebang to the first line.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also slight prefrence for #!/usr/bin/env bash

}
}

class CheckInputsNotSeenCallback implements payjoin.IsOutputKnown {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Something seems a bit funky here (?) Should this class be CheckInOutputKnownCallback

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

For inputs seen before I dont think there is much to implement here but for output known could we use the same functionality as IsScriptOwned?

Edit: that actually might be what we already do below.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nevermind we do this in the python int. tests as well. Appears like the FFI exported abstract class is misnamed?

class CheckInputsNotSeenCallback(IsOutputKnown):
    def __init__(self, connection: RpcClient):
        self.connection = connection

    def callback(self, _outpoint):
        return False

Copy link
Copy Markdown
Collaborator

@arminsabouri arminsabouri left a comment

Choose a reason for hiding this comment

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

Meant to approve
utACK 20fd94f

@spacebear21
Copy link
Copy Markdown
Collaborator Author

Thanks Armin, I will address your feedback in follow-ups since they also touch the Python bindings.

Good point about a README. I think the FFI docs need a major re-haul some time soon.

@spacebear21 spacebear21 merged commit ba5ac46 into payjoin:master Jul 15, 2025
15 checks passed
@spacebear21 spacebear21 mentioned this pull request Aug 7, 2025
11 tasks
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.

4 participants