Skip to content

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

Merged
nymius merged 1 commit into
bitcoindevkit:masterfrom
reez:try-from
Sep 2, 2026
Merged

fix: return an error for empty silent payment payloads#66
nymius merged 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

@reez
reez marked this pull request as ready for review August 25, 2026 19:32

@nymius nymius 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.

Can you rebase on master to get the mutants fix?

@reez

reez commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Can you rebase on master to get the mutants fix?

Definitely.

This is rebased now.

@nymius nymius 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 582ff44

@nymius
nymius merged commit a3916b7 into bitcoindevkit:master Sep 2, 2026
5 checks passed
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.

2 participants