-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Configurable pow_bits and n_queries * working version of proof parser * clippy and fmt * error handling and binary update * multiple admin keys * function to calculate prover result
- Loading branch information
1 parent
ddfa3ee
commit 3f2d99f
Showing
23 changed files
with
336 additions
and
172 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
use common::models::{JobResponse, ProverResult}; | ||
use prover_sdk::sdk::ProverSDK; | ||
use serde_json::Value; | ||
|
||
pub async fn fetch_job(sdk: ProverSDK, job: u64) -> String { | ||
pub async fn fetch_job(sdk: ProverSDK, job: u64) -> Option<ProverResult> { | ||
println!("Job ID: {}", job); | ||
sdk.sse(job).await.unwrap(); | ||
let response = sdk.get_job(job).await.unwrap(); | ||
let response = response.text().await.unwrap(); | ||
let json_response: Value = serde_json::from_str(&response).unwrap(); | ||
return json_response | ||
.get("result") | ||
.and_then(Value::as_str) | ||
.unwrap_or("No result found") | ||
.to_string(); | ||
let json_response: JobResponse = serde_json::from_str(&response).unwrap(); | ||
|
||
if let JobResponse::Completed { result, .. } = json_response { | ||
return Some(result); | ||
} | ||
None | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.