@@ -11,7 +11,6 @@ use mithril_common::{
11
11
entities:: { self , Epoch , SignerWithStake , StakeDistribution } ,
12
12
protocol:: { MultiSigner as ProtocolMultiSigner , SignerBuilder } ,
13
13
store:: { StakeStorer , StoreError } ,
14
- StdError ,
15
14
} ;
16
15
17
16
use crate :: { entities:: OpenMessage , store:: VerificationKeyStorer , ProtocolParametersStorer } ;
@@ -38,10 +37,6 @@ pub enum ProtocolError {
38
37
#[ error( "single signature already recorded" ) ]
39
38
ExistingSingleSignature ( entities:: PartyId ) ,
40
39
41
- /// Codec error.
42
- #[ error( "codec error: '{0:?}'" ) ]
43
- Codec ( StdError ) ,
44
-
45
40
/// Mithril STM library returned an error.
46
41
#[ error( "core error: '{0}'" ) ]
47
42
Core ( String ) ,
@@ -122,31 +117,29 @@ pub trait MultiSigner: Sync + Send {
122
117
/// Compute stake distribution aggregate verification key
123
118
async fn compute_stake_distribution_aggregate_verification_key (
124
119
& self ,
125
- ) -> Result < String , ProtocolError > {
120
+ ) -> Result < ProtocolAggregateVerificationKey , ProtocolError > {
126
121
let signers_with_stake = self . get_signers_with_stake ( ) . await ?;
127
122
let protocol_parameters = self
128
123
. get_protocol_parameters ( )
129
124
. await ?
130
125
. ok_or_else ( ProtocolError :: UnavailableProtocolParameters ) ?;
131
- let avk = self
126
+ Ok ( self
132
127
. compute_aggregate_verification_key ( & signers_with_stake, & protocol_parameters)
133
- . await ?;
134
- Ok ( avk. to_json_hex ( ) . map_err ( ProtocolError :: Codec ) ?)
128
+ . await ?)
135
129
}
136
130
137
131
/// Compute next stake distribution aggregate verification key
138
132
async fn compute_next_stake_distribution_aggregate_verification_key (
139
133
& self ,
140
- ) -> Result < String , ProtocolError > {
134
+ ) -> Result < ProtocolAggregateVerificationKey , ProtocolError > {
141
135
let next_signers_with_stake = self . get_next_signers_with_stake ( ) . await ?;
142
136
let protocol_parameters = self
143
137
. get_next_protocol_parameters ( )
144
138
. await ?
145
139
. ok_or_else ( ProtocolError :: UnavailableProtocolParameters ) ?;
146
- let next_avk = self
140
+ Ok ( self
147
141
. compute_aggregate_verification_key ( & next_signers_with_stake, & protocol_parameters)
148
- . await ?;
149
- Ok ( next_avk. to_json_hex ( ) . map_err ( ProtocolError :: Codec ) ?)
142
+ . await ?)
150
143
}
151
144
152
145
/// Get signers
0 commit comments