diff --git a/src/node_data.rs b/src/node_data.rs index 59591e5..fd01c3a 100644 --- a/src/node_data.rs +++ b/src/node_data.rs @@ -153,4 +153,9 @@ impl NodeData { buf[0..pos].to_vec() } + + pub fn from_bytes(consensus_branch_id: u32, buf: &[u8]) -> std::io::Result { + let mut cursor = std::io::Cursor::new(buf); + Self::read(consensus_branch_id, &mut cursor) + } } \ No newline at end of file