From e26be1efeb2fa2c3a7c2abbf6ea406327baa4cd5 Mon Sep 17 00:00:00 2001 From: Vihiga Tyonum Date: Sat, 14 Sep 2024 22:26:17 +0100 Subject: [PATCH] Replace `block_id` macro def with testenv tx util - import testenv crate - delete common module and import `block_id` from testenv crate [issue: #1602] --- crates/core/Cargo.toml | 1 + crates/core/tests/common.rs | 9 --------- crates/core/tests/test_checkpoint.rs | 4 +--- 3 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 crates/core/tests/common.rs diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index 3749b9157..58f43ef01 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -22,3 +22,4 @@ serde = ["dep:serde", "bitcoin/serde", "hashbrown?/serde"] [dev-dependencies] bdk_chain = { path = "../chain" } +bdk_testenv = { path = "../testenv", default-features = false } diff --git a/crates/core/tests/common.rs b/crates/core/tests/common.rs deleted file mode 100644 index 347a90bf6..000000000 --- a/crates/core/tests/common.rs +++ /dev/null @@ -1,9 +0,0 @@ -#[allow(unused_macros)] -macro_rules! block_id { - ($height:expr, $hash:literal) => {{ - bdk_chain::BlockId { - height: $height, - hash: bitcoin::hashes::Hash::hash($hash.as_bytes()), - } - }}; -} diff --git a/crates/core/tests/test_checkpoint.rs b/crates/core/tests/test_checkpoint.rs index 705f1c474..2ec96c153 100644 --- a/crates/core/tests/test_checkpoint.rs +++ b/crates/core/tests/test_checkpoint.rs @@ -1,7 +1,5 @@ -#[macro_use] -mod common; - use bdk_core::CheckPoint; +use bdk_testenv::block_id; /// Inserting a block that already exists in the checkpoint chain must always succeed. #[test]