Add `Aggregate()` case

This commit is contained in:
Hsiao-Wei Wang 2020-05-15 23:27:35 +08:00
parent 82073a4a83
commit d07e594f92
No known key found for this signature in database
GPG Key ID: 95B070122902DEA4
2 changed files with 16 additions and 3 deletions

View File

@ -8,11 +8,11 @@ The test data is declared in a `data.yaml` file:
```yaml
input: List[BLS Signature] -- list of input BLS signatures
output: BLS Signature -- expected output, single BLS signature
output: BLS Signature -- expected output, single BLS signature or empty.
```
`BLS Signature` here is encoded as a string: hexadecimal encoding of 96 bytes (192 nibbles), prefixed with `0x`.
- `BLS Signature` here is encoded as a string: hexadecimal encoding of 96 bytes (192 nibbles), prefixed with `0x`.
- No output value if the input is invalid.
## Condition

View File

@ -127,6 +127,19 @@ def case03_aggregate():
'output': encode_hex(bls.Aggregate(sigs)),
}
# Invalid pubkeys -- len(pubkeys) == 0
try:
bls.Aggregate([])
except Exception:
pass
else:
raise Exception("Should have been INVALID")
yield f'aggregate_na_pubkeys', {
'input': [],
'output': None,
}
def case04_fast_aggregate_verify():
for i, message in enumerate(MESSAGES):