Skip to content

Commit

Permalink
use runtime env::var to avoid compiling time error. (risc0#65)
Browse files Browse the repository at this point in the history
* use runtime env::var
* using expect instead of unwrap
  • Loading branch information
smtmfft committed Mar 22, 2024
1 parent a0a7234 commit 195b560
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions raiko-host/src/prover/proof/risc0/snarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ pub async fn verify_groth16_snark(
image_id: Digest,
snark_receipt: SnarkReceipt,
) -> anyhow::Result<()> {
let verifier_rpc_url = env!("GROTH16_VERIFIER_RPC_URL");
let verifier_rpc_url =
std::env::var("GROTH16_VERIFIER_RPC_URL").expect("env GROTH16_VERIFIER_RPC_URL");
let groth16_verifier_addr = {
let addr = env!("GROTH16_VERIFIER_ADDRESS");
H160::from_str(addr).unwrap()
let addr = std::env::var("GROTH16_VERIFIER_ADDRESS").expect("env GROTH16_VERIFIER_RPC_URL");
H160::from_str(&addr).unwrap()
};

let http_client = Arc::new(Provider::<RetryClient<Http>>::new_client(
Expand Down

0 comments on commit 195b560

Please sign in to comment.