From 63e2915e1248bae426d5a7d7da912bd9dd628f8e Mon Sep 17 00:00:00 2001 From: protolambda Date: Fri, 2 Aug 2019 21:43:36 +0200 Subject: [PATCH] update SSZ static doc to reflect options in test conditions --- specs/test_formats/ssz_static/core.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/specs/test_formats/ssz_static/core.md b/specs/test_formats/ssz_static/core.md index a7301a3c8..d0cfd25f6 100644 --- a/specs/test_formats/ssz_static/core.md +++ b/specs/test_formats/ssz_static/core.md @@ -40,10 +40,14 @@ The same value as `serialized.ssz`, represented as YAML. ## Condition A test-runner can implement the following assertions: -- Serialization: After parsing the `value`, SSZ-serialize it: the output should match `serialized` +- If YAML decoding of SSZ objects is supported by the implementation: + - Serialization: After parsing the `value`, SSZ-serialize it: the output should match `serialized` + - Deserialization: SSZ-deserialize the `serialized` value, and see if it matches the parsed `value` +- If YAML decoding of SSZ objects is not supported by the implementation: + - Serialization in 2 steps: deserialize `serialized`, then serialize the result, + and verify if the bytes match the original `serialized`. - Hash-tree-root: After parsing the `value` (or deserializing `serialized`), Hash-tree-root it: the output should match `root` - Optionally also check `signing_root`, if present. -- Deserialization: SSZ-deserialize the `serialized` value, and see if it matches the parsed `value` ## References