Skip to content

Commit

Permalink
fix(sdk): add get_filtered_proof_requests to network-v2 client
Browse files Browse the repository at this point in the history
  • Loading branch information
mattstam committed Dec 16, 2024
1 parent 3a26009 commit fc520ff
Showing 1 changed file with 42 additions and 4 deletions.
46 changes: 42 additions & 4 deletions crates/sdk/src/network-v2/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ use crate::network_v2::proto::artifact::{
};
use crate::network_v2::proto::network::{
prover_network_client::ProverNetworkClient, CreateProgramRequest, CreateProgramRequestBody,
CreateProgramResponse, FulfillmentStatus, FulfillmentStrategy, GetNonceRequest,
GetProgramRequest, GetProgramResponse, GetProofRequestStatusRequest,
GetProofRequestStatusResponse, MessageFormat, ProofMode, RequestProofRequest,
RequestProofRequestBody, RequestProofResponse,
CreateProgramResponse, FulfillmentStatus, FulfillmentStrategy, GetFilteredProofRequestsRequest,
GetFilteredProofRequestsResponse, GetNonceRequest, GetProgramRequest, GetProgramResponse,
GetProofRequestStatusRequest, GetProofRequestStatusResponse, MessageFormat, ProofMode,
RequestProofRequest, RequestProofRequestBody, RequestProofResponse,
};
use crate::network_v2::Signable;

Expand Down Expand Up @@ -243,6 +243,44 @@ impl NetworkClient {
Ok(request_response)
}

/// Get all the proof requests for a given status. Also filter by version if provided.
#[allow(clippy::too_many_arguments)]
pub async fn get_filtered_proof_requests(
&self,
version: Option<String>,
fulfillment_status: Option<i32>,
execution_status: Option<i32>,
minimum_deadline: Option<u64>,
vk_hash: Option<Vec<u8>>,
requester: Option<Vec<u8>>,
fulfiller: Option<Vec<u8>>,
from: Option<u64>,
to: Option<u64>,
limit: Option<u32>,
page: Option<u32>,
mode: Option<i32>,
) -> Result<GetFilteredProofRequestsResponse> {
let mut rpc = self.get_rpc().await?;
let res = rpc
.get_filtered_proof_requests(GetFilteredProofRequestsRequest {
version,
fulfillment_status,
execution_status,
minimum_deadline,
vk_hash,
requester,
fulfiller,
from,
to,
limit,
page,
mode,
})
.await?
.into_inner();
Ok(res)
}

/// Uses the artifact store to to create an artifact, upload the content, and return the URI.
async fn create_artifact_with_content<T: Serialize>(
&self,
Expand Down

0 comments on commit fc520ff

Please sign in to comment.