mirror of
https://github.com/matter-labs/teepot.git
synced 2025-07-22 15:34:48 +02:00
Merge pull request #225 from matter-labs/handle_old_proof_response
fix(proof-validation): handle optional proof status
This commit is contained in:
commit
e4629aee55
2 changed files with 8 additions and 4 deletions
|
@ -159,7 +159,10 @@ async fn verify_batch_proofs(
|
||||||
total_proofs_count += 1;
|
total_proofs_count += 1;
|
||||||
let tee_type = proof.tee_type.to_uppercase();
|
let tee_type = proof.tee_type.to_uppercase();
|
||||||
|
|
||||||
if proof.status.eq_ignore_ascii_case("permanently_ignored") {
|
if proof
|
||||||
|
.status
|
||||||
|
.map_or(false, |s| s.eq_ignore_ascii_case("permanently_ignored"))
|
||||||
|
{
|
||||||
trace!(
|
trace!(
|
||||||
batch_no,
|
batch_no,
|
||||||
tee_type,
|
tee_type,
|
||||||
|
|
|
@ -39,8 +39,9 @@ pub async fn get_proofs(
|
||||||
|
|
||||||
if !proofs.is_empty()
|
if !proofs.is_empty()
|
||||||
&& proofs.iter().all(|proof| {
|
&& proofs.iter().all(|proof| {
|
||||||
!proof.status.eq_ignore_ascii_case("failed")
|
!proof.status.as_ref().map_or(false, |s| {
|
||||||
&& !proof.status.eq_ignore_ascii_case("picked_by_prover")
|
s.eq_ignore_ascii_case("failed") | s.eq_ignore_ascii_case("picked_by_prover")
|
||||||
|
})
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
return Ok(proofs);
|
return Ok(proofs);
|
||||||
|
@ -165,7 +166,7 @@ pub struct Proof {
|
||||||
#[serde_as(as = "Option<Hex>")]
|
#[serde_as(as = "Option<Hex>")]
|
||||||
pub proof: Option<Vec<u8>>,
|
pub proof: Option<Vec<u8>>,
|
||||||
pub proved_at: String,
|
pub proved_at: String,
|
||||||
pub status: String,
|
pub status: Option<String>,
|
||||||
#[serde_as(as = "Option<Hex>")]
|
#[serde_as(as = "Option<Hex>")]
|
||||||
pub attestation: Option<Vec<u8>>,
|
pub attestation: Option<Vec<u8>>,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue