-
Notifications
You must be signed in to change notification settings - Fork 107
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
new(tests): add tests for DATALOADN validation and execution #1162
base: main
Are you sure you want to change the base?
Conversation
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.
Some minor comments
Section.Code( | ||
Op.DATALOADN[index] + Op.SSTORE(0, unchecked=True) + Op.STOP, | ||
), | ||
Section.Data(index * b"\xbe" + sentinel.to_bytes(32) + suffix_len * b"\xaf"), |
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.
Section.Data(index * b"\xbe" + sentinel.to_bytes(32) + suffix_len * b"\xaf"), | |
Section.Data( | |
index * b"\xbe" + sentinel.to_bytes(32, byteorder="big") + suffix_len * b"\xaf" | |
), |
Which python version are you currently using? 3.10 fails if byteorder
is not specified.
@pytest.mark.parametrize("suffix_len", [0, 1, 31, 32, 24000]) | ||
def test_dataloadn(eof_state_test: EOFStateTestFiller, index: int, suffix_len: int): | ||
"""Basic tests for DATALOADN execution.""" | ||
sentinel = 0x8000000000000000000000000000000000000000000000000000000000000001 |
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.
This is a really nice idea to keep the expected outcome simple π
container=Container( | ||
sections=[ | ||
Section.Code( | ||
Op.DATALOADN[index] + Op.SSTORE(0, unchecked=True) + Op.STOP, |
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.
Op.DATALOADN[index] + Op.SSTORE(0, unchecked=True) + Op.STOP, | |
Op.SSTORE(0, Op.DATALOADN[index]) + Op.STOP, |
Or is the current arrangement used to keep the usage of Op.DATALOADN
at the start of the line?
ποΈ Description
π Related Issues
β Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.