adding node api health check

This commit is contained in:
scilio
2022-09-14 16:14:31 -04:00
parent 2cd450cfa9
commit f70e1dfbf2
2 changed files with 22 additions and 9 deletions
+2 -3
View File
@@ -150,9 +150,8 @@ impl GrinNode for HttpGrinNode {
fn get_chain_height(&self) -> Result<u64, NodeError> {
let params = json!([]);
let tip_json = self.send_json_request::<serde_json::Value>("get_tip", &params)?;
let tip = serde_json::from_value::<Tip>(tip_json["Ok"].clone())
.map_err(NodeError::DecodeResponseError)?;
let tip =
serde_json::from_value::<Tip>(tip_json).map_err(NodeError::DecodeResponseError)?;
Ok(tip.height)
}