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 address format to conform to EIP-55 #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Setland34
Copy link

@Setland34 Setland34 commented Feb 15, 2025

Fixes #20

Update address format to conform to EIP-55.

  • utils.py: Add to_checksum_address function to convert an address to EIP-55 format and is_checksum_address function to validate an address against EIP-55 format.
  • manager.py: Import to_checksum_address from utils.py. Update genaddr function to return address in EIP-55 format using to_checksum_address.
  • blocks.py: Import is_checksum_address from utils.py. Update address validation logic in pay_fee, get_nonce, get_balance, set_balance, get_contract, and update_contract methods to use is_checksum_address.
  • transactions.py: Import is_checksum_address from utils.py. Update parse method to validate self.to and self.sender addresses using is_checksum_address.
  • tests/test_utils.py: Add tests for to_checksum_address and is_checksum_address functions.
  • tests/test_manager.py: Update tests for genaddr function to check for EIP-55 formatted addresses.
  • tests/test_blocks.py: Update tests for pay_fee, get_nonce, get_balance, set_balance, get_contract, and update_contract methods to check for EIP-55 formatted addresses.
  • tests/test_transactions.py: Update tests for parse method to check for EIP-55 formatted addresses.

For more details, open the Copilot Workspace session.

Fixes vbuterin#20

Update address format to conform to EIP-55.

* **utils.py**: Add `to_checksum_address` function to convert an address to EIP-55 format and `is_checksum_address` function to validate an address against EIP-55 format.
* **manager.py**: Import `to_checksum_address` from `utils.py`. Update `genaddr` function to return address in EIP-55 format using `to_checksum_address`.
* **blocks.py**: Import `is_checksum_address` from `utils.py`. Update address validation logic in `pay_fee`, `get_nonce`, `get_balance`, `set_balance`, `get_contract`, and `update_contract` methods to use `is_checksum_address`.
* **transactions.py**: Import `is_checksum_address` from `utils.py`. Update `parse` method to validate `self.to` and `self.sender` addresses using `is_checksum_address`.
* **tests/test_utils.py**: Add tests for `to_checksum_address` and `is_checksum_address` functions.
* **tests/test_manager.py**: Update tests for `genaddr` function to check for EIP-55 formatted addresses.
* **tests/test_blocks.py**: Update tests for `pay_fee`, `get_nonce`, `get_balance`, `set_balance`, `get_contract`, and `update_contract` methods to check for EIP-55 formatted addresses.
* **tests/test_transactions.py**: Update tests for `parse` method to check for EIP-55 formatted addresses.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/vbuterin/pyethereum/issues/20?shareId=XXXX-XXXX-XXXX-XXXX).
Copy link
Author

@Setland34 Setland34 left a comment

Choose a reason for hiding this comment

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

PR/check #21

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.

Address does not conform to EIP-55
1 participant