Skip to content

Conversation

@alisinabh
Copy link
Member

Fixes parsing of address and displaying it using human_arg/2 function in Utils.

@alisinabh alisinabh requested a review from Copilot October 24, 2025 11:50
@alisinabh alisinabh self-assigned this Oct 24, 2025
@alisinabh alisinabh added the bug Something isn't working label Oct 24, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes address parsing and display by improving the human_arg/2 function to properly handle binary addresses and enforce EIP-55 checksum formatting. The key issue was that binary addresses starting with bytes 0x30 and 0x78 (representing the string "0x") were incorrectly parsed as hex strings.

Key Changes:

  • Updated human_arg/2 to use pattern matching for exact binary size validation and apply checksumming to all addresses
  • Modified prepare_arg/2 and to_checksum_address/2 to use stricter pattern matching for hex address strings
  • Updated all test fixtures to use checksummed addresses for consistency

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/ethers/utils.ex Core fix: improved binary pattern matching for addresses and added checksumming logic to human_arg/2
test/ethers/utils_test.exs Added regression tests for binary address handling and checksumming behavior
test/ethers/types_contract_test.exs Updated address fixture to use checksummed format
test/ethers/registry_contract_test.exs Updated address fixture to use checksummed format
test/ethers/owner_contract_test.exs Updated address fixture to use checksummed format
test/ethers/event_mixed_index_contract_test.exs Updated address fixtures in test assertions to match new checksummed output
CHANGELOG.md Documented breaking change and bug fix for address handling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@alisinabh alisinabh merged commit 033ab32 into main Oct 24, 2025
5 checks passed
@alisinabh alisinabh deleted the fix-human-arg branch October 24, 2025 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants