diff --git a/ikura/shim/src/cli.rs b/ikura/shim/src/cli.rs index 9cb05945..4e391732 100644 --- a/ikura/shim/src/cli.rs +++ b/ikura/shim/src/cli.rs @@ -181,7 +181,7 @@ pub mod query { /// /// Hashes must be 32 bytes, hex-encoded, and prefixed with "0x". #[arg(value_name = "BLOCK_REF")] - pub block_ref: BlockRef, + pub block_ref: Option, /// By default, if the block is not available (e.g. not yet produced), the shim will return immediately. /// diff --git a/ikura/shim/src/cmd/query/mod.rs b/ikura/shim/src/cmd/query/mod.rs index eb50e461..bafeb53e 100644 --- a/ikura/shim/src/cmd/query/mod.rs +++ b/ikura/shim/src/cmd/query/mod.rs @@ -23,9 +23,9 @@ pub async fn get_block_at( block: BlockParams, ) -> anyhow::Result { let maybe_hash = match block.block_ref { - BlockRef::Best => None, - BlockRef::Hash(h) => Some(h), - BlockRef::Number(n) => Some(match block.wait { + None | Some(BlockRef::Best) => None, + Some(BlockRef::Hash(h)) => Some(h), + Some(BlockRef::Number(n)) => Some(match block.wait { true => client.await_block_hash(n).await, false => client .block_hash(n)