update ssz test format and fix uint sizes
This commit is contained in:
parent
88d076b615
commit
b6c45b9dc1
|
@ -5,22 +5,19 @@ SSZ supports encoding of uints up to 32 bytes. These are considered to be basic
|
||||||
## Test case format
|
## Test case format
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
TODO: old format
|
type: "uintN" -- string, where N is one of [8, 16, 32, 64, 128, 256]
|
||||||
# type: "uintN" -- string, where N is one of [8, 16, 32, 64, 128, 256]
|
valid: bool -- expected validity of the input data
|
||||||
# valid: bool -- expected validity of the input data
|
value: string -- string, decimal encoding, to support up to 256 bit integers
|
||||||
# ssz: bytes -- string, input data, hex encoded, with prefix 0x
|
ssz: bytes -- string, input data, hex encoded, with prefix 0x
|
||||||
# tags: List[string] -- description of test case, in the form of a list of labels
|
tags: List[string] -- description of test case, in the form of a list of labels
|
||||||
```
|
```
|
||||||
|
|
||||||
## Condition
|
## Condition
|
||||||
|
|
||||||
- Encoding: After encoding the given input number, the
|
Two-way testing can be implemented in the test-runner:
|
||||||
- Decoding: After decoding the given `output` bytes, it should match the `input` number
|
- Encoding: After encoding the given input number `value`, the output should match `ssz`
|
||||||
|
- Decoding: After decoding the given `ssz` bytes, it should match the input number `value`
|
||||||
|
|
||||||
## Forks
|
## Forks
|
||||||
|
|
||||||
Forks-interpretation: `collective`
|
Forks-interpretation: `collective`
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
|
@ -15,7 +15,7 @@ from renderers import (
|
||||||
random.seed(0)
|
random.seed(0)
|
||||||
|
|
||||||
|
|
||||||
BIT_SIZES = [i for i in range(8, 512 + 1, 8)]
|
BIT_SIZES = [8, 16, 32, 64, 128, 256]
|
||||||
RANDOM_TEST_CASES_PER_BIT_SIZE = 10
|
RANDOM_TEST_CASES_PER_BIT_SIZE = 10
|
||||||
RANDOM_TEST_CASES_PER_LENGTH = 3
|
RANDOM_TEST_CASES_PER_LENGTH = 3
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue