Validate FFI primitive inputs + refresh bindings/tests#1263
Validate FFI primitive inputs + refresh bindings/tests#1263chavic wants to merge 4 commits intopayjoin:masterfrom
Conversation
Pull Request Test Coverage Report for Build 21952519211Details
💛 - Coveralls |
cd3391a to
a44a282
Compare
59affc6 to
93bc4e8
Compare
055a2bb to
53db1cb
Compare
Thanks... applying that now |
759be1b to
10ee724
Compare
732c40a to
f331ef3
Compare
payjoin-ffi/src/validation.rs
Outdated
There was a problem hiding this comment.
A question for a followup perhaps but should we consider making a primitives module to keep this kind of file in case we end up needing more like it?
There was a problem hiding this comment.
@benalleng Not bad actually, can move the shared validation helpers into a primitives module, only question is should this be in this PR or is it better to make that a separate PR
There was a problem hiding this comment.
this should be separate, and only probably once we have a lot more primitives to work with
f331ef3 to
7851959
Compare
8b3625e to
20d3670
Compare
benalleng
left a comment
There was a problem hiding this comment.
I think you may have misunderstood my comments on the review, the psbt consts can be simply imported and not set as strings in the tests. I appreciate seeing the test_utils.dart but it was not really my intention to need to add this.
There was a problem hiding this comment.
you've kind of reversed what you did here that you did in the dart file
There was a problem hiding this comment.
This fell back during the rebase; I had a backup branch, so I'll bring it back. Side note, I've noticed only the Python test fails if the poll approach isn't used... will try to find out why (not the top task)
There was a problem hiding this comment.
sidenote, should we consider asserting a failure when attempts exceed 3, unless the intent is explicitly “smoke test only”
There was a problem hiding this comment.
The can actually just be
final psbt = test_utils.originalPsbt();
you will need to add it to the test_utils.dart import though
There was a problem hiding this comment.
Related note (but not a blocker for this PR), we should really not expose test utils in the main payjoin namespace for language bindings. This test_utils approach is a nice helper but the test utils are still exposed in the main namespace. I tried my hand at this briefly and couldn't find a good approach #1199 (comment)
20d3670 to
432195d
Compare
2c4ac28 to
5771b7a
Compare
5771b7a to
c1c3600
Compare
This PR addresses #1262 and hardens the FFI boundary by validating primitive inputs and surfacing explicit errors. Updates integration tests/bindings to match the new error shapes and removes silent acceptance of invalid fee rates/amounts.
Follow-ups
Decide final script/witness size caps and document rationale.
Add Dart integration fix for large fee rate parsing (separate PR).