Skip to content

Commit

Permalink
cleanup dead Node code
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah Gundotra committed Jun 1, 2022
1 parent 1975f43 commit cc8bca2
Showing 1 changed file with 0 additions and 54 deletions.
54 changes: 0 additions & 54 deletions lib/concurrent-merkle-tree/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,58 +68,4 @@ impl<const MAX_DEPTH: usize> Default for Path<MAX_DEPTH> {
}

pub type Node = [u8; 32];

// #[derive(Debug, Copy, Clone, Default, PartialEq)]
// pub struct Node {
// pub inner: [u8; 32],
// }

// impl Node {
// pub fn new(inner: [u8; 32]) -> Self {
// Self { inner }
// }
// }

// impl TryFrom<Vec<u8>> for Node {
// type Error = CMTError;

// fn try_from(bytes: Vec<u8>) -> Result<Self, CMTError> {
// if bytes.len() != 32 {
// Err(CMTError::InvalidNodeByteLength)
// } else {
// let mut node: [u8; 32] = [0; 32];
// node.copy_from_slice(&bytes);
// Ok(Self { inner: node })
// }
// }
// }

// impl Deref for Node {
// type Target = [u8; 32];
// fn deref(&self) -> &Self::Target {
// &self.inner
// }
// }

// impl DerefMut for Node {
// fn deref_mut(&mut self) -> &mut Self::Target {
// &mut self.inner
// }
// }

// impl AsRef<[u8; 32]> for Node {
// fn as_ref(&self) -> &[u8; 32] {
// &self.inner
// }
// }

// impl From<[u8; 32]> for Node {
// fn from(inner: [u8; 32]) -> Self {
// Self { inner }
// }
// }

// pub const EMPTY: Node = Node {
// inner: [0 as u8; 32],
// };
pub const EMPTY: Node = [0 as u8; 32];

0 comments on commit cc8bca2

Please sign in to comment.