@@ -312,8 +312,13 @@ async fn fetch_offchain_data(
312312 sender : sender_as_bytes,
313313 data : data_as_bytes,
314314 signature : maybe_signature_hex,
315- origin_tx_hash,
315+ origin_tx_hash : origin_tx_hash . clone ( ) ,
316316 } ;
317+ info ! (
318+ url = interpolated_url,
319+ body = ?body,
320+ "Sending POST offchain lookup request"
321+ ) ;
317322 Client :: new ( )
318323 . request ( Method :: POST , interpolated_url)
319324 . header ( CONTENT_TYPE , "application/json" )
@@ -327,6 +332,11 @@ async fn fetch_offchain_data(
327332 MetadataBuildError :: FailedToBuild ( msg)
328333 } ) ?
329334 } else {
335+ info ! (
336+ url = interpolated_url,
337+ ?origin_tx_hash,
338+ "Sending GET offchain lookup request"
339+ ) ;
330340 Client :: new ( )
331341 . request ( Method :: GET , interpolated_url)
332342 . timeout ( Duration :: from_secs ( DEFAULT_TIMEOUT ) )
@@ -339,10 +349,17 @@ async fn fetch_offchain_data(
339349 } ) ?
340350 } ;
341351
352+ let status = res. status ( ) ;
342353 let response_body = res. text ( ) . await . map_err ( |err| {
343354 let error_msg = format ! ( "Failed to read offchain lookup server response: ({err})" ) ;
344355 MetadataBuildError :: FailedToBuild ( error_msg)
345356 } ) ?;
357+ info ! (
358+ url,
359+ status = status. as_u16( ) ,
360+ response_body,
361+ "Received offchain lookup response"
362+ ) ;
346363 let json: OffchainResponse = serde_json:: from_str ( & response_body) . map_err ( |err| {
347364 let error_msg = format ! (
348365 "Failed to parse offchain lookup server json response: ({err}) ({response_body})"
0 commit comments