This commit is contained in:
Hsiao-Wei Wang 2019-06-18 14:07:05 -06:00
parent 060041945c
commit 7d2f0a9dc0
No known key found for this signature in database
GPG Key ID: 95B070122902DEA4

View File

@ -132,17 +132,11 @@ def objects_to_spec(functions: Dict[str, str],
f" def __init__(self, _x: {value}) -> None:\n"
f" ...\n"
if value.startswith("uint")
# else ""
# else f"{key} = {value}\n"
else f"class {key}({value}):\n pass\n"
for key, value in custom_types.items()
]
)
)
# new_type_definitions += '\n'.join(['Bytes%s = BytesN[%s]' % (n, n) for n in byte_types])
# new_type_definitions += '\n' + '\n'.join(['Hash = Bytes32', 'BLSPubkey = Bytes48', 'BLSSignature = Bytes96'])
# new_type_definitions += \
# '\n' + '\n'.join(['''%s = NewType('%s', %s)''' % (key, key, value) for key, value in new_types.items()])
functions_spec = '\n\n'.join(functions.values())
constants_spec = '\n'.join(map(lambda x: '%s = %s' % (x, constants[x]), constants))
ssz_objects_instantiation_spec = '\n\n'.join(ssz_objects.values())