feat: can get actual available roots
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2024-05-14 20:58:38 +02:00
parent 7bdf8393b1
commit 816869e6f9
4 changed files with 95 additions and 11 deletions

View File

@@ -225,9 +225,22 @@ impl Graph for Server {
let req = request.into_inner();
tracing::trace!("get available roots: req({:?})", req);
Ok(Response::new(GetAvailableRootsResponse {
roots: vec!["kjuulh".into()],
}))
let roots = match self
.querier
.get_available_roots()
.await
.map_err(to_tonic_err)?
{
Some(roots) => roots,
None => {
return Err(tonic::Status::new(
tonic::Code::NotFound,
"failed to find any valid roots",
))
}
};
Ok(Response::new(GetAvailableRootsResponse { roots }))
}
}