@@ -27,8 +27,8 @@ use crate::coin_balance::{EnableCoinBalanceError, EnabledCoinBalanceParams, HDAc
27
27
HDWalletBalance , HDWalletBalanceOps } ;
28
28
use crate :: eth:: eth_rpc:: ETH_RPC_REQUEST_TIMEOUT ;
29
29
use crate :: eth:: web3_transport:: websocket_transport:: { WebsocketTransport , WebsocketTransportNode } ;
30
- use crate :: hd_wallet:: { HDAccountOps , HDCoinAddress , HDCoinWithdrawOps , HDConfirmAddress , HDPathAccountToAddressId ,
31
- HDWalletCoinOps , HDXPubExtractor } ;
30
+ use crate :: hd_wallet:: { DisplayAddress , HDAccountOps , HDCoinAddress , HDCoinWithdrawOps , HDConfirmAddress ,
31
+ HDPathAccountToAddressId , HDWalletCoinOps , HDXPubExtractor } ;
32
32
use crate :: lp_price:: get_base_price_in_rel;
33
33
use crate :: nft:: nft_errors:: ParseContractTypeError ;
34
34
use crate :: nft:: nft_structs:: { ContractType , ConvertChain , NftInfo , TransactionNftDetails , WithdrawErc1155 ,
@@ -1196,8 +1196,8 @@ pub async fn withdraw_erc721(ctx: MmArc, withdraw_type: WithdrawErc721) -> Withd
1196
1196
let my_address = eth_coin. derivation_method . single_addr_or_err ( ) . await ?;
1197
1197
if token_owner != my_address {
1198
1198
return MmError :: err ( WithdrawError :: MyAddressNotNftOwner {
1199
- my_address : eth_addr_to_hex ( & my_address) ,
1200
- token_owner : eth_addr_to_hex ( & token_owner) ,
1199
+ my_address : my_address. display_address ( ) ,
1200
+ token_owner : token_owner. display_address ( ) ,
1201
1201
} ) ;
1202
1202
}
1203
1203
@@ -2287,7 +2287,7 @@ impl MarketCoinOps for EthCoin {
2287
2287
2288
2288
fn my_address ( & self ) -> MmResult < String , MyAddressError > {
2289
2289
match self . derivation_method ( ) {
2290
- DerivationMethod :: SingleAddress ( my_address) => Ok ( display_eth_address ( my_address) ) ,
2290
+ DerivationMethod :: SingleAddress ( my_address) => Ok ( my_address. display_address ( ) ) ,
2291
2291
DerivationMethod :: HDWallet ( _) => MmError :: err ( MyAddressError :: UnexpectedDerivationMethod (
2292
2292
"'my_address' is deprecated for HD wallets" . to_string ( ) ,
2293
2293
) ) ,
@@ -3270,8 +3270,8 @@ impl EthCoin {
3270
3270
spent_by_me,
3271
3271
received_by_me,
3272
3272
total_amount,
3273
- to : vec ! [ display_eth_address ( & call_data. to) ] ,
3274
- from : vec ! [ display_eth_address ( & call_data. from) ] ,
3273
+ to : vec ! [ call_data. to. display_address ( ) ] ,
3274
+ from : vec ! [ call_data. from. display_address ( ) ] ,
3275
3275
coin : self . ticker . clone ( ) ,
3276
3276
fee_details : fee_details. map ( |d| d. into ( ) ) ,
3277
3277
block_height : trace. block_number ,
@@ -3650,8 +3650,8 @@ impl EthCoin {
3650
3650
spent_by_me,
3651
3651
received_by_me,
3652
3652
total_amount,
3653
- to : vec ! [ display_eth_address ( & to_addr) ] ,
3654
- from : vec ! [ display_eth_address ( & from_addr) ] ,
3653
+ to : vec ! [ to_addr. display_address ( ) ] ,
3654
+ from : vec ! [ from_addr. display_address ( ) ] ,
3655
3655
coin : self . ticker . clone ( ) ,
3656
3656
fee_details : fee_details. map ( |d| d. into ( ) ) ,
3657
3657
block_height : block_number. as_u64 ( ) ,
@@ -6550,16 +6550,12 @@ pub fn checksum_address(addr: &str) -> String {
6550
6550
6551
6551
/// `eth_addr_to_hex` converts Address to hex format.
6552
6552
/// Note: the result will be in lowercase.
6553
- pub fn eth_addr_to_hex ( address : & Address ) -> String { format ! ( "{:#02x }" , address) }
6553
+ fn eth_addr_to_hex ( address : & Address ) -> String { format ! ( "{:#x }" , address) }
6554
6554
6555
6555
/// Checks that input is valid mixed-case checksum form address
6556
6556
/// The input must be 0x prefixed hex string
6557
6557
fn is_valid_checksum_addr ( addr : & str ) -> bool { addr == checksum_address ( addr) }
6558
6558
6559
- /// `display_eth_address` converts Address to mixed-case checksum form.
6560
- #[ inline]
6561
- pub fn display_eth_address ( addr : & Address ) -> String { checksum_address ( & eth_addr_to_hex ( addr) ) }
6562
-
6563
6559
fn increase_by_percent_one_gwei ( num : U256 , percent : u64 ) -> U256 {
6564
6560
let one_gwei = U256 :: from ( 10u64 . pow ( 9 ) ) ;
6565
6561
let percent = ( num / U256 :: from ( 100 ) ) * U256 :: from ( percent) ;
@@ -6645,7 +6641,7 @@ pub async fn get_eth_address(
6645
6641
6646
6642
Ok ( MyWalletAddress {
6647
6643
coin : ticker. to_owned ( ) ,
6648
- wallet_address : display_eth_address ( & my_address) ,
6644
+ wallet_address : my_address. display_address ( ) ,
6649
6645
} )
6650
6646
}
6651
6647
0 commit comments