Skip to content

Commit

Permalink
mark unused trezor proto impl function as reserved for future
Browse files Browse the repository at this point in the history
  • Loading branch information
dimxy committed Feb 14, 2024
1 parent bfe7a29 commit 29b7835
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions mm2src/trezor/src/eth/eth_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,19 @@ macro_rules! trim_left {
}

impl<'a> TrezorSession<'a> {
pub async fn get_eth_address(&mut self, derivation_path: DerivationPath) -> TrezorResult<Option<String>> {
/// Unused for now. Added for future use like implementation of an rpc returning eth address
pub async fn get_eth_address<'b>(
&'b mut self,
derivation_path: DerivationPath,
) -> TrezorResult<TrezorResponse<'a, 'b, Option<String>>> {
let req = proto_ethereum::EthereumGetAddress {
address_n: derivation_path.iter().map(|child| child.0).collect(),
show_display: None,
encoded_network: None,
chunkify: None,
};
let result_handler = ResultHandler::<proto_ethereum::EthereumAddress>::new(Ok);
let result = self.call(req, result_handler).await?.ack_all().await?;
Ok(result.address)
let result_handler = ResultHandler::new(|m: proto_ethereum::EthereumAddress| Ok(m.address));
self.call(req, result_handler).await
}

pub async fn get_eth_public_key<'b>(
Expand Down Expand Up @@ -148,7 +151,7 @@ fn to_sign_eth_message(
unsigned_tx.value.to_big_endian(&mut value);

let addr_hex = if let Action::Call(addr) = unsigned_tx.action {
Some(format!("{:X}", addr))
Some(format!("{:X}", addr)) // Trezor works okay with both '0x' prefixed and non-prefixed addresses in hex
} else {
None
};
Expand Down

0 comments on commit 29b7835

Please sign in to comment.