Skip to content

Consider renaming FFi InputPairError::InvalidTransaction #1974

Open

Description

@benalleng

The InvalidTransaction error is a bit broadly named for its stated purpose.

Originally stated #1959 (review) perhaps TransactionDecode error would be better suited

Activity

  1. Christopherdominic commented on Oct 19, 2026

    @Christopherdominic
    Contributor

    @benalleng I'd like to work on this. My proposed change is to rename the FFI InputPairError::InvalidTransaction(String) variant to TransactionDecode(String), as suggested in the issue, so callers can distinguish failure to consensus-decode transaction bytes from later PSBT input validation.

    I'd update the enum and its documentation in payjoin-ffi/src/receive/error.rs, the transaction-decoding error mapping in payjoin-ffi/src/receive/mod.rs, and any affected binding tests/examples. I'd retain the decoder's error detail and make the display message describe the decode failure. I'd add regression coverage showing malformed transaction bytes produce TransactionDecode, while an existing valid-transaction input still follows the normal validation path, then run the FFI tests, binding generation checks, formatting, Clippy, and spelling checks. I'd record the public error-variant rename in payjoin-ffi/CHANGELOG.md.

    This changes a public binding error name. Are you happy with a direct rename for the next bindings release, or do you want a compatibility transition? Please confirm the naming and compatibility approach before I implement it.

    AI disclosure: This comment was drafted with OpenAI Codex assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions