From: Daniela Brozzoni Date: Fri, 29 Sep 2023 14:02:48 +0000 (+0200) Subject: test(chain): add block_id! utility macro X-Git-Tag: v1.0.0-alpha.2~6^2~3 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/scripts/trait.Engine.html?a=commitdiff_plain;h=6e511473a5e5730d5cad237c651c83dc4c5d8756;p=bdk test(chain): add block_id! utility macro Co-authored-by: Wei Chen --- 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) => {{