Skip to content

Commit

Permalink
fix rebase detritus
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-o-how committed Aug 5, 2024
1 parent 9d8262a commit 4303054
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions crates/chia-bls/src/bls_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,11 @@ pub mod tests {
assert!(bls_cache.is_empty());

// Verify the signature and add to the cache.
assert!(bls_cache.aggregate_verify(pks_msgs, &sig));
assert!(bls_cache.aggregate_verify(pks_msgs, &sig).0);
assert_eq!(bls_cache.len(), 1);

// Now that it's cached, it shouldn't cache it again.
assert!(bls_cache.aggregate_verify(pks_msgs, &sig));
assert!(bls_cache.aggregate_verify(pks_msgs, &sig).0);
assert_eq!(bls_cache.len(), 1);
}

Expand All @@ -213,7 +213,7 @@ pub mod tests {
assert!(bls_cache.is_empty());

// Add the first signature to cache.
assert!(bls_cache.aggregate_verify(pks_msgs.clone(), &agg_sig));
assert!(bls_cache.aggregate_verify(pks_msgs.clone(), &agg_sig).0);
assert_eq!(bls_cache.len(), 1);

// Try with the first key message pair in the cache but not the second.
Expand All @@ -224,7 +224,7 @@ pub mod tests {
agg_sig += &sign(&sk2, msg2);
pks_msgs.push((pk2, msg2));

assert!(bls_cache.aggregate_verify(pks_msgs.clone(), &agg_sig));
assert!(bls_cache.aggregate_verify(pks_msgs.clone(), &agg_sig).0);
assert_eq!(bls_cache.len(), 2);

// Try reusing a public key.
Expand All @@ -234,7 +234,7 @@ pub mod tests {
pks_msgs.push((pk2, msg3));

// Verify this signature and add to the cache as well (since it's still a different aggregate).
assert!(bls_cache.aggregate_verify(pks_msgs, &agg_sig));
assert!(bls_cache.aggregate_verify(pks_msgs, &agg_sig).0);
assert_eq!(bls_cache.len(), 3);
}

Expand All @@ -256,7 +256,7 @@ pub mod tests {
let pks_msgs = [(pk, msg)];

// Add to cache by validating them one at a time.
assert!(bls_cache.aggregate_verify(pks_msgs, &sig));
assert!(bls_cache.aggregate_verify(pks_msgs, &sig).0);
}

// The cache should be full now.
Expand All @@ -283,6 +283,6 @@ pub mod tests {

let pks_msgs: [(&PublicKey, &[u8]); 0] = [];

assert!(bls_cache.aggregate_verify(pks_msgs, &Signature::default()));
assert!(bls_cache.aggregate_verify(pks_msgs, &Signature::default()).0);
}
}

0 comments on commit 4303054

Please sign in to comment.