Skip to content

Commit

Permalink
Merge pull request #3001 from ethereum/bls-output-null
Browse files Browse the repository at this point in the history
Update BLS test format: output `null` for invalid case
  • Loading branch information
hwwhww authored Sep 22, 2022
2 parents c0ef942 + 93b7ae2 commit 73c96b2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/formats/bls/aggregate.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 or empty.
output: BLS Signature -- expected output, single BLS signature or `null`.
```
- `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.
- output value is `null` if the input is invalid.

All byte(s) fields are encoded as strings, hexadecimal encoding, prefixed with `0x`.

Expand Down
4 changes: 2 additions & 2 deletions tests/formats/bls/eth_aggregate_pubkeys.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ The test data is declared in a `data.yaml` file:

```yaml
input: List[BLS Pubkey] -- list of input BLS pubkeys
output: BLSPubkey -- expected output, single BLS pubkeys or empty.
output: BLSPubkey -- expected output, single BLS pubkeys or `null`.
```
- `BLS Pubkey` here is encoded as a string: hexadecimal encoding of 48 bytes (96 nibbles), prefixed with `0x`.
- No output value if the input is invalid.
- output value is `null` if the input is invalid.

## Condition

Expand Down
9 changes: 7 additions & 2 deletions tests/formats/bls/sign.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ The test data is declared in a `data.yaml` file:
input:
privkey: bytes32 -- the private key used for signing
message: bytes32 -- input message to sign (a hash)
output: BLS Signature -- expected output, single BLS signature or empty.
output: BLS Signature -- expected output, single BLS signature or `null`.
```
All byte(s) fields are encoded as strings, hexadecimal encoding, prefixed with `0x`.
- All byte(s) fields are encoded as strings, hexadecimal encoding, prefixed with `0x`.
- output value is `null` if the input is invalid.

## Condition

The `sign` handler should sign `message` with `privkey`, and the resulting signature should match the expected `output`.

0 comments on commit 73c96b2

Please sign in to comment.