Skip to content

Expose Receiver Modification Errors#1433

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

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

Pull Request Test Coverage Report for Build 24011165460

Details

  • 25 of 30 (83.33%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.003%) to 84.337%

Changes Missing Coverage Covered Lines Changed/Added Lines %
payjoin/src/core/receive/error.rs 25 30 83.33%
Totals Coverage Status
Change from base Build 24003181260: -0.003%
Covered Lines: 10823
Relevant Lines: 12833

💛 - 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
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 e412f6e to be5c5ae Compare April 5, 2026 21:45
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

2 participants