state: make Response::Tip return (height, hash)
This commit is contained in:
parent
3133214e4f
commit
f1f0b331ac
|
|
@ -134,7 +134,7 @@ where
|
||||||
zs::Response::Tip(tip) => tip,
|
zs::Response::Tip(tip) => tip,
|
||||||
_ => unreachable!("wrong response to Request::Tip"),
|
_ => unreachable!("wrong response to Request::Tip"),
|
||||||
};
|
};
|
||||||
let tip = if let Some(hash) = tip_hash {
|
let tip = if let Some((_height, hash)) = tip_hash {
|
||||||
match state_service
|
match state_service
|
||||||
.ready_and()
|
.ready_and()
|
||||||
.await
|
.await
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@ pub enum Response {
|
||||||
Committed(block::Hash),
|
Committed(block::Hash),
|
||||||
|
|
||||||
/// Response to [`Request::Depth`] with the depth of the specified block.
|
/// Response to [`Request::Depth`] with the depth of the specified block.
|
||||||
Depth(Option<block::Height>),
|
Depth(Option<u32>),
|
||||||
|
|
||||||
/// Response to [`Request::Tip`] with the current best chain tip.
|
/// Response to [`Request::Tip`] with the current best chain tip.
|
||||||
Tip(Option<block::Hash>),
|
Tip(Option<(block::Height, block::Hash)>),
|
||||||
|
|
||||||
/// Response to [`Request::BlockLocator`] with a block locator object.
|
/// Response to [`Request::BlockLocator`] with a block locator object.
|
||||||
BlockLocator(Vec<block::Hash>),
|
BlockLocator(Vec<block::Hash>),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue