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

test(fw): Unit tests for post state verification errors #350

Merged
merged 3 commits into from
Jan 20, 2024
Merged

Conversation

winsvega
Copy link
Collaborator

@winsvega winsvega commented Nov 30, 2023

🗒️ Description

Adds filling framework unit tests for post state verification, of accounts including storage, nonce, code & balance mismatch. Ensure that the framework post state mismatches are occuring correctly.

🔗 Related Issues

N/A.

✅ Checklist

  • All: Set appropriate labels for the changes.
  • All: Considered squashing commits to improve commit history.
  • All: Added an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.

Copy link
Member

@danceratopz danceratopz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Would love more like this!

Below are a few pytest specific suggestions.

src/ethereum_test_tools/tests/test_filler_expect.py Outdated Show resolved Hide resolved
src/ethereum_test_tools/tests/test_filler_expect.py Outdated Show resolved Hide resolved
src/ethereum_test_tools/tests/test_filler_expect.py Outdated Show resolved Hide resolved
src/ethereum_test_tools/tests/test_filler_expect.py Outdated Show resolved Hide resolved
@danceratopz danceratopz added type:test Type: Test scope:fw Scope: Framework (evm|tools|forks|pytest) labels Dec 1, 2023
@spencer-tb spencer-tb changed the title unit test for post state verification error test(fw): Unit tests for post state verification errors Jan 11, 2024
Copy link
Member

@danceratopz danceratopz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of things occurred to me whilst working on #380, see comments below.

src/ethereum_test_tools/tests/test_filling/test_expect.py Outdated Show resolved Hide resolved
src/ethereum_test_tools/tests/test_filling/test_expect.py Outdated Show resolved Hide resolved
@danceratopz
Copy link
Member

I tried to express the test's intent a bit better by removing the split of exception checking across the helper function and the test. Now we have the setup code in the state_test fixture and the actual test is in the test. See #393.

winsvega and others added 3 commits January 20, 2024 17:15
* refactor: use pytest fixtures as apposed to helper function

* refactor: update comments due to state test fixtures #356

The functionality from ethereum_test.filler.fill_test() got moved to the StateTest, respectively BlockchainTest, generate() method.
Copy link
Collaborator

@spencer-tb spencer-tb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@spencer-tb spencer-tb merged commit 0e7c0f8 into main Jan 20, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:fw Scope: Framework (evm|tools|forks|pytest) type:test Type: Test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants