Skip to content

Commit

Permalink
display height on errors
Browse files Browse the repository at this point in the history
  • Loading branch information
phasewalk1 committed Apr 23, 2024
1 parent 4cd1822 commit 992cc63
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/core/component/sct/src/component/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ impl QueryService for Server {
) -> Result<tonic::Response<AnchorByHeightResponse>, Status> {
let state = self.storage.latest_snapshot();

let anchor = state
.get_anchor_by_height(request.get_ref().height)
.await
.map_err(|e| tonic::Status::unknown(format!("could not get anchor for height: {e}")))?;
let height = request.get_ref().height;
let anchor = state.get_anchor_by_height(height).await.map_err(|e| {
tonic::Status::unknown(format!("could not get anchor for height {height}: {e}"))
})?;

Ok(tonic::Response::new(AnchorByHeightResponse {
anchor: anchor.map(Into::into),
Expand Down

0 comments on commit 992cc63

Please sign in to comment.