Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hansieodendaal committed Aug 12, 2024
1 parent d7f6d78 commit 4e6a0d0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions applications/minotari_ledger_wallet/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ license = "BSD-3-Clause"
edition = "2021"

[dependencies]
tari_utilities = { version = "0.7", default-features = false }
bs58 = { version = "0.5.1", default-features = false, features = ["alloc"] }
11 changes: 3 additions & 8 deletions applications/minotari_ledger_wallet/common/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use alloc::{
vec::Vec,
};

use tari_utilities::hex::from_hex;

pub const PUSH_PUBKEY_IDENTIFIER: &str = "217e";

/// Convert a u16 to a string
Expand Down Expand Up @@ -49,14 +51,7 @@ pub fn hex_to_bytes_serialized(identifier: &str, data: &str) -> Result<Vec<u8>,
}

let hex = identifier.to_owned() + data;
let hex = hex.as_str();

let mut serialized = Vec::new();
for i in 0..hex.len() / 2 {
let byte = u8::from_str_radix(&hex[i * 2..i * 2 + 2], 16).map_err(|_e| "Invalid hex string".to_string())?;
serialized.push(byte);
}
Ok(serialized)
from_hex(hex.as_str()).map_err(|e| e.to_string())
}

/// The Tari dual address size
Expand Down

0 comments on commit 4e6a0d0

Please sign in to comment.