[zk-token-sdk] Refactor AuthenticatedEncryptionError and ElGamalError to errors module#589
Merged
samkim-crypto merged 3 commits intoanza-xyz:masterfrom Apr 12, 2024
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #589 +/- ##
=========================================
- Coverage 81.8% 81.8% -0.1%
=========================================
Files 850 851 +1
Lines 229369 229481 +112
=========================================
+ Hits 187717 187751 +34
- Misses 41652 41730 +78 |
joncinque
approved these changes
Apr 11, 2024
Comment on lines
+25
to
+32
| #[cfg(not(target_os = "solana"))] | ||
| use { | ||
| aes_gcm_siv::{ | ||
| aead::{Aead, NewAead}, | ||
| Aes128GcmSiv, | ||
| }, | ||
| rand::{rngs::OsRng, Rng}, | ||
| }; |
There was a problem hiding this comment.
nit: did cargo fmt move this down? it's up to you, but it can be more consistent to keep this block at the top, same with the other files
Author
There was a problem hiding this comment.
Hm, yeah it seems like cargo fmt always favors the larger chunk to be on top of the smaller chunk of imports. Alternatively, I can put an extra space between the two import chunks, but it seems like this is less clean. I'll leave it for now and maybe I can update it on a follow-up.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Currently, error types
AuthenticatedEncryptionErrorandElGamalErrorlives in theencryptionmodule, which is excluded from sbf target. However, it would be nice to use these types to handle errors in thezk_token_elgamalmodule as well (e.g. #588), which should be included for sbf target.Summary of Changes
Refactor these error types into the
errorsmodule so that bothencryptionandzk_token_elgamalsubmodules can access it.Fixes #