From 93b7ae299d78cd0c0dfb1721abfadac9abb0f930 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Wed, 21 Sep 2022 01:20:20 +0800 Subject: [PATCH] Update BLS test format: output `null` for invalid case --- tests/formats/bls/aggregate.md | 4 ++-- tests/formats/bls/eth_aggregate_pubkeys.md | 4 ++-- tests/formats/bls/sign.md | 9 +++++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/formats/bls/aggregate.md b/tests/formats/bls/aggregate.md index 81ce85fe66..7cdebcf4d9 100644 --- a/tests/formats/bls/aggregate.md +++ b/tests/formats/bls/aggregate.md @@ -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`. diff --git a/tests/formats/bls/eth_aggregate_pubkeys.md b/tests/formats/bls/eth_aggregate_pubkeys.md index 4f66adec21..2b72c1dcaf 100644 --- a/tests/formats/bls/eth_aggregate_pubkeys.md +++ b/tests/formats/bls/eth_aggregate_pubkeys.md @@ -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 diff --git a/tests/formats/bls/sign.md b/tests/formats/bls/sign.md index 93001beeed..09e9286148 100644 --- a/tests/formats/bls/sign.md +++ b/tests/formats/bls/sign.md @@ -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`.