From c3e4239a6e54806a320ae8c4d6ba92c54a73bf76 Mon Sep 17 00:00:00 2001 From: Benalleng Date: Mon, 17 Aug 2026 09:18:06 -0400 Subject: [PATCH 1/3] Dart test formatting --- .../dart/test/fetch_ohttp_keys_http_test.dart | 5 +- .../test/test_payjoin_integration_test.dart | 66 ++++++++----------- .../dart/test/test_payjoin_unit_test.dart | 5 +- 3 files changed, 34 insertions(+), 42 deletions(-) diff --git a/payjoin-ffi/dart/test/fetch_ohttp_keys_http_test.dart b/payjoin-ffi/dart/test/fetch_ohttp_keys_http_test.dart index 3eccac811..1f3a5e195 100644 --- a/payjoin-ffi/dart/test/fetch_ohttp_keys_http_test.dart +++ b/payjoin-ffi/dart/test/fetch_ohttp_keys_http_test.dart @@ -131,9 +131,8 @@ void _handleConnectProxyClient(Socket client) { final headerEnd = _headerEnd(buffer); if (headerEnd == -1) return; final request = latin1.decode(buffer.sublist(0, headerEnd)); - final match = RegExp( - r'^CONNECT ([^:]+):(\d+) HTTP/1\.1', - ).firstMatch(request); + final match = RegExp(r'^CONNECT ([^:]+):(\d+) HTTP/1\.1') + .firstMatch(request); if (match == null) { client.destroy(); return; diff --git a/payjoin-ffi/dart/test/test_payjoin_integration_test.dart b/payjoin-ffi/dart/test/test_payjoin_integration_test.dart index 75a37ba2e..0c9acab25 100644 --- a/payjoin-ffi/dart/test/test_payjoin_integration_test.dart +++ b/payjoin-ffi/dart/test/test_payjoin_integration_test.dart @@ -8,6 +8,7 @@ import "package:convert/convert.dart"; import "package:payjoin/http.dart" as payjoin_http; import "package:payjoin/payjoin.dart" as payjoin; import "package:payjoin/test_utils.dart" as test_utils; + import "utils.dart"; late test_utils.BitcoindEnv env; @@ -119,9 +120,8 @@ class IsInputOwnedCallback implements payjoin.IsInputOwned { return false; } final scriptHex = txOut["scriptPubKey"]["hex"] as String; - return IsScriptOwnedCallback( - connection, - ).callback(Uint8List.fromList(hex.decode(scriptHex))); + return IsScriptOwnedCallback(connection) + .callback(Uint8List.fromList(hex.decode(scriptHex))); } catch (e) { return false; } @@ -387,36 +387,28 @@ Future process_receiver_proposal( void main() { group('fetchOhttpKeys', () { - test( - 'fetches and decodes keys via relay proxy', - () async { - final services = test_utils.TestServices.initialize(); - services.waitForServicesReady(); - final keys = await payjoin_http.fetchOhttpKeys( + test('fetches and decodes keys via relay proxy', () async { + final services = test_utils.TestServices.initialize(); + services.waitForServicesReady(); + final keys = await payjoin_http.fetchOhttpKeys( + ohttpRelayUrl: services.ohttpRelayUrl(), + directoryUrl: services.directoryUrl(), + certificate: services.cert(), + ); + expect(keys, isA()); + }, timeout: const Timeout(Duration(minutes: 2))); + + test('without trusted certificate throws', () async { + final services = test_utils.TestServices.initialize(); + services.waitForServicesReady(); + await expectLater( + payjoin_http.fetchOhttpKeys( ohttpRelayUrl: services.ohttpRelayUrl(), directoryUrl: services.directoryUrl(), - certificate: services.cert(), - ); - expect(keys, isA()); - }, - timeout: const Timeout(Duration(minutes: 2)), - ); - - test( - 'without trusted certificate throws', - () async { - final services = test_utils.TestServices.initialize(); - services.waitForServicesReady(); - await expectLater( - payjoin_http.fetchOhttpKeys( - ohttpRelayUrl: services.ohttpRelayUrl(), - directoryUrl: services.directoryUrl(), - ), - throwsA(isA()), - ); - }, - timeout: const Timeout(Duration(minutes: 2)), - ); + ), + throwsA(isA()), + ); + }, timeout: const Timeout(Duration(minutes: 2))); }); group('Test integration', () { @@ -471,9 +463,9 @@ void main() { // Use a real v2 payjoin URI from the test harness to avoid v1 panics. final envLocal = test_utils.initBitcoindSenderReceiver(); final receiverRpc = envLocal.getReceiver(); - final receiverAddress = - jsonDecode(receiverRpc.call(method: "getnewaddress", params: [])) - as String; + final receiverAddress = jsonDecode( + receiverRpc.call(method: "getnewaddress", params: []), + ) as String; final services = test_utils.TestServices.initialize(); services.waitForServicesReady(); final directory = services.directoryUrl(); @@ -507,9 +499,9 @@ void main() { bitcoind = env.getBitcoind(); receiver = env.getReceiver(); sender = env.getSender(); - var receiver_address = - jsonDecode(receiver.call(method: "getnewaddress", params: [])) - as String; + var receiver_address = jsonDecode( + receiver.call(method: "getnewaddress", params: []), + ) as String; var services = test_utils.TestServices.initialize(); services.waitForServicesReady(); diff --git a/payjoin-ffi/dart/test/test_payjoin_unit_test.dart b/payjoin-ffi/dart/test/test_payjoin_unit_test.dart index 2cbb806c7..31e8325b3 100644 --- a/payjoin-ffi/dart/test/test_payjoin_unit_test.dart +++ b/payjoin-ffi/dart/test/test_payjoin_unit_test.dart @@ -1,7 +1,9 @@ import 'dart:typed_data'; + import 'package:convert/convert.dart'; import 'package:test/test.dart'; import "package:payjoin/payjoin.dart" as payjoin; + import "utils.dart"; void main() { @@ -307,8 +309,7 @@ void main() { test("Validation sender builder rejects bad psbt", () { final uri = payjoin.Uri.parse( - uri: - "bitcoin:tb1q6d3a2w975yny0asuvd9a67ner4nks58ff0q8g4?pj=https://example.com/pj", + uri: "bitcoin:tb1q6d3a2w975yny0asuvd9a67ner4nks58ff0q8g4?pj=https://example.com/pj", ).checkPjSupported(); expect( () => payjoin.SenderBuilder(psbt: "not-a-psbt", uri: uri), From 4340f29062a9152f727d8b572fcee4ca7b432495 Mon Sep 17 00:00:00 2001 From: Benalleng Date: Mon, 17 Aug 2026 12:32:58 -0400 Subject: [PATCH 2/3] remove async-trait lint TODO --- payjoin-cli/src/app/mod.rs | 3 --- payjoin-ffi/src/receive/mod.rs | 3 --- payjoin-ffi/src/send/mod.rs | 3 --- 3 files changed, 9 deletions(-) diff --git a/payjoin-cli/src/app/mod.rs b/payjoin-cli/src/app/mod.rs index e2d1a5607..a0174e187 100644 --- a/payjoin-cli/src/app/mod.rs +++ b/payjoin-cli/src/app/mod.rs @@ -21,9 +21,6 @@ pub(crate) mod v1; pub(crate) mod v2; #[async_trait::async_trait] -// [TODO] remove this clippy ignore once https://github.com/dtolnay/async-trait/pull/303 is included -// in a new release -#[allow(clippy::double_must_use)] pub trait App: Send + Sync { async fn new(config: Config) -> Result where diff --git a/payjoin-ffi/src/receive/mod.rs b/payjoin-ffi/src/receive/mod.rs index 6153f2211..a0e81f90f 100644 --- a/payjoin-ffi/src/receive/mod.rs +++ b/payjoin-ffi/src/receive/mod.rs @@ -1769,9 +1769,6 @@ impl payjoin::persist::SessionPersister for CallbackPersisterAdapter { /// Async session persister that should save and load events as JSON strings. #[uniffi::export(with_foreign)] #[async_trait::async_trait] -// [TODO] remove this clippy ignore once https://github.com/dtolnay/async-trait/pull/303 is included -// in a new release -#[allow(clippy::double_must_use)] pub trait JsonReceiverSessionPersisterAsync: Send + Sync { async fn save(&self, event: String) -> Result<(), ForeignError>; async fn load(&self) -> Result, ForeignError>; diff --git a/payjoin-ffi/src/send/mod.rs b/payjoin-ffi/src/send/mod.rs index 738cb323b..bccbead8b 100644 --- a/payjoin-ffi/src/send/mod.rs +++ b/payjoin-ffi/src/send/mod.rs @@ -771,9 +771,6 @@ impl payjoin::persist::SessionPersister for CallbackPersisterAdapter { /// Async session persister that should save and load events as JSON strings. #[uniffi::export(with_foreign)] #[async_trait::async_trait] -// [TODO] remove this clippy ignore once https://github.com/dtolnay/async-trait/pull/303 is included -// in a new release -#[allow(clippy::double_must_use)] pub trait JsonSenderSessionPersisterAsync: Send + Sync { async fn save(&self, event: String) -> Result<(), ForeignError>; async fn load(&self) -> Result, ForeignError>; From 3c1b3b743c501fbf2ab023f9e6b9d6c7c3b3a121 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 17 Aug 2026 11:35:04 +0000 Subject: [PATCH 3/3] chore: update flake.lock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs-unstable': 'github:NixOS/nixpkgs/8e2eeb9' (2026-08-11) → 'github:NixOS/nixpkgs/54ba4bc' (2026-08-16) • Updated input 'pyproject-build-systems': 'github:pyproject-nix/build-system-pkgs/90fde00' (2026-08-03) → 'github:pyproject-nix/build-system-pkgs/90ffdee' (2026-08-17) • Updated input 'rust-overlay': 'github:oxalica/rust-overlay/39db480' (2026-08-12) → 'github:oxalica/rust-overlay/b479967' (2026-08-17) • Updated input 'treefmt-nix': 'github:numtide/treefmt-nix/ae79109' (2026-08-05) → 'github:numtide/treefmt-nix/27b3b12' (2026-08-16) • Updated input 'uv2nix': 'github:pyproject-nix/uv2nix/0dfa838' (2026-08-06) → 'github:pyproject-nix/uv2nix/4b59abb' (2026-08-13) --- flake.lock | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index 36b10ea0c..5f9e4ccb2 100644 --- a/flake.lock +++ b/flake.lock @@ -68,11 +68,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1786410043, - "narHash": "sha256-JTbODJPDcd3d8U7lO4MVUU3Yo0jz2KQSAHXka+IWBEo=", + "lastModified": 1786858016, + "narHash": "sha256-Vczr2zxD0orq6N2QQe5uqOGF7TRDcQJRRuAcsdHr4kg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8e2eeb9477c9d40009a5bd51cd3eef2f5abb26f1", + "rev": "54ba4bcec4043e72a4006d825e0d7aff5562008f", "type": "github" }, "original": { @@ -111,11 +111,11 @@ ] }, "locked": { - "lastModified": 1785730568, - "narHash": "sha256-NjSPsgjJ7MSpBtTkUcmNhRe6AFZ96+zsca2M8YuQi8Y=", + "lastModified": 1786936886, + "narHash": "sha256-8SFyOdmcG6Nsh/JzlH812lTI/v+ur06fpQhj/acNn8k=", "owner": "pyproject-nix", "repo": "build-system-pkgs", - "rev": "90fde00db3687922d39d95fc591475fd0bbbcd72", + "rev": "90ffdeee1a4929b231913df067448cd9803d3e07", "type": "github" }, "original": { @@ -165,11 +165,11 @@ ] }, "locked": { - "lastModified": 1786507911, - "narHash": "sha256-w5aZRLbiu7H6TqsYXVMdRKg0S4DRaJpxyqxx86AwxVk=", + "lastModified": 1786935912, + "narHash": "sha256-26qGGBO364d5JbTMrFchrxp7xY8CJp3D5cjkND99t7E=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "39db48099ad16834af7e27485a4babf9c28b3897", + "rev": "b479967b8ed7aca40ba52cf12f460484c53928a9", "type": "github" }, "original": { @@ -200,11 +200,11 @@ ] }, "locked": { - "lastModified": 1785945821, - "narHash": "sha256-NLSyTCW4K4ofhNBllt3omPasm6QpralXH1DBZOc91Dw=", + "lastModified": 1786901030, + "narHash": "sha256-WSFCsDSE5ffgD2MqzkM2CYjeFiKhRF/dJUN8uedb6YE=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "ae7910970dddc408fe6ab1c8e4b277bb21d72dc0", + "rev": "27b3b12a8e6375f28ebe122f07d230ca5459bbfa", "type": "github" }, "original": { @@ -223,11 +223,11 @@ ] }, "locked": { - "lastModified": 1786026603, - "narHash": "sha256-payw8w/aqR/Vr7LvDp14jxa5egFrZN7g8INsPzn7rN0=", + "lastModified": 1786615403, + "narHash": "sha256-U++y7nM/6xiEcWI7q4fQoPZjPvRaTwkSqzBOVoEBjUE=", "owner": "pyproject-nix", "repo": "uv2nix", - "rev": "0dfa8388dc855b1774f509725d8ea6806291571d", + "rev": "4b59abb2ae1896d2a0e1abfc47fbc9bf985ea730", "type": "github" }, "original": {