Skip to content

Commit

Permalink
chore: remove unused bytes_to_hex (#942)
Browse files Browse the repository at this point in the history
Co-authored-by: dwiekawki <dwiekawki@users.noreply.github.com>
  • Loading branch information
dwiekawki and dwiekawki authored Aug 5, 2024
1 parent afcbb56 commit 15d9982
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions engine-types/src/types/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{str, vec, String, Vec, U256};
use crate::{str, vec, Vec, U256};
use borsh::{BorshDeserialize, BorshSerialize};

pub mod address;
Expand Down Expand Up @@ -96,19 +96,6 @@ pub struct FtResolveTransferResult {
pub refund_amount: Balance,
}

const HEX_ALPHABET: &[u8; 16] = b"0123456789abcdef";

#[allow(dead_code)]
#[must_use]
pub fn bytes_to_hex(v: &[u8]) -> String {
let mut result = String::new();
for x in v {
result.push(char::from(HEX_ALPHABET[usize::from(x / 16)]));
result.push(char::from(HEX_ALPHABET[usize::from(x % 16)]));
}
result
}

#[derive(Default)]
pub struct Stack<T> {
stack: Vec<T>,
Expand Down Expand Up @@ -157,14 +144,6 @@ pub fn str_from_slice(inp: &[u8]) -> &str {
mod tests {
use super::*;

#[test]
fn test_hex() {
assert_eq!(
bytes_to_hex(&[0u8, 1u8, 255u8, 16u8]),
"0001ff10".to_string()
);
}

/// Build view of the stack. Intervals between None values are scopes.
fn view_stack(stack: &Stack<i32>) -> Vec<Option<i32>> {
let mut res = vec![];
Expand Down

0 comments on commit 15d9982

Please sign in to comment.