Checksum address uniffi#1115
Conversation
Wraps gem_evm::ethereum_address_checksum, returning the input unchanged for non-EVM chains and on parse errors. Used by iOS/Android clients to normalize EVM recipient addresses to EIP-55 format at input boundaries (paste, QR scan, name resolution).
…ksum-address-uniffi
There was a problem hiding this comment.
Code Review
This pull request introduces a new checksum_address function in gemstone/src/address.rs to provide EIP-55 checksumming for Ethereum-based chains, along with corresponding unit tests. Feedback suggests including ChainType::HyperCore in the checksum logic to maintain consistency with existing address validation patterns for EVM-compatible chains.
| match chain.chain_type() { | ||
| ChainType::Ethereum => ethereum_address_checksum(address).unwrap_or_else(|_| address.to_string()), | ||
| _ => address.to_string(), | ||
| } |
There was a problem hiding this comment.
The checksum_address function should include ChainType::HyperCore in the match arm. Since HyperCore is treated as an EVM-compatible chain in validate_address (line 34), it should also support EIP-55 checksumming to maintain consistency across the address utility functions.
| match chain.chain_type() { | |
| ChainType::Ethereum => ethereum_address_checksum(address).unwrap_or_else(|_| address.to_string()), | |
| _ => address.to_string(), | |
| } | |
| match chain.chain_type() { | |
| ChainType::Ethereum | ChainType::HyperCore => ethereum_address_checksum(address).unwrap_or_else(|_| address.to_string()), | |
| _ => address.to_string(), | |
| } |
|
We have |
…ksum-address-uniffi
EthereumAddress::encode() already returns EIP-55 form via AddressTrait, so the constructor now stores the normalized form for EVM chains. Drops the separate checksum_address uniffi function — callers can use GemChainAddress(address, chain).address() to get the normalized result.
No description provided.