Skip to content

Commit

Permalink
start with phase0 hardcoded code
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed Jun 22, 2023
1 parent e7e2282 commit dba5d99
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,8 +801,9 @@ def objects_to_spec(preset_name: str,
)
)

# Collect previous fork's builders starting with fork, e.g. [bellatrix, altair, phase0]
builders = [spec_builders[fork] for fork in collect_prev_forks(fork)]
# Collect builders with the reversed previous forks
# e.g. `[bellatrix, altair, phase0]` -> `[phase0, altair, bellatrix]`
builders = [spec_builders[fork] for fork in collect_prev_forks(fork)[::-1]]

def format_protocol(protocol_name: str, protocol_def: ProtocolDefinition) -> str:
abstract_functions = ["verify_and_notify_new_payload"]
Expand Down Expand Up @@ -871,7 +872,7 @@ def format_constant(name: str, vardef: VariableDefinition) -> str:
preparations = reduce(lambda txt, builder: (txt + "\n\n" + builder.preparations() ).strip("\n"), builders, "")
sundry_functions = reduce(lambda txt, builder: (txt + "\n\n" + builder.sundry_functions() ).strip("\n"), builders, "")
# Keep engine from the most recent fork
execution_engine_cls = reduce(lambda txt, builder: txt or builder.execution_engine_cls(), builders, "")
execution_engine_cls = reduce(lambda txt, builder: builder.execution_engine_cls() or txt, builders, "")

constant_vars_spec = '# Constant vars\n' + '\n'.join(format_constant(k, v) for k, v in spec_object.constant_vars.items())
preset_vars_spec = '# Preset vars\n' + '\n'.join(format_constant(k, v) for k, v in spec_object.preset_vars.items())
Expand Down

0 comments on commit dba5d99

Please sign in to comment.