diff --git a/Cargo.toml b/Cargo.toml index b84014acc..8821be1f6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -203,6 +203,7 @@ det-prove = [] icicle = ["halo2_proofs/icicle_gpu"] empty-cmd = [] no-banner = [] +no-update = [] metal = ["dep:metal", "dep:objc"] # icicle patch to 0.1.0 if feature icicle is enabled diff --git a/src/commands.rs b/src/commands.rs index 6b27a2f6e..21659dc3e 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -868,6 +868,7 @@ pub enum Commands { #[arg(long, value_hint = clap::ValueHint::Other)] addr_vk: Option, }, + #[cfg(not(feature = "no-update"))] /// Updates ezkl binary to version specified (or latest if not specified) Update { /// The version to update to diff --git a/src/eth.rs b/src/eth.rs index e0dd5a2af..ce81e010e 100644 --- a/src/eth.rs +++ b/src/eth.rs @@ -844,7 +844,7 @@ pub async fn read_on_chain_inputs, Ethereum>> let contract_address_bytes = hex::decode(&on_chain_data.address)?; let contract_address = H160::from_slice(&contract_address_bytes); for (call_data, decimal) in &on_chain_data.call_data { - let call_data_bytes = hex::decode(&call_data)?; + let call_data_bytes = hex::decode(call_data)?; let input: TransactionInput = call_data_bytes.into(); let tx = TransactionRequest::default() diff --git a/src/execute.rs b/src/execute.rs index 5e55a723b..d6b5bcb6b 100644 --- a/src/execute.rs +++ b/src/execute.rs @@ -506,10 +506,12 @@ pub async fn run(command: Commands) -> Result { ) .await } + #[cfg(not(feature = "no-update"))] Commands::Update { version } => update_ezkl_binary(&version).map(|e| e.to_string()), } } +#[cfg(not(feature = "no-update"))] /// Assert that the version is valid fn assert_version_is_valid(version: &str) -> Result<(), EZKLError> { let err_string = "Invalid version string. Must be in the format v0.0.0"; @@ -527,8 +529,10 @@ fn assert_version_is_valid(version: &str) -> Result<(), EZKLError> { Ok(()) } +#[cfg(not(feature = "no-update"))] const INSTALL_BYTES: &[u8] = include_bytes!("../install_ezkl_cli.sh"); +#[cfg(not(feature = "no-update"))] fn update_ezkl_binary(version: &Option) -> Result { // run the install script with the version let install_script = std::str::from_utf8(INSTALL_BYTES)?;