Skip to content

Commit

Permalink
chore: replace if-cfg with #[cfg(..)] (#416)
Browse files Browse the repository at this point in the history
  • Loading branch information
keroro520 authored Nov 22, 2024
1 parent 6e98484 commit e273117
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
14 changes: 6 additions & 8 deletions core/src/provider/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use raiko_lib::clear_line;
use reqwest_alloy::Client;
use reth_primitives::revm_primitives::{AccountInfo, Bytecode};
use std::collections::HashMap;
use tracing::trace;

use crate::{
interfaces::{RaikoError, RaikoResult},
Expand Down Expand Up @@ -230,13 +229,12 @@ impl BlockDataProvider for RpcBlockDataProvider {

let batch_limit = 1000;
while !accounts.is_empty() {
if cfg!(debug_assertions) {
raiko_lib::inplace_print(&format!(
"fetching storage proof {idx}/{num_storage_proofs}..."
));
} else {
trace!("Fetching storage proof {idx}/{num_storage_proofs}...");
}
#[cfg(debug_assertions)]
raiko_lib::inplace_print(&format!(
"fetching storage proof {idx}/{num_storage_proofs}..."
));
#[cfg(not(debug_assertions))]
tracing::trace!("Fetching storage proof {idx}/{num_storage_proofs}...");

// Create a batch for all storage proofs
let mut batch = self.client.new_batch();
Expand Down
10 changes: 4 additions & 6 deletions provers/sgx/prover/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,10 @@ impl From<SgxResponse> for Proof {
}

pub const ELF_NAME: &str = "sgx-guest";
pub const CONFIG: &str = if cfg!(feature = "docker_build") {
"../provers/sgx/config"
} else {
"../../provers/sgx/config"
};

#[cfg(feature = "docker_build")]
pub const CONFIG: &str = "../provers/sgx/config";
#[cfg(not(feature = "docker_build"))]
pub const CONFIG: &str = "../../provers/sgx/config";
static GRAMINE_MANIFEST_TEMPLATE: Lazy<OnceCell<PathBuf>> = Lazy::new(OnceCell::new);
static PRIVATE_KEY: Lazy<OnceCell<PathBuf>> = Lazy::new(OnceCell::new);

Expand Down

0 comments on commit e273117

Please sign in to comment.