mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
remove: Remove unused code
This commit is contained in:
@ -188,22 +188,6 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn collect_block(height: u64) -> Option<BlockAndReceipts> {
|
|
||||||
let ingest_dir = "/home/user/personal/evm-blocks";
|
|
||||||
let f = ((height - 1) / 1_000_000) * 1_000_000;
|
|
||||||
let s = ((height - 1) / 1_000) * 1_000;
|
|
||||||
let path = format!("{ingest_dir}/{f}/{s}/{height}.rmp.lz4");
|
|
||||||
if std::path::Path::new(&path).exists() {
|
|
||||||
let file = std::fs::File::open(path).unwrap();
|
|
||||||
let file = std::io::BufReader::new(file);
|
|
||||||
let mut decoder = lz4_flex::frame::FrameDecoder::new(file);
|
|
||||||
let blocks: Vec<BlockAndReceipts> = rmp_serde::from_read(&mut decoder).unwrap();
|
|
||||||
Some(blocks[0].clone())
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::chainspec::hl::hl_mainnet;
|
use crate::chainspec::hl::hl_mainnet;
|
||||||
|
|||||||
Reference in New Issue
Block a user