File tree Expand file tree Collapse file tree 3 files changed +17
-11
lines changed
mithril-common/src/crypto_helper/codec Expand file tree Collapse file tree 3 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ mod binary_mithril_stm {
6161
6262 impl TryFromBytes for SingleSignature {
6363 fn try_from_bytes ( bytes : & [ u8 ] ) -> StdResult < Self > {
64- Self :: from_bytes :: < D > ( bytes) . map_err ( |e| anyhow ! ( e ) )
64+ Self :: from_bytes :: < D > ( bytes)
6565 }
6666 }
6767
Original file line number Diff line number Diff line change @@ -136,15 +136,21 @@ match msig {
136136 println! (" Aggregate ok" );
137137 assert! (aggr . verify (& msg , & clerk . compute_aggregate_verification_key (), & params ). is_ok ());
138138 }
139- Err (error ) => assert! (
140- matches! (
141- error . downcast_ref :: <AggregationError >(),
142- Some (AggregationError :: NotEnoughSignatures { .. })
143- | Some (AggregationError :: UsizeConversionInvalid )
144- | Some (AggregationError :: UnsupportedProofSystem { .. })
145- ),
146- " Unexpected error: {error}"
147- ),
139+ Err (error ) => match error . downcast_ref :: <AggregationError >() {
140+ Some (AggregationError :: NotEnoughSignatures (n , k )) => {
141+ println! (" Not enough signatures" );
142+ assert! (n < params . k && k == params . k)
143+ },
144+ Some (AggregationError :: UsizeConversionInvalid ) => {
145+ println! (" Invalid usize conversion" );
146+ },
147+ Some (AggregationError :: UnsupportedProofSystem (aggregate_signature_type )) => {
148+ println! (" Unsupported proof system: {:?}" , aggregate_signature_type );
149+ },
150+ None => {
151+ println! (" Unexpected error during aggregation: {:?}" , error );
152+ }
153+ },
148154}
149155```
150156
Original file line number Diff line number Diff line change @@ -247,7 +247,7 @@ impl BasicVerifier {
247247 let ( sigs, vks) = Self :: collect_signatures_verification_keys ( & unique_sigs) ;
248248
249249 BlsSignature :: verify_aggregate ( msg. to_vec ( ) . as_slice ( ) , & vks, & sigs)
250- . with_context ( || "Basic verifier failed in multisignature verification." ) ?;
250+ . with_context ( || "Basic verifier failed during BLS aggregate signature verification." ) ?;
251251
252252 Ok ( ( ) )
253253 }
You can’t perform that action at this time.
0 commit comments