-
Notifications
You must be signed in to change notification settings - Fork 82
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: implement 0x52 - MSTORE Opcode #290
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.
It would be nice to add a tests that loads the entire memory and verifies the state of it.
For example when you do
ctx.stack.push(0xFF00);
ctx.stack.push(0x01);
Then verifying that the memory is 64 bytes long, that the first word is 0xff and the second word is 0.
You should also add two cases where we have:
- no offset
- 32-bytes offset
Corrected "succeed" into "succeeded". |
crates/evm/src/tests/test_instructions/test_memory_operations.cairo
Outdated
Show resolved
Hide resolved
crates/evm/src/tests/test_instructions/test_memory_operations.cairo
Outdated
Show resolved
Hide resolved
crates/evm/src/tests/test_instructions/test_memory_operations.cairo
Outdated
Show resolved
Hide resolved
crates/evm/src/tests/test_instructions/test_memory_operations.cairo
Outdated
Show resolved
Hide resolved
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.
thx, there are too much test for this! in terms of unit testing, when writing tests for exec_{}
we mainly need to test that we popped enough arguments, and that we pass them correctly to the underlying function implementing the logic (if the logic is in another funcion, as it is the case here).
crates/evm/src/tests/test_instructions/test_memory_operations.cairo
Outdated
Show resolved
Hide resolved
crates/evm/src/tests/test_instructions/test_memory_operations.cairo
Outdated
Show resolved
Hide resolved
crates/evm/src/tests/test_instructions/test_memory_operations.cairo
Outdated
Show resolved
Hide resolved
crates/evm/src/tests/test_instructions/test_memory_operations.cairo
Outdated
Show resolved
Hide resolved
crates/evm/src/tests/test_instructions/test_memory_operations.cairo
Outdated
Show resolved
Hide resolved
crates/evm/src/tests/test_instructions/test_memory_operations.cairo
Outdated
Show resolved
Hide resolved
Removed many unnecessary tests. |
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.
lgtm
Pull Request type
Please check the type of change your PR introduces:
What is the current behavior?
Resolves: #243 and #289
What is the new behavior?
Does this introduce a breaking change?