aboutsummaryrefslogtreecommitdiff
path: root/zkvms_host_io/src/lib.rs
blob: 29723db11e7e4e78feddc50d2ba68fea6bdf82bb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use clap::{Parser, ValueEnum};
use num_traits::NumCast;

#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
struct Cli {
    /// What the ZKVM is going to do
    run_type: RunType,
}

#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
pub enum RunType {
    Execute,
    Prove,
    Verify,
}

#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct RunWith<T> {
    pub run_type: RunType,
    pub input: T,
}

fn read_input() -> (Vec<Vec<bool>>, u32, Vec<Vec<u32>>) {
    include!(env!("INPUTS"))
}

pub fn read_args() -> RunWith<(Vec<Vec<bool>>, u32, Vec<Vec<u32>>)> {
    let cli = Cli::parse();

    RunWith {
        run_type: cli.run_type,
        input: read_input(),
    }
}