@@ -2170,18 +2170,24 @@ impl TestIndexer {
21702170 let inclusion_proof_inputs =
21712171 InclusionProofInputs :: new ( inclusion_proofs. as_slice ( ) ) . unwrap ( ) ;
21722172 (
2173- Some ( BatchInclusionJsonStruct :: from_inclusion_proof_inputs (
2174- & inclusion_proof_inputs,
2175- ) ) ,
2173+ Some (
2174+ BatchInclusionJsonStruct :: from_inclusion_proof_inputs (
2175+ & inclusion_proof_inputs,
2176+ )
2177+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?,
2178+ ) ,
21762179 None ,
21772180 )
21782181 } else if height == STATE_MERKLE_TREE_HEIGHT as usize {
21792182 let inclusion_proof_inputs = InclusionProofInputsLegacy ( inclusion_proofs. as_slice ( ) ) ;
21802183 (
21812184 None ,
2182- Some ( BatchInclusionJsonStructLegacy :: from_inclusion_proof_inputs (
2183- & inclusion_proof_inputs,
2184- ) ) ,
2185+ Some (
2186+ BatchInclusionJsonStructLegacy :: from_inclusion_proof_inputs (
2187+ & inclusion_proof_inputs,
2188+ )
2189+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?,
2190+ ) ,
21852191 )
21862192 } else {
21872193 return Err ( IndexerError :: CustomError (
@@ -2259,7 +2265,8 @@ impl TestIndexer {
22592265 Some (
22602266 BatchNonInclusionJsonStructLegacy :: from_non_inclusion_proof_inputs (
22612267 & non_inclusion_proof_inputs,
2262- ) ,
2268+ )
2269+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?,
22632270 ) ,
22642271 )
22652272 } else if tree_heights[ 0 ] == 40 {
@@ -2269,7 +2276,8 @@ impl TestIndexer {
22692276 Some (
22702277 BatchNonInclusionJsonStruct :: from_non_inclusion_proof_inputs (
22712278 & non_inclusion_proof_inputs,
2272- ) ,
2279+ )
2280+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?,
22732281 ) ,
22742282 None ,
22752283 )
@@ -2356,9 +2364,22 @@ impl TestIndexer {
23562364 )
23572365 . await ?;
23582366 if let Some ( payload) = payload {
2359- ( indices, Vec :: new ( ) , payload. to_string ( ) )
2367+ (
2368+ indices,
2369+ Vec :: new ( ) ,
2370+ payload
2371+ . to_string ( )
2372+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?,
2373+ )
23602374 } else {
2361- ( indices, Vec :: new ( ) , payload_legacy. unwrap ( ) . to_string ( ) )
2375+ (
2376+ indices,
2377+ Vec :: new ( ) ,
2378+ payload_legacy
2379+ . unwrap ( )
2380+ . to_string ( )
2381+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?,
2382+ )
23622383 }
23632384 }
23642385 ( None , Some ( addresses) ) => {
@@ -2369,9 +2390,14 @@ impl TestIndexer {
23692390 )
23702391 . await ?;
23712392 let payload_string = if let Some ( payload) = payload {
2372- payload. to_string ( )
2393+ payload
2394+ . to_string ( )
2395+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?
23732396 } else {
2374- payload_legacy. unwrap ( ) . to_string ( )
2397+ payload_legacy
2398+ . unwrap ( )
2399+ . to_string ( )
2400+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?
23752401 } ;
23762402 ( Vec :: new ( ) , indices, payload_string)
23772403 }
@@ -2448,6 +2474,7 @@ impl TestIndexer {
24482474 non_inclusion : non_inclusion_payload. inputs ,
24492475 }
24502476 . to_string ( )
2477+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?
24512478 } else if let Some ( non_inclusion_payload) = non_inclusion_payload_legacy {
24522479 CombinedJsonStructLegacy {
24532480 circuit_type : ProofType :: Combined . to_string ( ) ,
@@ -2457,6 +2484,7 @@ impl TestIndexer {
24572484 non_inclusion : non_inclusion_payload. inputs ,
24582485 }
24592486 . to_string ( )
2487+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?
24602488 } else {
24612489 panic ! ( "Unsupported tree height" )
24622490 } ;
@@ -2481,9 +2509,11 @@ impl TestIndexer {
24812509 if response_result. status ( ) . is_success ( ) {
24822510 let body = response_result. text ( ) . await . unwrap ( ) ;
24832511 let proof_json = deserialize_gnark_proof_json ( & body) . unwrap ( ) ;
2484- let ( proof_a, proof_b, proof_c) = proof_from_json_struct ( proof_json) ;
2512+ let ( proof_a, proof_b, proof_c) = proof_from_json_struct ( proof_json)
2513+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?;
24852514 let ( proof_a, proof_b, proof_c) =
2486- compress_proof ( & proof_a, & proof_b, & proof_c) ;
2515+ compress_proof ( & proof_a, & proof_b, & proof_c)
2516+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?;
24872517 return Ok ( ValidityProofWithContext {
24882518 accounts : account_proof_inputs,
24892519 addresses : address_proof_inputs,
0 commit comments