Skip to content

Commit e4629ae

Browse files
authored
Merge pull request #225 from matter-labs/handle_old_proof_response
fix(proof-validation): handle optional proof status
2 parents 6e88e20 + 78471f5 commit e4629ae

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

bin/verify-era-proof-attestation/src/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,10 @@ async fn verify_batch_proofs(
159159
total_proofs_count += 1;
160160
let tee_type = proof.tee_type.to_uppercase();
161161

162-
if proof.status.eq_ignore_ascii_case("permanently_ignored") {
162+
if proof
163+
.status
164+
.map_or(false, |s| s.eq_ignore_ascii_case("permanently_ignored"))
165+
{
163166
trace!(
164167
batch_no,
165168
tee_type,

bin/verify-era-proof-attestation/src/proof.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ pub async fn get_proofs(
3939

4040
if !proofs.is_empty()
4141
&& proofs.iter().all(|proof| {
42-
!proof.status.eq_ignore_ascii_case("failed")
43-
&& !proof.status.eq_ignore_ascii_case("picked_by_prover")
42+
!proof.status.as_ref().map_or(false, |s| {
43+
s.eq_ignore_ascii_case("failed") | s.eq_ignore_ascii_case("picked_by_prover")
44+
})
4445
})
4546
{
4647
return Ok(proofs);
@@ -165,7 +166,7 @@ pub struct Proof {
165166
#[serde_as(as = "Option<Hex>")]
166167
pub proof: Option<Vec<u8>>,
167168
pub proved_at: String,
168-
pub status: String,
169+
pub status: Option<String>,
169170
#[serde_as(as = "Option<Hex>")]
170171
pub attestation: Option<Vec<u8>>,
171172
}

0 commit comments

Comments
 (0)