make encoder output large uints as string, and fix ssz suite config setting

This commit is contained in:
protolambda 2019-04-18 11:37:02 +10:00
parent 40cc0420ab
commit 627c1a347a
2 changed files with 3 additions and 1 deletions

View File

@ -51,7 +51,7 @@ def get_ssz_suite(seed: int, config_name: str, mode: random_value.RandomizationM
summary="Test suite for ssz serialization and hash-tree-root",
forks_timeline="testing",
forks=["phase0"],
config="minimal",
config=config_name,
runner="ssz",
handler="static",
test_cases=ssz_static_cases(rng, mode, chaos, count)))

View File

@ -3,6 +3,8 @@ from eth2spec.utils.minimal_ssz import hash_tree_root
def encode(value, typ, include_hash_tree_roots=False):
if isinstance(typ, str) and typ[:4] == 'uint':
if typ[4:] == '128' or typ[4:] == '256':
return str(value)
return value
elif typ == 'bool':
assert value in (True, False)