1
- use anyhow:: { Context , Result } ;
1
+ use anyhow:: Context ;
2
2
use rand_chacha:: ChaCha20Rng ;
3
3
use rand_core:: { CryptoRng , RngCore , SeedableRng } ;
4
4
use std:: path:: Path ;
@@ -11,6 +11,7 @@ use crate::{
11
11
} ,
12
12
entities:: { PartyId , ProtocolParameters , SignerWithStake } ,
13
13
protocol:: MultiSigner ,
14
+ StdResult ,
14
15
} ;
15
16
16
17
use super :: SingleSigner ;
@@ -35,7 +36,7 @@ impl SignerBuilder {
35
36
pub fn new (
36
37
registered_signers : & [ SignerWithStake ] ,
37
38
protocol_parameters : & ProtocolParameters ,
38
- ) -> Result < Self > {
39
+ ) -> StdResult < Self > {
39
40
if registered_signers. is_empty ( ) {
40
41
return Err ( SignerBuilderError :: EmptySigners . into ( ) ) ;
41
42
}
@@ -91,7 +92,7 @@ impl SignerBuilder {
91
92
signer_with_stake : SignerWithStake ,
92
93
kes_secret_key_path : Option < & Path > ,
93
94
rng : & mut R ,
94
- ) -> Result < ( SingleSigner , ProtocolInitializer ) > {
95
+ ) -> StdResult < ( SingleSigner , ProtocolInitializer ) > {
95
96
let protocol_initializer = ProtocolInitializer :: setup (
96
97
self . protocol_parameters . clone ( ) . into ( ) ,
97
98
kes_secret_key_path,
@@ -127,7 +128,7 @@ impl SignerBuilder {
127
128
& self ,
128
129
signer_with_stake : SignerWithStake ,
129
130
kes_secret_key_path : Option < & Path > ,
130
- ) -> Result < ( SingleSigner , ProtocolInitializer ) > {
131
+ ) -> StdResult < ( SingleSigner , ProtocolInitializer ) > {
131
132
self . build_single_signer_with_rng (
132
133
signer_with_stake,
133
134
kes_secret_key_path,
@@ -142,7 +143,7 @@ impl SignerBuilder {
142
143
& self ,
143
144
signer_with_stake : SignerWithStake ,
144
145
kes_secret_key_path : Option < & Path > ,
145
- ) -> Result < ( SingleSigner , ProtocolInitializer ) > {
146
+ ) -> StdResult < ( SingleSigner , ProtocolInitializer ) > {
146
147
let protocol_initializer_seed: [ u8 ; 32 ] = signer_with_stake. party_id . as_bytes ( ) [ ..32 ]
147
148
. try_into ( )
148
149
. unwrap ( ) ;
@@ -169,7 +170,7 @@ impl SignerBuilder {
169
170
& self ,
170
171
party_id : PartyId ,
171
172
protocol_initializer : ProtocolInitializer ,
172
- ) -> Result < SingleSigner > {
173
+ ) -> StdResult < SingleSigner > {
173
174
let single_signer = protocol_initializer
174
175
. new_signer ( self . closed_key_registration . clone ( ) )
175
176
. with_context ( || {
0 commit comments