You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should have standardized tests for SSZ serialization and deserialization in a format compatible with the general test format. For this we just need to define
a name and
a test case format.
Test suite name
Just SSZ sounds good to me.
Test case format
I propose the following three formats:
For valid inputs:
type: <type def string>valid: truevalue: <the value to serialize>ssz: <serialized value>
For invalid SSZ:
type: <type def string>valid: falsessz: <corrupt serialized value>description: <string with very short explanation what's wrong>
For values that can't be serialized:
type: <type def string>valid: falsevalue: <invalid value>description: <string with very short explanation what's wrong>
The first test case type should be run in both directions and the results should match. Executing the other two types should check that serializing/deserializing fails in an orderly fashion.
Type definitions
bools, uints, bytes, hashes, and addresses are specified as a string. Examples:
We should have standardized tests for SSZ serialization and deserialization in a format compatible with the general test format. For this we just need to define
Test suite name
Just
SSZ
sounds good to me.Test case format
I propose the following three formats:
The first test case type should be run in both directions and the results should match. Executing the other two types should check that serializing/deserializing fails in an orderly fashion.
Type definitions
bools, uints, bytes, hashes, and addresses are specified as a string. Examples:
Containers are specified as mappings (note that we don't have to care about order anymore):
Lists are specified as sequences with a single element for the element type:
Value format
How values are formatted depends on the given type.
bool
: Eithertrue
orfalse
0x
prefixed hex strings:SSZ format
SSZ input/output should be encoded as
0x
prefixed hex. Examples:Example
Comments
The text was updated successfully, but these errors were encountered: