Skip to content

Commit 3a03bd1

Browse files
committed
chore: attend pr review comments
1 parent 48eda57 commit 3a03bd1

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

  • node/src/actors/json_rpc

node/src/actors/json_rpc/api.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2796,20 +2796,22 @@ pub async fn get_data_request(params: Result<GetDataRequestParams, Error>) -> Js
27962796
None => None,
27972797
};
27982798

2799+
// Get data request transaction's query parameters
2800+
let query = get_dr_query_params(hash).await.ok();
2801+
2802+
// Get data request transaction's query result, if any
2803+
let result = confirmations.map(|confirmations| DataRequestQueryResult {
2804+
cbor_bytes: hex::encode(report.tally.unwrap_or_default().tally),
2805+
confirmations,
2806+
timestamp: timestamp.unwrap_or_default(),
2807+
});
2808+
27992809
GetDataRequestOutput::Ethereal(GetDataRequestEtherealOutput {
28002810
block_epoch,
28012811
block_hash,
28022812
confirmed,
2803-
query: get_dr_query_params(hash).await.ok(),
2804-
result: if let Some(confirmations) = confirmations {
2805-
Some(DataRequestQueryResult {
2806-
cbor_bytes: hex::encode(report.tally.unwrap_or_default().tally),
2807-
confirmations,
2808-
timestamp: timestamp.unwrap_or_default(),
2809-
})
2810-
} else {
2811-
None
2812-
},
2813+
query,
2814+
result,
28132815
status,
28142816
})
28152817
};

0 commit comments

Comments
 (0)