block_template_to_proposal/
args.rs

1//! block-template-to-proposal arguments
2//!
3//! For usage please refer to the program help: `block-template-to-proposal --help`
4
5use structopt::StructOpt;
6
7use zebra_rpc::methods::types::get_block_template::TimeSource;
8
9/// block-template-to-proposal arguments
10#[derive(Clone, Debug, Eq, PartialEq, StructOpt)]
11pub struct Args {
12    /// The source of the time in the block proposal header.
13    /// Format: "curtime", "mintime", "maxtime", ["clamped"]u32, "raw"u32
14    /// Clamped times are clamped to the template's [`mintime`, `maxtime`].
15    /// Raw times are used unmodified: this can produce invalid proposals.
16    #[structopt(default_value = "CurTime", short, long)]
17    pub time_source: TimeSource,
18
19    /// The JSON block template.
20    /// If this argument is not supplied, the template is read from standard input.
21    ///
22    /// The template and proposal structures are printed to stderr.
23    #[structopt(last = true)]
24    pub template: Option<String>,
25}