@@ -2171,7 +2171,10 @@ impl TestIndexer {
21712171 InclusionProofInputs :: new ( inclusion_proofs. as_slice ( ) ) . unwrap ( ) ;
21722172 (
21732173 Some (
2174- BatchInclusionJsonStruct :: from_inclusion_proof_inputs ( & inclusion_proof_inputs) ,
2174+ BatchInclusionJsonStruct :: from_inclusion_proof_inputs (
2175+ & inclusion_proof_inputs,
2176+ )
2177+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?,
21752178 ) ,
21762179 None ,
21772180 )
@@ -2182,7 +2185,8 @@ impl TestIndexer {
21822185 Some (
21832186 BatchInclusionJsonStructLegacy :: from_inclusion_proof_inputs (
21842187 & inclusion_proof_inputs,
2185- ) ,
2188+ )
2189+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?,
21862190 ) ,
21872191 )
21882192 } else {
@@ -2261,7 +2265,8 @@ impl TestIndexer {
22612265 Some (
22622266 BatchNonInclusionJsonStructLegacy :: from_non_inclusion_proof_inputs (
22632267 & non_inclusion_proof_inputs,
2264- ) ,
2268+ )
2269+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?,
22652270 ) ,
22662271 )
22672272 } else if tree_heights[ 0 ] == 40 {
@@ -2271,7 +2276,8 @@ impl TestIndexer {
22712276 Some (
22722277 BatchNonInclusionJsonStruct :: from_non_inclusion_proof_inputs (
22732278 & non_inclusion_proof_inputs,
2274- ) ,
2279+ )
2280+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?,
22752281 ) ,
22762282 None ,
22772283 )
@@ -2358,12 +2364,21 @@ impl TestIndexer {
23582364 )
23592365 . await ?;
23602366 if let Some ( payload) = payload {
2361- ( 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+ )
23622374 } else {
23632375 (
23642376 indices,
23652377 Vec :: new ( ) ,
2366- payload_legacy. unwrap ( ) . to_string ( ) ,
2378+ payload_legacy
2379+ . unwrap ( )
2380+ . to_string ( )
2381+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?,
23672382 )
23682383 }
23692384 }
@@ -2375,9 +2390,14 @@ impl TestIndexer {
23752390 )
23762391 . await ?;
23772392 let payload_string = if let Some ( payload) = payload {
2378- payload. to_string ( )
2393+ payload
2394+ . to_string ( )
2395+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?
23792396 } else {
2380- payload_legacy. unwrap ( ) . to_string ( )
2397+ payload_legacy
2398+ . unwrap ( )
2399+ . to_string ( )
2400+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?
23812401 } ;
23822402 ( Vec :: new ( ) , indices, payload_string)
23832403 }
@@ -2454,6 +2474,7 @@ impl TestIndexer {
24542474 non_inclusion : non_inclusion_payload. inputs ,
24552475 }
24562476 . to_string ( )
2477+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?
24572478 } else if let Some ( non_inclusion_payload) = non_inclusion_payload_legacy {
24582479 CombinedJsonStructLegacy {
24592480 circuit_type : ProofType :: Combined . to_string ( ) ,
@@ -2463,6 +2484,7 @@ impl TestIndexer {
24632484 non_inclusion : non_inclusion_payload. inputs ,
24642485 }
24652486 . to_string ( )
2487+ . map_err ( |e| IndexerError :: CustomError ( e. to_string ( ) ) ) ?
24662488 } else {
24672489 panic ! ( "Unsupported tree height" )
24682490 } ;
@@ -2487,9 +2509,11 @@ impl TestIndexer {
24872509 if response_result. status ( ) . is_success ( ) {
24882510 let body = response_result. text ( ) . await . unwrap ( ) ;
24892511 let proof_json = deserialize_gnark_proof_json ( & body) . unwrap ( ) ;
2490- 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 ( ) ) ) ?;
24912514 let ( proof_a, proof_b, proof_c) =
2492- 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 ( ) ) ) ?;
24932517 return Ok ( ValidityProofWithContext {
24942518 accounts : account_proof_inputs,
24952519 addresses : address_proof_inputs,
0 commit comments