parent
cf0fd043d4
commit
cf4840c74a
|
@ -1,5 +1,13 @@
|
||||||
|
//! zebra-checkpoints arguments
|
||||||
|
//!
|
||||||
|
//! For usage please refer to the program help: `zebra-checkpoints --help`
|
||||||
|
|
||||||
|
#![deny(missing_docs)]
|
||||||
|
#![allow(clippy::try_err)]
|
||||||
|
|
||||||
use structopt::StructOpt;
|
use structopt::StructOpt;
|
||||||
|
|
||||||
|
/// zebra-checkpoints arguments
|
||||||
#[derive(Debug, StructOpt)]
|
#[derive(Debug, StructOpt)]
|
||||||
pub struct Args {
|
pub struct Args {
|
||||||
/// Path to zcash-cli command
|
/// Path to zcash-cli command
|
||||||
|
|
|
@ -8,7 +8,9 @@
|
||||||
//! zebra-consensus accepts an ordered list of checkpoints, starting with the
|
//! zebra-consensus accepts an ordered list of checkpoints, starting with the
|
||||||
//! genesis block. Checkpoint heights can be chosen arbitrarily.
|
//! genesis block. Checkpoint heights can be chosen arbitrarily.
|
||||||
|
|
||||||
|
#![deny(missing_docs)]
|
||||||
#![allow(clippy::try_err)]
|
#![allow(clippy::try_err)]
|
||||||
|
|
||||||
use color_eyre::eyre::Result;
|
use color_eyre::eyre::Result;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use std::process::Stdio;
|
use std::process::Stdio;
|
||||||
|
@ -30,7 +32,14 @@ const MAX_CHECKPOINT_BYTE_COUNT: u64 = 256 * 1024 * 1024;
|
||||||
/// zcashd reorg limit.
|
/// zcashd reorg limit.
|
||||||
const BLOCK_REORG_LIMIT: BlockHeight = BlockHeight(100);
|
const BLOCK_REORG_LIMIT: BlockHeight = BlockHeight(100);
|
||||||
|
|
||||||
// Passthrough arguments if needed
|
/// Initialise tracing using its defaults.
|
||||||
|
fn init_tracing() {
|
||||||
|
tracing_subscriber::Registry::default()
|
||||||
|
.with(tracing_error::ErrorLayer::default())
|
||||||
|
.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Add passthrough arguments to `cmd`, if present in `args`.
|
||||||
fn passthrough(mut cmd: std::process::Command, args: &args::Args) -> std::process::Command {
|
fn passthrough(mut cmd: std::process::Command, args: &args::Args) -> std::process::Command {
|
||||||
if !args.zcli_args.is_empty() {
|
if !args.zcli_args.is_empty() {
|
||||||
cmd.args(&args.zcli_args);
|
cmd.args(&args.zcli_args);
|
||||||
|
@ -119,9 +128,3 @@ fn main() -> Result<()> {
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn init_tracing() {
|
|
||||||
tracing_subscriber::Registry::default()
|
|
||||||
.with(tracing_error::ErrorLayer::default())
|
|
||||||
.init();
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
//! A Zebra utilities crate.
|
||||||
|
|
||||||
|
// TODO: split this crate up into crates with meaningful names.
|
||||||
|
|
||||||
|
#![deny(missing_docs)]
|
||||||
|
#![allow(clippy::try_err)]
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Reference in New Issue