Trust-Machines / p256k1

Wrappers around secp256k1 to expose the underlying math, specifically unwrapped points and scalars with multiexponentiation
Apache License 2.0
12 stars 6 forks source link

Flatten `Base58Error` to allow trivial serialization #76

Closed xoloki closed 9 months ago

xoloki commented 9 months ago

When doing bs58 conversions, there are a variety of possible errors which can be returned. Unfortunately, these errors do not impl Serialize or Deserialize, so we can't trivially wrap them. And we frankly don't care; it's enough to know that an error was caused by bs58 serialization.

So to allow serializing errors, do not wrap the bs58 error types in the errors::Base58Error variants.

cloudflare-workers-and-pages[bot] commented 9 months ago

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: c844a4a
Status: ✅  Deploy successful!
Preview URL: https://2c140075.p256k1.pages.dev
Branch Preview URL: https://flatten-b58-errors.p256k1.pages.dev

View logs

codecov[bot] commented 9 months ago

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (32ba1c9) 61.53% compared to head (c844a4a) 61.40%.

Files Patch % Lines
p256k1/src/keys.rs 0.00% 4 Missing :warning:
p256k1/src/errors.rs 0.00% 2 Missing :warning:
p256k1/src/field.rs 0.00% 2 Missing :warning:
p256k1/src/point.rs 33.33% 2 Missing :warning:
p256k1/src/scalar.rs 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #76 +/- ## ========================================== - Coverage 61.53% 61.40% -0.14% ========================================== Files 12 13 +1 Lines 936 938 +2 ========================================== Hits 576 576 - Misses 360 362 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.