Skip to content

Commit

Permalink
fw tests: fix tests w/solc 0.8.20 by specifying target evm version
Browse files Browse the repository at this point in the history
  • Loading branch information
danceratopz committed Jun 14, 2023
1 parent 15f06a3 commit a596b66
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions src/ethereum_test_tools/tests/test_filler.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def test_make_genesis(fork: Fork, hash: str):
sstore(0, f(1, 2))
return(0, 32)
}
"""
""",
fork=fork,
),
),
TestAddress: Account(balance=0x0BA1A9CE0BA1A9CE),
Expand Down Expand Up @@ -127,7 +128,8 @@ def test_fill_state_test(fork: Fork, expected_json_file: str):
assert fixture_json == expected


def test_fill_london_blockchain_test_valid_txs():
@pytest.mark.parametrize("fork", [London])
def test_fill_london_blockchain_test_valid_txs(fork: Fork):
"""
Test `ethereum_test.filler.fill_fixtures` with `BlockchainTest`.
"""
Expand All @@ -147,7 +149,8 @@ def test_fill_london_blockchain_test_valid_txs():
sstore(add(number(), 0x2000), selfbalance())
stop()
}
"""
""",
fork=fork,
),
),
"0xcccccccccccccccccccccccccccccccccccccccd": Account(
Expand All @@ -160,7 +163,8 @@ def test_fill_london_blockchain_test_valid_txs():
0xcccccccccccccccccccccccccccccccccccccccc,
0, 0, 0, 0)
}
"""
""",
fork=fork,
),
),
"0x000000000000000000000000000000000000c0de": Account(
Expand All @@ -173,7 +177,8 @@ def test_fill_london_blockchain_test_valid_txs():
0xcccccccccccccccccccccccccccccccccccccccc,
0, 0, 0, 0)
}
"""
""",
fork=fork,
),
),
"0xccccccccccccccccccccccccccccccccccccccce": Account(
Expand All @@ -188,7 +193,8 @@ def test_fill_london_blockchain_test_valid_txs():
0xcccccccccccccccccccccccccccccccccccccccc,
0, 0, 0, 0)
}
"""
""",
fork=fork,
),
),
}
Expand Down Expand Up @@ -387,11 +393,11 @@ def test_fill_london_blockchain_test_valid_txs():
t8n = EvmTransitionTool()

fixture = {
f"000/my_blockchain_test/{London}": fill_test(
f"000/my_blockchain_test/{fork.name()}": fill_test(
t8n=t8n,
b11r=b11r,
test_spec=blockchain_test,
fork=London,
fork=fork,
engine="NoProof",
spec=None,
)
Expand All @@ -413,7 +419,8 @@ def test_fill_london_blockchain_test_valid_txs():
assert fixture_json == expected


def test_fill_london_blockchain_test_invalid_txs():
@pytest.mark.parametrize("fork", [London])
def test_fill_london_blockchain_test_invalid_txs(fork):
"""
Test `ethereum_test.filler.fill_fixtures` with `BlockchainTest`.
"""
Expand All @@ -433,7 +440,8 @@ def test_fill_london_blockchain_test_invalid_txs():
sstore(add(number(), 0x2000), selfbalance())
stop()
}
"""
""",
fork=fork,
),
),
"0xcccccccccccccccccccccccccccccccccccccccd": Account(
Expand All @@ -446,7 +454,8 @@ def test_fill_london_blockchain_test_invalid_txs():
0xcccccccccccccccccccccccccccccccccccccccc,
0, 0, 0, 0)
}
"""
""",
fork=fork,
),
),
"0x000000000000000000000000000000000000c0de": Account(
Expand All @@ -459,7 +468,8 @@ def test_fill_london_blockchain_test_invalid_txs():
0xcccccccccccccccccccccccccccccccccccccccc,
0, 0, 0, 0)
}
"""
""",
fork=fork,
),
),
"0xccccccccccccccccccccccccccccccccccccccce": Account(
Expand All @@ -474,7 +484,8 @@ def test_fill_london_blockchain_test_invalid_txs():
0xcccccccccccccccccccccccccccccccccccccccc,
0, 0, 0, 0)
}
"""
""",
fork=fork,
),
),
}
Expand Down Expand Up @@ -719,11 +730,11 @@ def test_fill_london_blockchain_test_invalid_txs():
t8n = EvmTransitionTool()

fixture = {
f"000/my_blockchain_test/{London}": fill_test(
f"000/my_blockchain_test/{fork.name()}": fill_test(
t8n=t8n,
b11r=b11r,
test_spec=blockchain_test,
fork=London,
fork=fork,
engine="NoProof",
spec=None,
)
Expand Down

0 comments on commit a596b66

Please sign in to comment.