Skip to content

Commit

Permalink
chore: test all output formats (#3683)
Browse files Browse the repository at this point in the history
right now only certain output formats are tested in the main compiler
test harness, namely bytecode, abi, metadata and some natspec outputs.
in the past, there have been issues where output formats get broken but
don't get detected until release testing or even after release.

this commit adds hooks in `get_contract()` and `deploy_blueprint_for()`
to generate all output formats, which will help detect broken output
formats sooner.
  • Loading branch information
charles-cooper authored Dec 16, 2023
1 parent 0b1f3e1 commit 919080e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ def _get_contract(
settings.optimize = override_opt_level or optimize
out = compiler.compile_code(
source_code,
# test that metadata and natspecs get generated
output_formats=["abi", "bytecode", "metadata", "userdoc", "devdoc"],
# test that all output formats can get generated
output_formats=list(compiler.OUTPUT_FORMATS.keys()),
settings=settings,
input_bundle=input_bundle,
show_gas_estimates=True, # Enable gas estimates for testing
Expand Down Expand Up @@ -352,7 +352,7 @@ def _deploy_blueprint_for(w3, source_code, optimize, initcode_prefix=b"", **kwar
settings.optimize = optimize
out = compiler.compile_code(
source_code,
output_formats=["abi", "bytecode", "metadata", "userdoc", "devdoc"],
output_formats=list(compiler.OUTPUT_FORMATS.keys()),
settings=settings,
show_gas_estimates=True, # Enable gas estimates for testing
)
Expand Down

0 comments on commit 919080e

Please sign in to comment.