mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
34 lines
792 B
Rust
34 lines
792 B
Rust
//! Command for generating test vectors.
|
|
use clap::{Parser, Subcommand};
|
|
|
|
mod tables;
|
|
|
|
/// Generate test-vectors for different data types.
|
|
#[derive(Debug, Parser)]
|
|
pub struct Command {
|
|
#[clap(subcommand)]
|
|
command: Subcommands,
|
|
}
|
|
|
|
#[derive(Subcommand, Debug)]
|
|
/// `reth test-vectors` subcommands
|
|
pub enum Subcommands {
|
|
/// Generates test vectors for specified tables. If no table is specified, generate for all.
|
|
Tables {
|
|
/// List of table names. Case-sensitive.
|
|
names: Vec<String>,
|
|
},
|
|
}
|
|
|
|
impl Command {
|
|
/// Execute the command
|
|
pub async fn execute(self) -> eyre::Result<()> {
|
|
match self.command {
|
|
Subcommands::Tables { names } => {
|
|
tables::generate_vectors(names)?;
|
|
}
|
|
}
|
|
Ok(())
|
|
}
|
|
}
|