Skip to content

Add tests for wrong-length seeds and signed payloads - #130

Merged
leighmcculloch merged 6 commits into
mainfrom
add-strkey-length-validation-tests
Aug 10, 2026
Merged

Add tests for wrong-length seeds and signed payloads#130
leighmcculloch merged 6 commits into
mainfrom
add-strkey-length-validation-tests

Conversation

@leighmcculloch

@leighmcculloch leighmcculloch commented Aug 10, 2026

Copy link
Copy Markdown
Member

What

Add tests covering two payload-length edge cases in ed25519::PrivateKey and ed25519::SignedPayload that were previously unexercised.

Why

A review comparing this crate's strkey validation tests against stellar/go-stellar-sdk#5977 found two gaps: ed25519::PrivateKey::from_string doesn't have a test for a wrong-length seed payload, and SignedPayload::from_payload does not have a test for a 40-byte payload that declares a zero-length inner payload.

@leighmcculloch
leighmcculloch marked this pull request as ready for review August 10, 2026 07:42
Copilot AI balanced review requested due to automatic review settings August 10, 2026 07:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds coverage for invalid Ed25519 seed lengths and zero-length signed payloads.

Changes:

  • Adds private-key test vectors.
  • Tests short and oversized private keys.
  • Tests a minimum-sized signed payload declaring zero length.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
tests/tools/strkey-encode/main.go Adds private-key vectors.
tests/tests.rs Adds payload-length tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/tests.rs
Comment thread tests/tests.rs Outdated
@leighmcculloch
leighmcculloch requested a review from a team August 10, 2026 07:49
@leighmcculloch
leighmcculloch enabled auto-merge (squash) August 10, 2026 07:56
@leighmcculloch
leighmcculloch merged commit 0f133c3 into main Aug 10, 2026
12 checks passed
@leighmcculloch
leighmcculloch deleted the add-strkey-length-validation-tests branch August 10, 2026 17:22
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