diff --git a/mm2src/coins/eth.rs b/mm2src/coins/eth.rs index 3aa00d7edb..fa10ce6317 100644 --- a/mm2src/coins/eth.rs +++ b/mm2src/coins/eth.rs @@ -6980,7 +6980,7 @@ impl ParseCoinAssocTypes for EthCoin { } } - fn addr_to_string(&self, address: &Self::Address) -> String { eth_addr_to_hex(address) } + async fn my_addr_as_string(&self) -> String { eth_addr_to_hex(&self.my_addr().await) } fn parse_address(&self, address: &str) -> Result { // crate `Address::from_str` supports both address variants with and without `0x` prefix diff --git a/mm2src/coins/lp_coins.rs b/mm2src/coins/lp_coins.rs index 063e49cd34..53779e21d5 100644 --- a/mm2src/coins/lp_coins.rs +++ b/mm2src/coins/lp_coins.rs @@ -1550,13 +1550,13 @@ pub trait ParseCoinAssocTypes { async fn my_addr(&self) -> Self::Address; - /// Converts coin `Self::Address` type into a properly formatted string representation. + /// Should convert coin `Self::Address` type into a properly formatted string representation. /// /// Don't use `to_string` directly on `Self::Address` types in generic TPU code! /// It may produce abbreviated or non-standard formats (e.g. `ethereum_types::Address` will be like this `0x7cc9…3874`), /// which are not guaranteed to be parsable back into the original `Address` type. /// This function should ensure the resulting string is consistently formatted and fully reversible. - fn addr_to_string(&self, address: &Self::Address) -> String; + async fn my_addr_as_string(&self) -> String; fn parse_address(&self, address: &str) -> Result; diff --git a/mm2src/coins/test_coin.rs b/mm2src/coins/test_coin.rs index 04511216c4..af05276ff0 100644 --- a/mm2src/coins/test_coin.rs +++ b/mm2src/coins/test_coin.rs @@ -456,7 +456,7 @@ impl ParseCoinAssocTypes for TestCoin { async fn my_addr(&self) -> Self::Address { todo!() } - fn addr_to_string(&self, address: &Self::Address) -> String { unimplemented!() } + async fn my_addr_as_string(&self) -> String { unimplemented!() } fn parse_address(&self, address: &str) -> Result { todo!() } diff --git a/mm2src/coins/utxo.rs b/mm2src/coins/utxo.rs index f1c055f3fc..33f6f97298 100644 --- a/mm2src/coins/utxo.rs +++ b/mm2src/coins/utxo.rs @@ -1053,7 +1053,7 @@ impl ParseCoinAssocTypes for T { } } - fn addr_to_string(&self, address: &Self::Address) -> String { address.to_string() } + async fn my_addr_as_string(&self) -> String { self.my_addr().await.to_string() } fn parse_address(&self, address: &str) -> Result { self.address_from_str(address) diff --git a/mm2src/mm2_main/src/lp_swap/maker_swap_v2.rs b/mm2src/mm2_main/src/lp_swap/maker_swap_v2.rs index 18df8d1c14..72ccd092d0 100644 --- a/mm2src/mm2_main/src/lp_swap/maker_swap_v2.rs +++ b/mm2src/mm2_main/src/lp_swap/maker_swap_v2.rs @@ -914,7 +914,6 @@ impl, state_machine: &mut Self::StateMachine) -> StateResult { let unique_data = state_machine.unique_data(); - let taker_coin_address = state_machine.taker_coin.my_addr().await; let maker_negotiation_msg = MakerNegotiation { started_at: state_machine.started_at, @@ -924,7 +923,7 @@ impl