-
Notifications
You must be signed in to change notification settings - Fork 210
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
refactor: remove unused error paths, use expect when possible #4154
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #4154 +/- ##
==========================================
- Coverage 58.30% 58.04% -0.26%
==========================================
Files 192 192
Lines 42757 42972 +215
==========================================
+ Hits 24928 24942 +14
- Misses 17829 18030 +201 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great refactor!
.tier(&created.amount) | ||
.expect("We obtained this amount from tbs_pks when we created the output"); | ||
|
||
// this implies that the mint client config's public keys are inconsistent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So maybe in the future we can just check config consistency when joining the federation and then expect here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we could
@@ -185,6 +185,14 @@ fn lagrange_multipliers(scalars: Vec<Scalar>) -> Vec<Scalar> { | |||
.collect() | |||
} | |||
|
|||
pub fn verify_blinded_signature( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some docs might be useful here for everything that isnt familiar with the pairing crypto
let agg_blind_signature = aggregate_signature_shares( | ||
&blinded_signature_shares | ||
.into_iter() | ||
.map(|(peer, share)| (peer.to_usize() as u64 + 1, share)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 here is just to prevent a peer with id 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need the +1 here so the cryptography checks out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I knew what it was for but also raised an eye brow that there is no fn to convert the peer ID. But that's how I wrote it an eternity ago and Joscha just kept it that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not the most well-versed in the mint module but this looks like a good refactor to me
No description provided.