-
Notifications
You must be signed in to change notification settings - Fork 101
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
Refactor eth code: eliminate duplicate address to string conversion functions #2343
Comments
We shouldn't use
komodo-defi-framework/mm2src/coins/eth.rs Lines 6577 to 6587 in 39515a9
So they are not duplicate conversion functions. But it still worth making |
Okay, let's ensure we use display_eth_address only for returned results and make this consistently (not like use both addresses with and w/o checksum in results) BTW I can see the ethereum_types lib has implementation for 'Address' to string conversion. Let's use it maybe. |
can you provide code part or screenshot so I can find it. |
|
Updated according to the discussion:
In eth.rs we have two public address to string conversion functions: eth_addr_to_hex() and display_eth_address().
PR #2261 also adds a trait AddrToString for the same purpose.
Also, display_eth_address() provides address format with checksum, basically for user input verification.
The required changes:
format!("{:#02x}", token_contract_address)
and use the unified approach with a trait.The text was updated successfully, but these errors were encountered: