Skip to content

Expose Receiver Modification Errors#1433

Closed
chavic wants to merge 1 commit intopayjoin:masterfrom
chavic:chavic/substitution-contribution-errors-1277
Closed

Expose Receiver Modification Errors#1433
chavic wants to merge 1 commit intopayjoin:masterfrom
chavic:chavic/substitution-contribution-errors-1277

Conversation

@chavic
Copy link
Copy Markdown
Collaborator

@chavic chavic commented Mar 20, 2026

Closes #1277.

This PR makes receiver-side output substitution and input contribution failures inspectable over FFI. Core already distinguished these cases internally, but the FFI preserved them as opaque wrappers, which meant bindings had to parse display strings to tell apart substitution policy failures from contributed-input failures like duplicate inputs or insufficient contributed value.

The change adds stable classifications for OutputSubstitutionError and InputContributionError, and exposes the duplicate-input outpoint as structured data. On the FFI side, the old transparent wrappers are replaced with stable snapshot objects that expose the error kind, message, and duplicate-input detail where it exists.

The result is that bindings can now branch on receiver modification failures in a usable way and surface actionable diagnostics without relying on string parsing. This keeps the same accessor-based pattern established for the other receiver-side error work.

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Mar 20, 2026

Coverage Report for CI Build 24466342883

Coverage decreased (-0.003%) to 84.337%

Details

  • Coverage decreased (-0.003%) from the base build.
  • Patch coverage: 5 uncovered changes across 1 file (25 of 30 lines covered, 83.33%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
payjoin/src/core/receive/error.rs 30 25 83.33%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 12833
Covered Lines: 10823
Line Coverage: 84.34%
Coverage Strength: 411.46 hits per line

💛 - Coveralls

@chavic chavic requested a review from spacebear21 March 22, 2026 21:55
@chavic chavic self-assigned this Mar 22, 2026
@chavic chavic marked this pull request as ready for review March 22, 2026 21:55
@chavic chavic force-pushed the chavic/substitution-contribution-errors-1277 branch from e412f6e to be5c5ae Compare April 5, 2026 21:45
Add stable kind accessors for receiver output substitution and
input contribution failures and preserve the duplicate input
outpoint across the FFI boundary.

Bindings currently only see opaque error wrappers for these
paths, which forces callers to branch on display strings even
though core already distinguishes actionable failure classes.
This keeps the internal enums private while making receiver
integrations able to react to invalid drain scripts, disabled
output substitutions, duplicate inputs, and value-too-low
contributions.
@chavic chavic force-pushed the chavic/substitution-contribution-errors-1277 branch from be5c5ae to f3bf283 Compare April 15, 2026 16:36
@spacebear21
Copy link
Copy Markdown
Collaborator

Closing per #1277 (comment)

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.

Expose detailed output substitution and input contribution error information in FFI

3 participants