Skip to content

Commit

Permalink
fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Nov 5, 2023
1 parent 83a27e6 commit 0a1cdff
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tests/base_conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def _deploy_blueprint_for(w3, source_code, optimize, initcode_prefix=b"", **kwar
settings.optimize = optimize
out = compiler.compile_code(
source_code,
["abi", "bytecode"],
output_formats=["abi", "bytecode", "metadata", "userdoc", "devdoc"],
settings=settings,
show_gas_estimates=True, # Enable gas estimates for testing
)
Expand Down
2 changes: 1 addition & 1 deletion tests/parser/features/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(a: uint256):
assert c.val() == 123

# Make sure the init code does not access calldata
assembly = vyper.compile_code(code, ["asm"])["asm"].split(" ")
assembly = vyper.compile_code(code, output_formats=["asm"])["asm"].split(" ")
ir_return_idx_start = assembly.index("{")
ir_return_idx_end = assembly.index("}")

Expand Down
2 changes: 1 addition & 1 deletion tests/parser/functions/test_bitwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def _shr(x: uint256, y: uint256) -> uint256:


def test_bitwise_opcodes():
opcodes = compile_code(code, ["opcodes"])["opcodes"]
opcodes = compile_code(code, output_formats=["opcodes"])["opcodes"]
assert "SHL" in opcodes
assert "SHR" in opcodes

Expand Down
8 changes: 4 additions & 4 deletions tests/parser/functions/test_raw_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ def test_raw_call(_target: address):
def test_raw_call(_target: address):
raw_call(_target, method_id("foo()"), max_outsize=0)
"""
output1 = compile_code(code1, ["bytecode", "bytecode_runtime"])
output2 = compile_code(code2, ["bytecode", "bytecode_runtime"])
output1 = compile_code(code1, output_formats=["bytecode", "bytecode_runtime"])
output2 = compile_code(code2, output_formats=["bytecode", "bytecode_runtime"])
assert output1 == output2


Expand All @@ -296,8 +296,8 @@ def test_raw_call(_target: address) -> bool:
a: bool = raw_call(_target, method_id("foo()"), max_outsize=0, revert_on_failure=False)
return a
"""
output1 = compile_code(code1, ["bytecode", "bytecode_runtime"])
output2 = compile_code(code2, ["bytecode", "bytecode_runtime"])
output1 = compile_code(code1, output_formats=["bytecode", "bytecode_runtime"])
output2 = compile_code(code2, output_formats=["bytecode", "bytecode_runtime"])
assert output1 == output2


Expand Down
4 changes: 2 additions & 2 deletions tests/parser/functions/test_return_struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test() -> Voter:
return a
"""

out = compile_code(code, ["abi"])
out = compile_code(code, output_formats=["abi"])
abi = out["abi"][0]

assert abi["name"] == "test"
Expand All @@ -38,7 +38,7 @@ def test() -> Voter:
return a
"""

out = compile_code(code, ["abi"])
out = compile_code(code, output_formats=["abi"])
abi = out["abi"][0]

assert abi["name"] == "test"
Expand Down
2 changes: 1 addition & 1 deletion tests/parser/syntax/test_codehash.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def foo4() -> bytes32:
return self.a.codehash
"""
settings = Settings(evm_version=evm_version, optimize=optimize)
compiled = compile_code(code, ["bytecode_runtime"], settings=settings)
compiled = compile_code(code, output_formats=["bytecode_runtime"], settings=settings)
bytecode = bytes.fromhex(compiled["bytecode_runtime"][2:])
hash_ = keccak256(bytecode)

Expand Down
2 changes: 1 addition & 1 deletion tests/parser/syntax/test_self_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __default__():
pass
"""
settings = Settings(evm_version=evm_version)
opcodes = compiler.compile_code(code, ["opcodes"], settings=settings)["opcodes"]
opcodes = compiler.compile_code(code, output_formats=["opcodes"], settings=settings)["opcodes"]
if EVM_VERSIONS[evm_version] >= EVM_VERSIONS["istanbul"]:
assert "SELFBALANCE" in opcodes
else:
Expand Down

0 comments on commit 0a1cdff

Please sign in to comment.