Skip to content

Rename EncapsulationError to DecapsulationError#1601

Merged
DanGould merged 1 commit into
payjoin:masterfrom
DanGould:decap-error-rename
Jun 4, 2026
Merged

Rename EncapsulationError to DecapsulationError#1601
DanGould merged 1 commit into
payjoin:masterfrom
DanGould:decap-error-rename

Conversation

@DanGould

@DanGould DanGould commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

The send-v2 EncapsulationError is a misnomer: it's only raised while decapsulating directory responses in
process_response, never during request encapsulation (that's CreateRequestError). Renames the public struct,
InternalEncapsulationError, InternalValidationError::V2Encapsulation, and the payjoin-ffi sender surface → Decapsulation*. Pure rename, no behavior change; doc-prose aligned. OhttpEncapsulationError left untouched. The user-facing "v2 encapsulation error"
Display string intentionally unchanged.

Why — Fix naming before the 1.0 error-type lock in & addresses the misnomer in #749; related to #403.

Reviewer note #403 fix PR is stacked on this so merge this first.

Disclosure: co-authored by Claude Code

Pull Request Checklist

Please confirm the following before requesting review:

The send v2 EncapsulationError type is a misnomer: it is only raised
while decapsulating directory responses in process_response, never
during request encapsulation, which returns CreateRequestError.

Rename the public struct, the internal InternalEncapsulationError
enum, and the InternalValidationError::V2Encapsulation variant, and
mirror the change through the payjoin-ffi sender error surface. This
is a pure rename with no behavior change.

The unrelated OhttpEncapsulationError type is correctly named and is
left untouched.

Addresses the misnomer flagged in payjoin#749.

@chavic chavic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 26946455484

Coverage remained the same at 85.358%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 10 uncovered changes across 3 files (1 of 11 lines covered, 9.09%).
  • 1 coverage regression across 1 file.

Uncovered Changes

File Changed Covered %
payjoin/src/core/send/v2/mod.rs 6 1 16.67%
payjoin/src/core/send/v2/error.rs 3 0 0.0%
payjoin/src/core/send/error.rs 2 0 0.0%

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
payjoin/src/core/send/v2/error.rs 1 15.63%

Coverage Stats

Coverage Status
Relevant Lines: 13857
Covered Lines: 11828
Line Coverage: 85.36%
Coverage Strength: 392.15 hits per line

💛 - Coveralls

@DanGould DanGould marked this pull request as ready for review June 4, 2026 10:52
@DanGould DanGould merged commit 25cc42a into payjoin:master Jun 4, 2026
23 checks passed
@DanGould DanGould deleted the decap-error-rename branch June 4, 2026 10:52
@benalleng benalleng mentioned this pull request Jun 7, 2026
17 tasks
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.

3 participants