Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def aggregate_signatures(signatures: Sequence[BLSSignature]) -> BLSSignature:
if len(signatures) == 0:
return EMPTY_SIGNATURE
signatures_chia = [
InsecureSignature.from_bytes(signature)
for signature in signatures
]
aggregated_signature = InsecureSignature.aggregate(signatures_chia)
aggregated_signature_bytes = aggregated_signature.serialize()
return cast(BLSSignature, aggregated_signature_bytes)