From 6e511473a5e5730d5cad237c651c83dc4c5d8756 Mon Sep 17 00:00:00 2001 From: Daniela Brozzoni Date: Fri, 29 Sep 2023 16:02:48 +0200 Subject: [PATCH] test(chain): add block_id! utility macro Co-authored-by: Wei Chen --- crates/chain/tests/common/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/chain/tests/common/mod.rs b/crates/chain/tests/common/mod.rs index 2573fd96..694d90dc 100644 --- a/crates/chain/tests/common/mod.rs +++ b/crates/chain/tests/common/mod.rs @@ -1,3 +1,13 @@ +#[allow(unused_macros)] +macro_rules! block_id { + ($height:expr, $hash:literal) => {{ + bdk_chain::BlockId { + height: $height, + hash: bitcoin::hashes::Hash::hash($hash.as_bytes()), + } + }}; +} + #[allow(unused_macros)] macro_rules! h { ($index:literal) => {{