Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling for Rust and Python #45

Merged
merged 4 commits into from
May 5, 2021
Merged

Conversation

fjarri
Copy link
Contributor

@fjarri fjarri commented Mar 27, 2021

Based on top of #41
Fixes #20
Fixes #31

  • returning Result instead of Option in Rust methods
  • raising corresponding Python exceptions in Python bindings
  • implemented __eq__(), __hash__() and __repr__() too where appropriate (using the new HasSerializableBackend helper)
  • update Python and Rust docs, and Python type annotations

@fjarri fjarri added Python Related to Python bindings API Related to public API labels Mar 27, 2021
@codecov-io
Copy link

codecov-io commented Mar 27, 2021

Codecov Report

Merging #45 (aac9775) into master (128eb0c) will increase coverage by 0.33%.
The diff coverage is 93.10%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #45      +/-   ##
==========================================
+ Coverage   94.64%   94.98%   +0.33%     
==========================================
  Files          10       11       +1     
  Lines         766      777      +11     
==========================================
+ Hits          725      738      +13     
+ Misses         41       39       -2     
Impacted Files Coverage Δ
umbral-pre/src/dem.rs 92.50% <85.00%> (-1.95%) ⬇️
umbral-pre/src/key_frag.rs 89.24% <86.66%> (+2.84%) ⬆️
umbral-pre/src/capsule_frag.rs 95.08% <88.00%> (+2.32%) ⬆️
umbral-pre/src/traits.rs 96.42% <88.88%> (-3.58%) ⬇️
umbral-pre/src/curve.rs 92.00% <94.11%> (-3.51%) ⬇️
umbral-pre/src/keys.rs 95.34% <95.34%> (ø)
umbral-pre/src/capsule.rs 99.03% <96.77%> (-0.97%) ⬇️
umbral-pre/src/hashing.rs 97.87% <100.00%> (-0.31%) ⬇️
umbral-pre/src/hashing_ds.rs 100.00% <100.00%> (ø)
umbral-pre/src/params.rs 100.00% <100.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 128eb0c...aac9775. Read the comment docs.

@fjarri fjarri force-pushed the error-handling branch 6 times, most recently from aac9775 to 181c1dc Compare March 28, 2021 18:41
@fjarri fjarri requested a review from jMyles March 29, 2021 23:40
Copy link
Contributor

@piotr-roslaniec piotr-roslaniec left a comment

Choose a reason for hiding this comment

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

LGTM 👍

umbral-pre/src/key_frag.rs Outdated Show resolved Hide resolved
umbral-pre-python/src/lib.rs Show resolved Hide resolved
@fjarri fjarri merged commit d70d6ae into nucypher:master May 5, 2021
@fjarri fjarri deleted the error-handling branch May 5, 2021 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Related to public API Python Related to Python bindings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error handling in Python bindings Return Result instead of Option in Capsule::open_reencrypted()?
5 participants