@@ -8,7 +8,7 @@ use mithril_common::entities::{
8
8
PartyId , ProtocolMessage , ProtocolParameters , SignerWithStake , SingleSignatures , Stake ,
9
9
} ;
10
10
use mithril_common:: protocol:: SignerBuilder ;
11
- use mithril_common:: StdError ;
11
+ use mithril_common:: { StdError , StdResult } ;
12
12
13
13
#[ cfg( test) ]
14
14
use mockall:: automock;
@@ -46,14 +46,14 @@ pub trait SingleSigner: Sync + Send {
46
46
protocol_message : & ProtocolMessage ,
47
47
signers_with_stake : & [ SignerWithStake ] ,
48
48
protocol_initializer : & ProtocolInitializer ,
49
- ) -> Result < Option < SingleSignatures > , SingleSignerError > ;
49
+ ) -> StdResult < Option < SingleSignatures > > ;
50
50
51
51
/// Compute aggregate verification key from stake distribution
52
52
fn compute_aggregate_verification_key (
53
53
& self ,
54
54
signers_with_stake : & [ SignerWithStake ] ,
55
55
protocol_initializer : & ProtocolInitializer ,
56
- ) -> Result < Option < String > , SingleSignerError > ;
56
+ ) -> StdResult < Option < String > > ;
57
57
58
58
/// Get party id
59
59
fn get_party_id ( & self ) -> PartyId ;
@@ -66,10 +66,6 @@ pub enum SingleSignerError {
66
66
#[ error( "the protocol signer creation failed: `{0}`" ) ]
67
67
ProtocolSignerCreationFailure ( String ) ,
68
68
69
- /// Encoding / Decoding error.
70
- #[ error( "codec error: '{0:?}'" ) ]
71
- Codec ( StdError ) ,
72
-
73
69
/// Signature Error
74
70
#[ error( "Signature Error: {0:?}" ) ]
75
71
SignatureFailed ( StdError ) ,
@@ -97,7 +93,7 @@ impl SingleSigner for MithrilSingleSigner {
97
93
protocol_message : & ProtocolMessage ,
98
94
signers_with_stake : & [ SignerWithStake ] ,
99
95
protocol_initializer : & ProtocolInitializer ,
100
- ) -> Result < Option < SingleSignatures > , SingleSignerError > {
96
+ ) -> StdResult < Option < SingleSignatures > > {
101
97
let builder = SignerBuilder :: new (
102
98
signers_with_stake,
103
99
& protocol_initializer. get_protocol_parameters ( ) . into ( ) ,
@@ -131,7 +127,7 @@ impl SingleSigner for MithrilSingleSigner {
131
127
& self ,
132
128
signers_with_stake : & [ SignerWithStake ] ,
133
129
protocol_initializer : & ProtocolInitializer ,
134
- ) -> Result < Option < String > , SingleSignerError > {
130
+ ) -> StdResult < Option < String > > {
135
131
let signer_builder = SignerBuilder :: new (
136
132
signers_with_stake,
137
133
& protocol_initializer. get_protocol_parameters ( ) . into ( ) ,
@@ -140,8 +136,7 @@ impl SingleSigner for MithrilSingleSigner {
140
136
141
137
let encoded_avk = signer_builder
142
138
. compute_aggregate_verification_key ( )
143
- . to_json_hex ( )
144
- . map_err ( SingleSignerError :: Codec ) ?;
139
+ . to_json_hex ( ) ?;
145
140
146
141
Ok ( Some ( encoded_avk) )
147
142
}
0 commit comments