from_bytes for NodeData

This commit is contained in:
NikVolf
2019-09-07 18:15:18 +03:00
parent 6d9deefb93
commit a9d2ce7150

View File

@@ -153,4 +153,9 @@ impl NodeData {
buf[0..pos].to_vec()
}
pub fn from_bytes(consensus_branch_id: u32, buf: &[u8]) -> std::io::Result<Self> {
let mut cursor = std::io::Cursor::new(buf);
Self::read(consensus_branch_id, &mut cursor)
}
}