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

Add comprehensive transaction signing tests #3587

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

iradukun
Copy link

Current Date and Time (UTC - YYYY-MM-DD HH:MM:SS formatted): 2025-01-24 15:41:11
Current User's Login: iradukun

What was wrong?

The ethereum-tester provider was missing implementations for transaction signing test methods. Specifically, the following methods were marked as not_implemented:

  • test_eth_sign_transaction_legacy
  • test_eth_sign_transaction
  • test_eth_sign_transaction_hex_fees

Related to Issue #
This implementation addresses the not_implemented methods in the TestEthereumTesterEthModule class.

How was it fixed?

Added comprehensive test implementations for transaction signing methods:

  1. Added test_eth_sign_transaction_legacy:

    • Tests signing of pre-EIP-1559 transactions
    • Verifies signature components (r, s, v)
    • Ensures transaction can be properly serialized and sent
  2. Added test_eth_sign_transaction:

    • Implements EIP-1559 transaction signing tests
    • Verifies maxFeePerGas and maxPriorityFeePerGas handling
    • Confirms proper transaction type encoding
  3. Added test_eth_sign_transaction_hex_fees:

    • Tests hexadecimal fee value handling
    • Verifies correct conversion of hex values
    • Ensures compatibility with various input formats

The implementation follows project testing patterns and includes proper assertions for type checking and transaction validation.

Todo:

  • Clean up commit history
  • Add or update documentation related to these changes
  • Add entry to the release notes

Cute Animal Picture

A cute red panda sitting on a tree branch


Release Notes Entry:

# newsfragments/xxxx.feature.md
---
feature: |
  Added comprehensive test coverage for transaction signing methods in ethereum-tester provider:
  - Legacy transaction signing
  - EIP-1559 transaction signing
  - Hexadecimal fee value handling

This commit adds three new test methods for transaction signing:
- test_eth_sign_transaction_legacy: Tests legacy transaction signing
- test_eth_sign_transaction: Tests EIP-1559 transaction signing
- test_eth_sign_transaction_hex_fees: Tests hex fee value handling
…e transaction parameters for legacy and EIP1559 types. Expect MethodUnavailable for eth_tester implementations.
Add comprehensive test coverage for transaction signing methods in eth_tester,
verifying MethodUnavailable is raised as expected.
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.

1 participant