Skip to content

Commit

Permalink
disable specific outputs for experimental codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
harkal committed Jan 3, 2024
1 parent 6bbd151 commit 3e4b562
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,15 +281,26 @@ def ir_compiler(ir, *args, **kwargs):


def _get_contract(
w3, source_code, optimize, *args, override_opt_level=None, input_bundle=None, **kwargs
w3,
source_code,
optimize,
*args,
override_opt_level=None,
input_bundle=None,
experimental_codegen=False,
**kwargs,
):
settings = Settings()
settings.evm_version = kwargs.pop("evm_version", None)
settings.optimize = override_opt_level or optimize
output_formats = list(compiler.OUTPUT_FORMATS.keys())
if experimental_codegen is False:
output_formats.remove("bb")
output_formats.remove("bb_runtime")
out = compiler.compile_code(
source_code,
# test that all output formats can get generated
output_formats=list(compiler.OUTPUT_FORMATS.keys()),
output_formats=output_formats,
settings=settings,
input_bundle=input_bundle,
show_gas_estimates=True, # Enable gas estimates for testing
Expand Down Expand Up @@ -355,13 +366,19 @@ def get_contract_module(source_code, *args, **kwargs):
return get_contract_module


def _deploy_blueprint_for(w3, source_code, optimize, initcode_prefix=b"", **kwargs):
def _deploy_blueprint_for(
w3, source_code, optimize, initcode_prefix=b"", experimental_codegen=False, **kwargs
):
settings = Settings()
settings.evm_version = kwargs.pop("evm_version", None)
settings.optimize = optimize
output_formats = list(compiler.OUTPUT_FORMATS.keys())
if experimental_codegen is False:
output_formats.remove("bb")
output_formats.remove("bb_runtime")
out = compiler.compile_code(
source_code,
output_formats=list(compiler.OUTPUT_FORMATS.keys()),
output_formats=output_formats,
settings=settings,
show_gas_estimates=True, # Enable gas estimates for testing
)
Expand Down

0 comments on commit 3e4b562

Please sign in to comment.