Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ethereum/tests fixtures #1224

Merged
merged 5 commits into from
Sep 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eth/precompiles/modexp.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _compute_complexity(length):
length ** 2 // 4 + 96 * length - 3072
)
else:
return 2 ** 2 // 16 + 480 * length - 199680
return length ** 2 // 16 + 480 * length - 199680


def _extract_lengths(data):
Expand Down
2 changes: 1 addition & 1 deletion fixtures
Submodule fixtures updated 14326 files
4 changes: 2 additions & 2 deletions tests/core/vm/test_modexp_precompile.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
(EIP198_VECTOR_A, 13056),
(
EIP198_VECTOR_C,
708647586132375115992254428253169996062012306153720251921480414128428353393856280,
10684346944173007063723051170445283632835119638284563472873463025465780712173320789629146724657549280936306536701227228889744512638312451529980055895215896, # noqa: E501
),
),
)
def test_modexp_gas_fee_calcultation(data, expected):
def test_modexp_gas_fee_calculation(data, expected):
actual = _compute_modexp_gas_fee(data)
assert actual == expected

Expand Down
18 changes: 17 additions & 1 deletion tests/json-fixtures/test_blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,33 @@
BASE_FIXTURE_PATH = os.path.join(ROOT_PROJECT_DIR, 'fixtures', 'BlockchainTests')


# These are tests that are thought to be incorrect or buggy upstream,
# at the commit currently checked out in submodule `fixtures`.
# Ideally, this list should be empty.
# WHEN ADDING ENTRIES, ALWAYS PROVIDE AN EXPLANATION!
INCORRECT_UPSTREAM_TESTS = {
# The test considers a "synthetic" scenario (the state described there can't
# be arrived at using regular consensus rules).
# * https://github.com/ethereum/py-evm/pull/1224#issuecomment-418775512
# The result is in conflict with the yellow-paper:
# * https://github.com/ethereum/py-evm/pull/1224#issuecomment-418800369
('GeneralStateTests/stRevertTest/RevertInCreateInInit_d0g0v0.json', 'RevertInCreateInInit_d0g0v0_Byzantium'), # noqa: E501
}


def blockchain_fixture_mark_fn(fixture_path, fixture_name):
if fixture_path.startswith('bcExploitTest'):
return pytest.mark.skip("Exploit tests are slow")
elif fixture_path == 'bcWalletTest/walletReorganizeOwners.json':
return pytest.mark.skip("Wallet owner reorganization tests are slow")
elif (fixture_path, fixture_name) in INCORRECT_UPSTREAM_TESTS:
return pytest.mark.xfail(reason="Listed in INCORRECT_UPSTREAM_TESTS.")


def blockchain_fixture_ignore_fn(fixture_path, fixture_name):
if fixture_path.startswith('GeneralStateTests'):
# General state tests are also exported as blockchain tests. We
# skip them here so we don't run them twice"
# skip them here so we don't run them twice
return True


Expand Down
16 changes: 16 additions & 0 deletions tests/json-fixtures/test_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,20 @@ def expand_fixtures_forks(all_fixtures):
}


# These are tests that are thought to be incorrect or buggy upstream,
# at the commit currently checked out in submodule `fixtures`.
# Ideally, this list should be empty.
# WHEN ADDING ENTRIES, ALWAYS PROVIDE AN EXPLANATION!
INCORRECT_UPSTREAM_TESTS = {
# The test considers a "synthetic" scenario (the state described there can't
# be arrived at using regular consensus rules).
# * https://github.com/ethereum/py-evm/pull/1224#issuecomment-418775512
# The result is in conflict with the yellow-paper:
# * https://github.com/ethereum/py-evm/pull/1224#issuecomment-418800369
('stRevertTest/RevertInCreateInInit.json', 'RevertInCreateInInit', 'Byzantium', 0),
}


def mark_statetest_fixtures(fixture_path, fixture_key, fixture_fork, fixture_index):
fixture_id = (fixture_path, fixture_key, fixture_fork, fixture_index)
if fixture_path.startswith('stTransactionTest/zeroSigTransa'):
Expand All @@ -144,6 +158,8 @@ def mark_statetest_fixtures(fixture_path, fixture_key, fixture_fork, fixture_ind
return pytest.mark.skip("Skipping slow test")
elif fixture_path.startswith('stQuadraticComplexityTest'):
return pytest.mark.skip("Skipping slow test")
elif fixture_id in INCORRECT_UPSTREAM_TESTS:
return pytest.mark.xfail(reason="Listed in INCORRECT_UPSTREAM_TESTS.")


def pytest_generate_tests(metafunc):
Expand Down
15 changes: 15 additions & 0 deletions tests/trinity/json-fixtures-over-rpc/test_rpc_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,19 @@
'DelegateCallSpam_EIP150',
)

# These are tests that are thought to be incorrect or buggy upstream,
# at the commit currently checked out in submodule `fixtures`.
# Ideally, this list should be empty.
# WHEN ADDING ENTRIES, ALWAYS PROVIDE AN EXPLANATION!
INCORRECT_UPSTREAM_TESTS = {
# The test considers a "synthetic" scenario (the state described there can't
# be arrived at using regular consensus rules).
# * https://github.com/ethereum/py-evm/pull/1224#issuecomment-418775512
# The result is in conflict with the yellow-paper:
# * https://github.com/ethereum/py-evm/pull/1224#issuecomment-418800369
('GeneralStateTests/stRevertTest/RevertInCreateInInit_d0g0v0.json', 'RevertInCreateInInit_d0g0v0_Byzantium'), # noqa: E501
}

RPC_STATE_NORMALIZERS = {
'balance': remove_leading_zeros,
'code': empty_to_0x,
Expand Down Expand Up @@ -162,6 +175,8 @@ def blockchain_fixture_mark_fn(fixture_path, fixture_name):
if not should_run_slow_tests():
return pytest.mark.skip("skipping slow test on a quick run")
break
if (fixture_path, fixture_name) in INCORRECT_UPSTREAM_TESTS:
return pytest.mark.xfail(reason="Listed in INCORRECT_UPSTREAM_TESTS.")


def pytest_generate_tests(metafunc):
Expand Down