diff --git a/sdk/src/args.rs b/sdk/src/args.rs index 2e6b346..c552349 100644 --- a/sdk/src/args.rs +++ b/sdk/src/args.rs @@ -1,5 +1,5 @@ use crate::{PostprocessingLevel, SxTClient}; -use clap::{Parser, ValueEnum}; +use clap::Parser; /// Struct to define and parse command-line arguments for Proof of SQL Client. /// @@ -88,30 +88,7 @@ pub struct SdkArgs { value_enum, help = "Level of postprocessing allowed, default is `Cheap`" )] - pub postprocessing_level: PostprocessingLevelArg, -} - -/// Level of postprocessing allowed. -/// -/// We have it as a separate enum from `PostprocessingLevel` so that the core of the lib won't depend on `clap`. -#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)] -pub enum PostprocessingLevelArg { - /// No postprocessing allowed - None, - /// Only cheap postprocessing allowed - Cheap, - /// All postprocessing allowed - All, -} - -impl From for PostprocessingLevel { - fn from(arg: PostprocessingLevelArg) -> Self { - match arg { - PostprocessingLevelArg::None => PostprocessingLevel::None, - PostprocessingLevelArg::Cheap => PostprocessingLevel::Cheap, - PostprocessingLevelArg::All => PostprocessingLevel::All, - } - } + pub postprocessing_level: PostprocessingLevel, } impl From<&SdkArgs> for SxTClient { diff --git a/sdk/src/client.rs b/sdk/src/client.rs index 822023f..70bb32c 100644 --- a/sdk/src/client.rs +++ b/sdk/src/client.rs @@ -1,4 +1,5 @@ use crate::{get_access_token, query_commitments}; +use clap::ValueEnum; use proof_of_sql::{ base::database::{OwnedTable, TableRef}, proof_primitive::dory::{ @@ -21,7 +22,7 @@ mod prover { /// Level of postprocessing allowed /// /// Some postprocessing steps are expensive so we allow the user to control the level of postprocessing. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)] pub enum PostprocessingLevel { /// No postprocessing allowed None, diff --git a/sdk/src/lib.rs b/sdk/src/lib.rs index f367b0f..ffa2e7a 100644 --- a/sdk/src/lib.rs +++ b/sdk/src/lib.rs @@ -1,5 +1,5 @@ mod args; -pub use args::{PostprocessingLevelArg, SdkArgs}; +pub use args::SdkArgs; mod auth; pub use auth::get_access_token; mod client;