Ensure attestations are created with empty signature (#960)

* Ensure attestations are created with empty sig

* Update docs
This commit is contained in:
Paul Hauner
2020-03-30 09:29:29 +11:00
committed by GitHub
parent 784997b09b
commit 5a6e90428b
4 changed files with 8 additions and 5 deletions

View File

@@ -32,9 +32,12 @@ impl AggregateSignature {
/// Add (aggregate) a signature to the `AggregateSignature`.
pub fn add(&mut self, signature: &Signature) {
if !self.is_empty {
self.aggregate_signature.add(signature.as_raw())
if self.is_empty {
self.aggregate_signature = RawAggregateSignature::new();
self.is_empty = false;
}
self.aggregate_signature.add(signature.as_raw())
}
/// Add (aggregate) another `AggregateSignature`.