Skip to content

Commit

Permalink
be more explicit about usize casting since sbtc gets confused
Browse files Browse the repository at this point in the history
  • Loading branch information
xoloki committed Oct 28, 2024
1 parent a9606bc commit 86c2f48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/state_machine/signer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,12 @@ impl<SignerType: SignerTrait> Signer<SignerType> {
let mut missing_public_shares = HashSet::new();
let mut missing_private_shares = HashSet::new();
let mut bad_public_shares = HashSet::new();
let threshold: usize = self.threshold.try_into().unwrap();
if let Some(dkg_end_begin) = &self.dkg_end_begin_msg {
for signer_id in &dkg_end_begin.signer_ids {
if let Some(shares) = self.dkg_public_shares.get(signer_id) {
for (party_id, comm) in shares.comms.iter() {
if comm.poly.len() != self.threshold.try_into().unwrap() || !comm.verify() {
if comm.poly.len() != threshold || !comm.verify() {
bad_public_shares.insert(*signer_id);
} else {
self.commitments.insert(*party_id, comm.clone());
Expand Down
2 changes: 1 addition & 1 deletion src/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ impl traits::Aggregator for Aggregator {

/// Initialize the Aggregator polynomial
fn init(&mut self, comms: &HashMap<u32, PolyCommitment>) -> Result<(), AggregatorError> {
let threshold = self.threshold.try_into().unwrap();
let threshold: usize = self.threshold.try_into().unwrap();
let mut bad_poly_commitments = Vec::new();
for (_id, comm) in comms {
if comm.poly.len() != threshold || !comm.verify() {
Expand Down

0 comments on commit 86c2f48

Please sign in to comment.