From 02d47f1554e2b037136a40937631a3aa91fcfabc Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Tue, 9 Jan 2024 14:54:52 +0100 Subject: [PATCH] ensure `floorlog2` is available for use in `Custom types` section --- pysetup/helpers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pysetup/helpers.py b/pysetup/helpers.py index b2fe00f75..44c98e06e 100644 --- a/pysetup/helpers.py +++ b/pysetup/helpers.py @@ -108,7 +108,7 @@ def objects_to_spec(preset_name: str, if vardef.comment is not None: out += f' # {vardef.comment}' return out - + # Merge all constant objects hardcoded_ssz_dep_constants = reduce(lambda obj, builder: {**obj, **builder.hardcoded_ssz_dep_constants()}, builders, {}) hardcoded_custom_type_dep_constants = reduce(lambda obj, builder: {**obj, **builder.hardcoded_custom_type_dep_constants(spec_object)}, builders, {}) @@ -131,12 +131,13 @@ def objects_to_spec(preset_name: str, imports, preparations, f"fork = \'{fork}\'\n", + # The helper functions that some SSZ containers require. Need to be defined before `custom_type_dep_constants` + CONSTANT_DEP_SUNDRY_CONSTANTS_FUNCTIONS, # The constants that some SSZ containers require. Need to be defined before `new_type_definitions` custom_type_dep_constants, - new_type_definitions, - CONSTANT_DEP_SUNDRY_CONSTANTS_FUNCTIONS, # The constants that some SSZ containers require. Need to be defined before `constants_spec` ssz_dep_constants, + new_type_definitions, constant_vars_spec, preset_vars_spec, config_spec,