Operation pool: refactor verify_deposit/exit

This commit is contained in:
Michael Sproul
2019-03-20 15:57:41 +11:00
parent 03c01c8a8d
commit b2fe14e12c
5 changed files with 118 additions and 61 deletions

View File

@@ -31,7 +31,9 @@ pub struct Attestation {
impl Attestation {
/// Are the aggregation bitfields of these attestations disjoint?
pub fn signers_disjoint_from(&self, other: &Attestation) -> bool {
self.aggregation_bitfield.intersection(&other.aggregation_bitfield).is_zero()
self.aggregation_bitfield
.intersection(&other.aggregation_bitfield)
.is_zero()
}
/// Aggregate another Attestation into this one.
@@ -41,7 +43,8 @@ impl Attestation {
debug_assert_eq!(self.data, other.data);
debug_assert!(self.signers_disjoint_from(other));
self.aggregation_bitfield.union_inplace(&other.aggregation_bitfield);
self.aggregation_bitfield
.union_inplace(&other.aggregation_bitfield);
self.custody_bitfield.union_inplace(&other.custody_bitfield);
// FIXME: signature aggregation once our BLS library wraps it
}