diff --git a/src/app_ui/sign.rs b/src/app_ui/sign.rs index 09bfa1c..e38a503 100644 --- a/src/app_ui/sign.rs +++ b/src/app_ui/sign.rs @@ -41,7 +41,7 @@ use alloc::format; /// /// * `tx` - Transaction to be displayed for validation pub fn ui_display_tx(tx: &Transaction) -> Result { - let value_str = tx.value.to_cfx_str().ok_or(AppSW::TxDisplayFail)?; + let value_str = tx.value.cfx_str().ok_or(AppSW::TxDisplayFail)?; let network = Network::from_network_id(tx.chain_id); let to_str = cfx_addr_encode(&*tx.to, network).map_err(|_e| AppSW::AddrDisplayFail)?; let data_str = format!("0x{}", hex::encode(tx.data.clone()).to_uppercase()); diff --git a/src/types/primitives.rs b/src/types/primitives.rs index faaa7c4..b2d8117 100644 --- a/src/types/primitives.rs +++ b/src/types/primitives.rs @@ -12,7 +12,7 @@ construct_uint! { } impl U256 { - pub fn to_cfx_str(&self) -> Option { + pub fn cfx_str(&self) -> Option { let wei_str = self.to_string(); let wei = BigDecimal::from_str(&wei_str).ok()?; let eth_conversion = BigDecimal::from_i64(10_i64.pow(18))?;