8080{
8181 trace ! ( "Handling request for deployment `{manifest_id}`" ) ;
8282
83- #[ derive( Debug , serde:: Deserialize , serde:: Serialize ) ]
84- pub struct QueryBody {
85- pub query : String ,
86- pub variables : Option < Box < RawValue > > ,
87- }
88-
8983 let request: QueryBody =
9084 serde_json:: from_slice ( & body) . map_err ( |e| IndexerServiceError :: InvalidRequest ( e. into ( ) ) ) ?;
9185
@@ -112,7 +106,6 @@ where
112106 . process_request ( manifest_id, request)
113107 . await
114108 . map_err ( IndexerServiceError :: ProcessingError ) ?
115- . 1
116109 . finalize ( AttestationOutput :: Attestable ) ;
117110 return Ok ( ( StatusCode :: OK , response) ) ;
118111 } ;
@@ -179,14 +172,14 @@ where
179172 . cloned ( )
180173 . ok_or_else ( || ( IndexerServiceError :: NoSignerForAllocation ( allocation_id) ) ) ?;
181174
182- let ( request , response) = state
175+ let response = state
183176 . service_impl
184177 . process_request ( manifest_id, request)
185178 . await
186179 . map_err ( IndexerServiceError :: ProcessingError ) ?;
187180
188- let req = serde_json :: to_string ( & request )
189- . map_err ( |_| IndexerServiceError :: FailedToSignAttestation ) ?;
181+ let req =
182+ std :: str :: from_utf8 ( & body ) . map_err ( |_| IndexerServiceError :: FailedToSignAttestation ) ?;
190183
191184 let res = response
192185 . as_str ( )
@@ -195,10 +188,16 @@ where
195188 let attestation = AttestationOutput :: Attestation (
196189 response
197190 . is_attestable ( )
198- . then ( || signer. create_attestation ( & req, res) ) ,
191+ . then ( || signer. create_attestation ( req, res) ) ,
199192 ) ;
200193
201194 let response = response. finalize ( attestation) ;
202195
203196 Ok ( ( StatusCode :: OK , response) )
204197}
198+
199+ #[ derive( Debug , serde:: Deserialize , serde:: Serialize ) ]
200+ pub struct QueryBody {
201+ pub query : String ,
202+ pub variables : Option < Box < RawValue > > ,
203+ }
0 commit comments