Skip to content

Commit 8ee7ea8

Browse files
pepyakinrphmeier
authored andcommitted
shim/cli: query best block by default
1 parent ad11422 commit 8ee7ea8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ikura/shim/src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ pub mod query {
181181
///
182182
/// Hashes must be 32 bytes, hex-encoded, and prefixed with "0x".
183183
#[arg(value_name = "BLOCK_REF")]
184-
pub block_ref: BlockRef,
184+
pub block_ref: Option<BlockRef>,
185185

186186
/// By default, if the block is not available (e.g. not yet produced), the shim will return immediately.
187187
///

ikura/shim/src/cmd/query/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ pub async fn get_block_at(
2323
block: BlockParams,
2424
) -> anyhow::Result<ikura_rpc::Block> {
2525
let maybe_hash = match block.block_ref {
26-
BlockRef::Best => None,
27-
BlockRef::Hash(h) => Some(h),
28-
BlockRef::Number(n) => Some(match block.wait {
26+
None | Some(BlockRef::Best) => None,
27+
Some(BlockRef::Hash(h)) => Some(h),
28+
Some(BlockRef::Number(n)) => Some(match block.wait {
2929
true => client.await_block_hash(n).await,
3030
false => client
3131
.block_hash(n)

0 commit comments

Comments
 (0)