@@ -8,7 +8,7 @@ use mithril_common::entities::{
88 PartyId , ProtocolMessage , ProtocolParameters , SignerWithStake , SingleSignatures , Stake ,
99} ;
1010use mithril_common:: protocol:: SignerBuilder ;
11- use mithril_common:: StdError ;
11+ use mithril_common:: { StdError , StdResult } ;
1212
1313#[ cfg( test) ]
1414use mockall:: automock;
@@ -46,14 +46,14 @@ pub trait SingleSigner: Sync + Send {
4646 protocol_message : & ProtocolMessage ,
4747 signers_with_stake : & [ SignerWithStake ] ,
4848 protocol_initializer : & ProtocolInitializer ,
49- ) -> Result < Option < SingleSignatures > , SingleSignerError > ;
49+ ) -> StdResult < Option < SingleSignatures > > ;
5050
5151 /// Compute aggregate verification key from stake distribution
5252 fn compute_aggregate_verification_key (
5353 & self ,
5454 signers_with_stake : & [ SignerWithStake ] ,
5555 protocol_initializer : & ProtocolInitializer ,
56- ) -> Result < Option < String > , SingleSignerError > ;
56+ ) -> StdResult < Option < String > > ;
5757
5858 /// Get party id
5959 fn get_party_id ( & self ) -> PartyId ;
@@ -66,10 +66,6 @@ pub enum SingleSignerError {
6666 #[ error( "the protocol signer creation failed: `{0}`" ) ]
6767 ProtocolSignerCreationFailure ( String ) ,
6868
69- /// Encoding / Decoding error.
70- #[ error( "codec error: '{0:?}'" ) ]
71- Codec ( StdError ) ,
72-
7369 /// Signature Error
7470 #[ error( "Signature Error: {0:?}" ) ]
7571 SignatureFailed ( StdError ) ,
@@ -97,7 +93,7 @@ impl SingleSigner for MithrilSingleSigner {
9793 protocol_message : & ProtocolMessage ,
9894 signers_with_stake : & [ SignerWithStake ] ,
9995 protocol_initializer : & ProtocolInitializer ,
100- ) -> Result < Option < SingleSignatures > , SingleSignerError > {
96+ ) -> StdResult < Option < SingleSignatures > > {
10197 let builder = SignerBuilder :: new (
10298 signers_with_stake,
10399 & protocol_initializer. get_protocol_parameters ( ) . into ( ) ,
@@ -131,7 +127,7 @@ impl SingleSigner for MithrilSingleSigner {
131127 & self ,
132128 signers_with_stake : & [ SignerWithStake ] ,
133129 protocol_initializer : & ProtocolInitializer ,
134- ) -> Result < Option < String > , SingleSignerError > {
130+ ) -> StdResult < Option < String > > {
135131 let signer_builder = SignerBuilder :: new (
136132 signers_with_stake,
137133 & protocol_initializer. get_protocol_parameters ( ) . into ( ) ,
@@ -140,8 +136,7 @@ impl SingleSigner for MithrilSingleSigner {
140136
141137 let encoded_avk = signer_builder
142138 . compute_aggregate_verification_key ( )
143- . to_json_hex ( )
144- . map_err ( SingleSignerError :: Codec ) ?;
139+ . to_json_hex ( ) ?;
145140
146141 Ok ( Some ( encoded_avk) )
147142 }
0 commit comments