Skip to content

Conversation

@spacebear21
Copy link
Collaborator

@spacebear21 spacebear21 commented Jan 21, 2026

This exposes the async persistence methods in payjoin-ffi and accompanying unit tests in downstream languages.

I wanted to address #1199 so that we wouldn't duplicate all the hardcoded test values so much, but it turned out to be more involved than I anticipated (see my comment on that issue).

Pull Request Checklist

Please confirm the following before requesting review:

@coveralls
Copy link
Collaborator

coveralls commented Jan 21, 2026

Pull Request Test Coverage Report for Build 21396851139

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 83.203%

Totals Coverage Status
Change from base Build 21370318256: 0.0%
Covered Lines: 10140
Relevant Lines: 12187

💛 - Coveralls

@spacebear21 spacebear21 force-pushed the replay-event-log-async branch 5 times, most recently from b9ab24b to aee5749 Compare January 23, 2026 20:46
@spacebear21 spacebear21 marked this pull request as ready for review January 23, 2026 21:00
@DanGould
Copy link
Contributor

I see the integration test is skipping. In CI: skipped 'bitcoin_ffi helpers are not available in this binding'

and local:

======================================================================
ERROR: test.test_payjoin_integration_test (unittest.loader._FailedTest.test.test_payjoin_integration_test)
----------------------------------------------------------------------
ImportError: Failed to import test module: test.test_payjoin_integration_test
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/loader.py", line 396, in _find_test_path
    module = self._get_module_from_name(name)
  File "/opt/homebrew/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/loader.py", line 339, in _get_module_from_name
    __import__(name)
    ~~~~~~~~~~^^^^^^
  File "/Users/dan/f/dev/payjoin/payjoin-ffi/python/test/test_payjoin_integration_test.py", line 11, in <module>
    import payjoin.bitcoin as bitcoinffi
  File "/Users/dan/f/dev/payjoin/payjoin-ffi/python/src/payjoin/bitcoin.py", line 645, in <module>
    _UniffiLib.uniffi_bitcoin_ffi_fn_clone_address.argtypes = (
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/ctypes/__init__.py", line 403, in __getattr__
    func = self.__getitem__(name)
  File "/opt/homebrew/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/ctypes/__init__.py", line 408, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(0x6d0d1d60, uniffi_bitcoin_ffi_fn_clone_address): symbol not found

Is this entirely intentional? It was added in cc45199 #1191. I don't see discussion of just skipping the integration test there but still passing CI. Is this the intended behavior @chavic?

Copy link
Contributor

@DanGould DanGould left a comment

Choose a reason for hiding this comment

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

One of the python tests no-ops accidentally, that's the only thing I'd really want to fix.

Would be nice to have save/load/close coverage in FFI but for now imo it's ok without.

@chavic
Copy link
Collaborator

chavic commented Jan 27, 2026

I see the integration test is skipping. In CI: skipped 'bitcoin_ffi helpers are not available in this binding'

and local:

======================================================================
ERROR: test.test_payjoin_integration_test (unittest.loader._FailedTest.test.test_payjoin_integration_test)
----------------------------------------------------------------------
ImportError: Failed to import test module: test.test_payjoin_integration_test
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/loader.py", line 396, in _find_test_path
    module = self._get_module_from_name(name)
  File "/opt/homebrew/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/unittest/loader.py", line 339, in _get_module_from_name
    __import__(name)
    ~~~~~~~~~~^^^^^^
  File "/Users/dan/f/dev/payjoin/payjoin-ffi/python/test/test_payjoin_integration_test.py", line 11, in <module>
    import payjoin.bitcoin as bitcoinffi
  File "/Users/dan/f/dev/payjoin/payjoin-ffi/python/src/payjoin/bitcoin.py", line 645, in <module>
    _UniffiLib.uniffi_bitcoin_ffi_fn_clone_address.argtypes = (
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/ctypes/__init__.py", line 403, in __getattr__
    func = self.__getitem__(name)
  File "/opt/homebrew/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/ctypes/__init__.py", line 408, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(0x6d0d1d60, uniffi_bitcoin_ffi_fn_clone_address): symbol not found

Is this entirely intentional? It was added in cc45199 #1191. I don't see discussion of just skipping the integration test there but still passing CI. Is this the intended behavior @chavic?

Yeah, that's the expected behavior

@DanGould
Copy link
Contributor

In that case, when do we run & maintain the integration tests?

@spacebear21
Copy link
Collaborator Author

Is this entirely intentional? It was added in cc45199 #1191. I don't see discussion of just skipping the integration test there but still passing CI.

Good catch, I overlooked this on PR review and haven't noticed since.. I agree it needs to be unskipped asap, though this belongs in a separate PR.

This exposes the async persistence methods in payjoin-ffi and
accompanying unit tests in the downstream languages.
@spacebear21 spacebear21 force-pushed the replay-event-log-async branch 2 times, most recently from ee65092 to 2f94194 Compare January 27, 2026 12:17
Copy link
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.

Noticed on inconsistency in the dart unit tests. Otherwise Ack .

final result = await payjoin.replayReceiverEventLogAsync(persister);
expect(
result,
isA<payjoin.ReplayResult>(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it possible to assert a specific state like we do in the other tests?

@arminsabouri
Copy link
Collaborator

Would be nice to have save/load/close coverage in FFI but for now imo it's ok without.

IIRC the persister lifecycle is covered in the integration tests.

@DanGould
Copy link
Contributor

DanGould commented Jan 27, 2026

Would be nice to have save/load/close coverage in FFI but for now imo it's ok without.

IIRC the persister lifecycle is covered in the integration tests.

O ya that seems sufficient as long as it's actually running

edit: async & sync tho?

@spacebear21
Copy link
Collaborator Author

edit: async & sync tho?

currently sync only in integration tests. Same as in the core rust tests fwiw. Maybe worth revisiting at some point for fuller coverage.

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.

5 participants