-
Notifications
You must be signed in to change notification settings - Fork 89
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
β¨ feat(tests): PUSH opcode tests added #1018
base: main
Are you sure you want to change the base?
Conversation
The easiest way to do this would be to compile geth's Then you can use the uv run consume direct --input ./fixtures/
Yes I think it's always interesting to add negative tests cases, but let me explain a bit on how these data-portion opcodes such as The way these opcodes work is that the EVM interpreter already knows how many bytes it needs to read after However, the interesting thing would be to crop the bytecode of the smart contract so there's not enough bytes to complete the 4 bytes required by |
My bad! Reason is that the
Amazing! hive is one step further π
Reason being that Hive consumes two types of tests:
So when doing |
Hi @felix314159, could you try the following (note the addition of
Nice! |
Thanks, this works! What also works is |
FYI - #975 adds the same test. |
Good to know, but I would not call it the same test as you do not seem to test PUSH0. |
Thats correct. The test for |
tests/frontier/opcodes/test_push.py
Outdated
# in global scope so that it doesn't get re-created every iteration | ||
# generate list of values that require x bytes, x+1 bytes, etc. to store | ||
values = [0] + [get_largest_value_that_requires_at_least_x_bytes(i) for i in range(1, 33)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what you need here is a module-scoped fixture: https://docs.pytest.org/en/6.2.x/fixture.html#scope-sharing-fixtures-across-classes-modules-packages-or-session
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback, I pushed an improved version. Let me know if this still does not do what I originally intended it to do
ποΈ Description
hi, this is my first PR for this repo. please let me know if the tests are faulty or not useful.
i still have a few questions:
fill --fork=Cancun ./tests/frontier/opcodes/test_push.py
to get 99 passed. However, it also says 'No tests executed - the test fixtures in "fixtures/" may now be executed against a client'. How can I do this?π Related Issues
Fixes #972
β Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.