diff --git a/specs/test_formats/ssz/uint.md b/specs/test_formats/ssz/uint.md index c05a343af..f71ddecb8 100644 --- a/specs/test_formats/ssz/uint.md +++ b/specs/test_formats/ssz/uint.md @@ -5,22 +5,19 @@ SSZ supports encoding of uints up to 32 bytes. These are considered to be basic ## Test case format ```yaml -TODO: old format -# type: "uintN" -- string, where N is one of [8, 16, 32, 64, 128, 256] -# valid: bool -- expected validity of the input data -# 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 +type: "uintN" -- string, where N is one of [8, 16, 32, 64, 128, 256] +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 +tags: List[string] -- description of test case, in the form of a list of labels ``` ## Condition -- Encoding: After encoding the given input number, the -- Decoding: After decoding the given `output` bytes, it should match the `input` number +Two-way testing can be implemented in the test-runner: +- 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-interpretation: `collective` - -``` - -``` \ No newline at end of file diff --git a/test_generators/ssz/main.py b/test_generators/ssz/main.py index e53204df0..0e5d9d7c8 100644 --- a/test_generators/ssz/main.py +++ b/test_generators/ssz/main.py @@ -39,4 +39,4 @@ def ssz_uint_bounds_suite(configs_path: str) -> gen_typing.TestSuiteOutput: if __name__ == "__main__": - gen_runner.run_generator("ssz", [ssz_random_uint_suite, ssz_wrong_uint_suite, ssz_uint_bounds_suite]) \ No newline at end of file + gen_runner.run_generator("ssz", [ssz_random_uint_suite, ssz_wrong_uint_suite, ssz_uint_bounds_suite]) diff --git a/test_generators/ssz/uint_test_cases.py b/test_generators/ssz/uint_test_cases.py index d123564ca..9ede16848 100644 --- a/test_generators/ssz/uint_test_cases.py +++ b/test_generators/ssz/uint_test_cases.py @@ -15,7 +15,7 @@ from renderers import ( 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_LENGTH = 3