Skip to content

Commit

Permalink
feat : e2e tests config change
Browse files Browse the repository at this point in the history
  • Loading branch information
ocdbytes committed Aug 26, 2024
1 parent 0c89e58 commit 98a42d5
Show file tree
Hide file tree
Showing 11 changed files with 4,124 additions and 3,714 deletions.
3 changes: 2 additions & 1 deletion crates/prover-services/gps-fact-checker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sol!(
#[allow(missing_docs)]
#[sol(rpc)]
FactRegistry,
"tests/artifacts/FactRegistry2.json"
"tests/artifacts/FactRegistry.json"
);

pub struct FactChecker {
Expand All @@ -27,6 +27,7 @@ type ProviderT = RootProvider<TransportT>;

impl FactChecker {
pub fn new(rpc_node_url: Url, verifier_address: Address) -> Self {
log::info!(">>> rpc : {} | verifier address : {}", rpc_node_url.to_string(), verifier_address.to_string());
let provider = ProviderBuilder::new().on_http(rpc_node_url);
let fact_registry = FactRegistry::new(verifier_address, provider);
Self { fact_registry }
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion crates/prover-services/sharp-service/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl Default for SharpConfig {
Self {
service_url: get_env_var_or_panic("SHARP_URL").parse().unwrap(),
rpc_node_url: get_env_var_or_panic("ETHEREUM_RPC_URL").parse().unwrap(),
verifier_address: "0x07ec0D28e50322Eb0C159B9090ecF3aeA8346DFe".parse().unwrap(),
verifier_address: get_env_var_or_panic("MEMORY_PAGES_CONTRACT_ADDRESS").parse().unwrap(),
}
}
}
18 changes: 10 additions & 8 deletions crates/prover-services/sharp-service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ mod types;

use std::str::FromStr;

use alloy::primitives::{B256, I256};
use alloy::primitives::B256;
use async_trait::async_trait;
use gps_fact_checker::fact_info::get_fact_info;
use gps_fact_checker::FactChecker;
Expand All @@ -30,13 +30,12 @@ pub struct SharpProverService {
impl ProverClient for SharpProverService {
async fn submit_task(&self, task: Task) -> Result<TaskId, ProverClientError> {
match task {
Task::CairoPie(_cairo_pie) => {
// let fact_info = get_fact_info(&cairo_pie, None)?;
// let encoded_pie =
// snos::sharp::pie::encode_pie_mem(cairo_pie).map_err(ProverClientError::PieEncoding)?;
// let (_, job_key) = self.sharp_client.add_job(&encoded_pie).await?;
// Ok(combine_task_id(&job_key, &fact_info.fact))
Ok(combine_task_id(&Uuid::new_v4(), &B256::from(I256::ZERO)))
Task::CairoPie(cairo_pie) => {
let fact_info = get_fact_info(&cairo_pie, None)?;
let encoded_pie =
snos::sharp::pie::encode_pie_mem(cairo_pie).map_err(ProverClientError::PieEncoding)?;
let (_, job_key) = self.sharp_client.add_job(&encoded_pie).await?;
Ok(combine_task_id(&job_key, &fact_info.fact))
}
}
}
Expand Down Expand Up @@ -75,6 +74,9 @@ impl SharpProverService {

pub fn with_settings(settings: &impl SettingsProvider) -> Self {
let sharp_cfg: SharpConfig = settings.get_settings(SHARP_SETTINGS_NAME).unwrap();

log::info!("sharp config : {:?}", sharp_cfg);

let sharp_client = SharpClient::new(sharp_cfg.service_url);
let fact_checker = FactChecker::new(sharp_cfg.rpc_node_url, sharp_cfg.verifier_address);
Self::new(sharp_client, fact_checker)
Expand Down
Loading

0 comments on commit 98a42d5

Please sign in to comment.