Merge pull request #293 from michaelsproul/operation-pool

Implement Operation Pool
This commit is contained in:
Paul Hauner
2019-04-02 13:53:22 +11:00
committed by GitHub
26 changed files with 1451 additions and 403 deletions

View File

@@ -1,7 +1,7 @@
use super::PublicKey;
use bls_aggregates::AggregatePublicKey as RawAggregatePublicKey;
/// A single BLS signature.
/// A BLS aggregate public key.
///
/// This struct is a wrapper upon a base type and provides helper functions (e.g., SSZ
/// serialization).
@@ -17,7 +17,7 @@ impl AggregatePublicKey {
self.0.add(public_key.as_raw())
}
/// Returns the underlying signature.
/// Returns the underlying public key.
pub fn as_raw(&self) -> &RawAggregatePublicKey {
&self.0
}

View File

@@ -36,6 +36,11 @@ impl AggregateSignature {
}
}
/// Add (aggregate) another `AggregateSignature`.
pub fn add_aggregate(&mut self, agg_signature: &AggregateSignature) {
self.0.add_aggregate(&agg_signature.0)
}
/// Verify the `AggregateSignature` against an `AggregatePublicKey`.
///
/// Only returns `true` if the set of keys in the `AggregatePublicKey` match the set of keys

View File

@@ -31,6 +31,11 @@ impl FakeAggregateSignature {
// Do nothing.
}
/// Does glorious nothing.
pub fn add_aggregate(&mut self, _agg_sig: &FakeAggregateSignature) {
// Do nothing.
}
/// _Always_ returns `true`.
pub fn verify(
&self,