@@ -45,7 +45,7 @@ impl VerifierImpl {
4545 & self ,
4646 signers_with_stakes : & [ entities:: SignerWithStake ] ,
4747 protocol_parameters : & entities:: ProtocolParameters ,
48- ) -> Result < ProtocolClerk , String > {
48+ ) -> Result < ProtocolClerk , ProtocolError > {
4949 let stakes = signers_with_stakes
5050 . iter ( )
5151 . map ( |signer| {
@@ -87,22 +87,16 @@ impl Verifier for VerifierImpl {
8787 protocol_parameters : & entities:: ProtocolParameters ,
8888 ) -> Result < ( ) , ProtocolError > {
8989 debug ! ( "Verify multi signature for {:?}" , message) ;
90- let clerk = self . create_clerk ( signers_with_stakes, protocol_parameters) ;
91-
92- // todo: these two declarations are patches. Probably better ways to do this.
93- let avk = clerk
94- . as_ref ( )
95- . unwrap ( )
96- . compute_avk ( ) ;
97- let protocol_parameters = ProtocolParameters {
98- k : protocol_parameters. k ,
99- m : protocol_parameters. m ,
100- phi_f : protocol_parameters. phi_f as f64 ,
101- } ;
10290 let multi_signature: ProtocolMultiSignature =
10391 key_decode_hex ( multi_signature) . map_err ( ProtocolError :: VerifyMultiSignatureError ) ?;
10492 multi_signature
105- . verify ( message, & avk, & protocol_parameters)
93+ . verify (
94+ message,
95+ & self
96+ . create_clerk ( signers_with_stakes, protocol_parameters) ?
97+ . compute_avk ( ) ,
98+ & protocol_parameters. to_owned ( ) . into ( ) ,
99+ )
106100 . map_err ( |e| ProtocolError :: VerifyMultiSignatureError ( e. to_string ( ) ) )
107101 }
108102}
0 commit comments