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

transaction test failure #1087

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

transaction test failure #1087

wants to merge 1 commit into from

Conversation

winsvega
Copy link
Contributor

@winsvega winsvega commented Jan 16, 2025

🗒️ Description

transaction is failing with signature undefined
Debug shows that such tx unable to provide it's hash value.

also we wold need mock transaction class that will override it's standard behavior.
like allowing fields to be of incorrect size to be able to produce invalid rlp's.
overwrite signature bytes and so on.

🔗 Related Issues

✅ 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.

@winsvega winsvega marked this pull request as draft January 16, 2025 10:48
Copy link
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

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

Some comments but looks really good overall, I think this is a good idea 👍

gas_limit=100_000,
to=bytes.fromhex("0011"),
value=0,
error=TransactionException.TYPE_3_TX_MAX_BLOB_GAS_ALLOWANCE_EXCEEDED,
Copy link
Member

Choose a reason for hiding this comment

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

I think we should create a new exception that is more appropriate for this specific kind of failure.

class TestTransaction(Transaction):
"""Test version of the Transaction class where 'to' accepts Bytes."""

to: Optional[Union[Bytes, Address, None]] = Field(Bytes(bytes.fromhex("00")))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
to: Optional[Union[Bytes, Address, None]] = Field(Bytes(bytes.fromhex("00")))
to: Bytes | Address | None = Field(Bytes(bytes.fromhex("00")))

I think this should work too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants