test(chain): add block_id! utility macro

Co-authored-by: Wei Chen <wzc110@gmail.com>
This commit is contained in:
Daniela Brozzoni 2023-09-29 16:02:48 +02:00
parent 62de55f12d
commit 6e511473a5
No known key found for this signature in database
GPG Key ID: 7DE4F1FDCED0AB87

View File

@ -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)] #[allow(unused_macros)]
macro_rules! h { macro_rules! h {
($index:literal) => {{ ($index:literal) => {{