Skip to content

fix: return an error for empty silent payment payloads - #66

Draft
reez wants to merge 1 commit into
bitcoindevkit:masterfrom
reez:try-from
Draft

fix: return an error for empty silent payment payloads#66
reez wants to merge 1 commit into
bitcoindevkit:masterfrom
reez:try-from

Conversation

@reez

@reez reez commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Description

Generic Bech32m permits an empty payload, but SilentPaymentCode::try_from assumes the decoded payload contains a version and panics when it does not. This returns WrongPayloadLength instead and adds regression coverage.

Notes to the reviewers

Changelog notice

Return an error instead of panicking when parsing a silent payment code with an empty payload.

Checklists

All Submissions:

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

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.

1 participant