@@ -5,8 +5,8 @@ use thiserror::Error;
5
5
6
6
use mithril_common:: crypto_helper:: {
7
7
key_decode_hex, key_encode_hex, KESPeriod , ProtocolClerk , ProtocolInitializer ,
8
- ProtocolKeyRegistration , ProtocolPartyId , ProtocolRegistrationError , ProtocolSigner ,
9
- ProtocolStakeDistribution ,
8
+ ProtocolInitializerError , ProtocolKeyRegistration , ProtocolPartyId , ProtocolRegistrationError ,
9
+ ProtocolSigner , ProtocolStakeDistribution ,
10
10
} ;
11
11
use mithril_common:: entities:: {
12
12
PartyId , ProtocolMessage , ProtocolParameters , SignerWithStake , SingleSignatures , Stake ,
@@ -15,14 +15,6 @@ use mithril_common::entities::{
15
15
#[ cfg( test) ]
16
16
use mockall:: automock;
17
17
18
- /// MithrilProtocolInitializerBuilder error structure.
19
- #[ derive( Error , Debug ) ]
20
- pub enum MithrilProtocolInitializerBuilderError {
21
- /// Could not parse a Cardano crypto file
22
- #[ error( "the cardano cryptographic file could not be parsed." ) ]
23
- CardanoCryptoParse ,
24
- }
25
-
26
18
/// This is responsible of creating new instances of ProtocolInitializer.
27
19
#[ derive( Default ) ]
28
20
pub struct MithrilProtocolInitializerBuilder { }
@@ -40,16 +32,15 @@ impl MithrilProtocolInitializerBuilder {
40
32
protocol_parameters : & ProtocolParameters ,
41
33
kes_secret_key_path : Option < PathBuf > ,
42
34
kes_period : Option < KESPeriod > ,
43
- ) -> Result < ProtocolInitializer , MithrilProtocolInitializerBuilderError > {
35
+ ) -> Result < ProtocolInitializer , ProtocolInitializerError > {
44
36
let mut rng = rand_core:: OsRng ;
45
37
let protocol_initializer = ProtocolInitializer :: setup (
46
38
protocol_parameters. to_owned ( ) . into ( ) ,
47
39
kes_secret_key_path,
48
40
kes_period,
49
41
stake. to_owned ( ) ,
50
42
& mut rng,
51
- )
52
- . map_err ( |_| MithrilProtocolInitializerBuilderError :: CardanoCryptoParse ) ?;
43
+ ) ?;
53
44
54
45
Ok ( protocol_initializer)
55
46
}
0 commit comments