mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-29 00:59:58 -07:00
Make Parser::new the only entrypoint
This commit is contained in:
@@ -5,7 +5,7 @@ use std::{
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
use crate::{BlkIndexToBlkPath, Height, blk_recap::BlkRecap};
|
||||
use crate::{blk_recap::BlkRecap, BlkIndexToBlkPath, Height};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct BlkIndexToBlkRecap {
|
||||
|
||||
@@ -43,18 +43,13 @@ pub struct Parser {
|
||||
}
|
||||
|
||||
impl Parser {
|
||||
pub fn new(blocks_dir: PathBuf, rpc: &'static bitcoincore_rpc::Client) -> Self {
|
||||
// For backward compatibility, use blocks_dir as outputs_dir
|
||||
pub fn new(blocks_dir: PathBuf, brk_dir: PathBuf, rpc: &'static bitcoincore_rpc::Client) -> Self {
|
||||
Self {
|
||||
outputs_dir: blocks_dir.clone(),
|
||||
blocks_dir,
|
||||
blocks_dir,
|
||||
outputs_dir: brk_dir,
|
||||
rpc
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_with_outputs_dir(blocks_dir: PathBuf, outputs_dir: PathBuf, rpc: &'static bitcoincore_rpc::Client) -> Self {
|
||||
Self { blocks_dir, outputs_dir, rpc }
|
||||
}
|
||||
|
||||
pub fn get(&self, height: Height) -> Block {
|
||||
self.parse(Some(height), Some(height))
|
||||
|
||||
Reference in New Issue
Block a user