Skip to content

Commit a1ee8c1

Browse files
committed
resolve unmatched errors in common
1 parent a2ea280 commit a1ee8c1

File tree

2 files changed

+26
-24
lines changed

2 files changed

+26
-24
lines changed

mithril-common/src/protocol/multi_signer.rs

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use anyhow::anyhow;
1+
use anyhow::{Context, anyhow};
22
use mithril_stm::{AggregateSignatureType, Parameters};
33

44
use crate::{
@@ -70,19 +70,20 @@ impl MultiSigner {
7070
))
7171
})?;
7272

73-
protocol_signature.verify(
74-
&self.protocol_parameters,
75-
&vk,
76-
&stake,
77-
&avk,
78-
message.to_message().as_bytes(),
79-
)?;
80-
// .with_context(|| {
81-
// format!(
82-
// "Invalid signature for party: '{}'",
83-
// single_signature.party_id
84-
// )
85-
// })?;
73+
protocol_signature
74+
.verify(
75+
&self.protocol_parameters,
76+
&vk,
77+
&stake,
78+
&avk,
79+
message.to_message().as_bytes(),
80+
)
81+
.with_context(|| {
82+
format!(
83+
"Invalid signature for party: '{}'",
84+
single_signature.party_id
85+
)
86+
})?;
8687

8788
Ok(())
8889
}

mithril-common/src/protocol/signer_builder.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,17 @@ impl SignerBuilder {
4949
let mut key_registration = ProtocolKeyRegistration::init(&stake_distribution);
5050

5151
for signer in registered_signers {
52-
key_registration.register(
53-
Some(signer.party_id.to_owned()),
54-
signer.operational_certificate.clone(),
55-
signer.verification_key_signature,
56-
signer.kes_period,
57-
signer.verification_key,
58-
)?;
59-
// .with_context(|| {
60-
// format!("Registration failed for signer: '{}'", signer.party_id)
61-
// })?;
52+
key_registration
53+
.register(
54+
Some(signer.party_id.to_owned()),
55+
signer.operational_certificate.clone(),
56+
signer.verification_key_signature,
57+
signer.kes_period,
58+
signer.verification_key,
59+
)
60+
.with_context(|| {
61+
format!("Registration failed for signer: '{}'", signer.party_id)
62+
})?;
6263
}
6364

6465
let closed_registration = key_registration.close();

0 commit comments

Comments
 (0)