From 83fbb008f0ec5029de9a67eb1b57c22e182be19b Mon Sep 17 00:00:00 2001 From: kumulynja Date: Mon, 22 Jul 2024 18:35:08 +0200 Subject: [PATCH 1/2] change Ffi* return types --- lib/receive/v2.dart | 4 ++-- lib/send.dart | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/receive/v2.dart b/lib/receive/v2.dart index d550acf..cee5353 100644 --- a/lib/receive/v2.dart +++ b/lib/receive/v2.dart @@ -196,7 +196,7 @@ class OutputsUnknown extends FfiV2OutputsUnknown { /// Find which outputs belong to the receiver @override - Future identifyReceiverOutputs( + Future identifyReceiverOutputs( {required FutureOr Function(Uint8List p1) isReceiverOutput, hint}) async { try { @@ -258,7 +258,7 @@ class ProvisionalProposal extends FfiV2ProvisionalProposal { } @override - Future finalizeProposal( + Future finalizeProposal( {required FutureOr Function(String p1) processPsbt, BigInt? minFeerateSatPerVb, hint}) async { diff --git a/lib/send.dart b/lib/send.dart index 1e2ca4b..d950f5b 100644 --- a/lib/send.dart +++ b/lib/send.dart @@ -61,10 +61,11 @@ class RequestBuilder extends FfiRequestBuilder { } @override - Future alwaysDisableOutputSubstitution( + Future alwaysDisableOutputSubstitution( {required bool disable, hBigInt}) async { try { - return await super.alwaysDisableOutputSubstitution(disable: disable); + final res = await super.alwaysDisableOutputSubstitution(disable: disable); + return RequestBuilder._(field0: res.field0); } on error.PayjoinError catch (e) { throw mapPayjoinError(e); } From 3a917b0fbffe8a4300cd6ac8441f96e7672cd80c Mon Sep 17 00:00:00 2001 From: kumulynja Date: Mon, 22 Jul 2024 20:06:13 +0200 Subject: [PATCH 2/2] fix FfiUrl toString to asString --- lib/receive/v2.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/receive/v2.dart b/lib/receive/v2.dart index cee5353..951f939 100644 --- a/lib/receive/v2.dart +++ b/lib/receive/v2.dart @@ -297,7 +297,7 @@ class PayjoinProposal extends FfiV2PayjoinProposal { try { final res = await FfiV2PayjoinProposal.extractV2Req(ptr: this); final request = - Request(await Url.fromString(res.$1.$1.toString()), res.$1.$2); + Request(await Url.fromString(res.$1.$1.asString()), res.$1.$2); return (request, ClientResponse._(field0: res.$2.field0)); } on error.PayjoinError catch (e) { throw mapPayjoinError(e);