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

fix(cli): RJUMPV in evm_bytes_to_python #683

Merged
merged 1 commit into from
Jul 16, 2024
Merged

Conversation

marioevz
Copy link
Member

🗒️ Description

Small fix to evm_bytes_to_python to properly parse RJUMPV data portion.

We could make this a bit cleaner in the future by providing a function in class Opcode that could be overridden by the opcodes to provide custom logic on data-portion parsing.

Also the output now contains the data portion as an integer instead of an hex-formatted string:

"0xe30001"

before:

Op.CALLF("0x0001")

now:

Op.CALLF[0x1]

🔗 Related Issues

None

✅ 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.
  • Tests: All converted JSON/YML tests from ethereum/tests have been added to converted-ethereum-tests.txt.
  • Tests: A PR with removal of converted JSON/YML tests from ethereum/tests have been opened.
  • Tests: Included the type and version of evm t8n tool used to locally execute test cases: e.g., ref with commit hash or geth 1.13.1-stable-3f40e65.
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.

@marioevz marioevz added the type:chore Type: Chore label Jul 11, 2024
@marioevz marioevz requested a review from winsvega July 11, 2024 19:08
Copy link
Collaborator

@winsvega winsvega left a comment

Choose a reason for hiding this comment

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

Should add more unittests for the opcodes with leading zeros and overflows.

src/cli/tests/test_evm_bytes_to_python.py Show resolved Hide resolved
@marioevz
Copy link
Member Author

Should add more unittests for the opcodes with leading zeros and overflows.

I agree but it's kind of out-of-scope for this PR since that would be a test for ethereum_test_tools.vm, which this PR does not currently touch.

@marioevz marioevz merged commit 1cc59e1 into main Jul 16, 2024
7 checks passed
@marioevz marioevz deleted the fix-evm-bytes-to-python branch July 16, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:chore Type: Chore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants