Skip to content

Fixes #683 Allow empty PublicKey#684

Draft
sappenin wants to merge 2 commits intomainfrom
df/add-empty-public-key
Draft

Fixes #683 Allow empty PublicKey#684
sappenin wants to merge 2 commits intomainfrom
df/add-empty-public-key

Conversation

@sappenin
Copy link
Collaborator

@sappenin sappenin commented Feb 3, 2026

  • Allow an empty PublicKey to be built using an empty builder
  • Add unit tests to verify functionality.

* Allow an empty PublicKey to be built using an empty builder
* Add unit tests to verify functionality.

Signed-off-by: David Fuelling <sappenin@gmail.com>
@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.53%. Comparing base (4c1b8e8) to head (6b4d588).

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #684   +/-   ##
=========================================
  Coverage     92.53%   92.53%           
- Complexity     2103     2104    +1     
=========================================
  Files           432      432           
  Lines          5735     5737    +2     
  Branches        510      510           
=========================================
+ Hits           5307     5309    +2     
  Misses          280      280           
  Partials        148      148           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

* @return An instance of {@link UnsignedByteArray}.
*/
UnsignedByteArray value();
@Default
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

After considering this further, we should remove the empty builder so that developers don't accidentally omit an actual value. Instead, we should update EMPTY_PUBLIC_KEY to be this:

PublicKey EMPTY_PUBLIC_KEY = PublicKey.builder().value(UnsignedByteArray.empty()).build();

That way, if someone wants to overtly use an empty public key, it will be obvious they are do as much.

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

Comments