[bdk_chain_redesign] Test LocalChain

This is mostly copying over the relevant tests from `SparseChain`.
Changes are made to `local_chain::ChangeSet` to re-add the ability to
remove blocks.
This commit is contained in:
志宇
2023-04-20 15:29:20 +08:00
parent 7175a82c04
commit 1003fe2ee6
3 changed files with 214 additions and 9 deletions

View File

@@ -5,6 +5,14 @@ macro_rules! h {
}};
}
#[allow(unused_macros)]
macro_rules! local_chain {
[ $(($height:expr, $block_hash:expr)), * ] => {{
#[allow(unused_mut)]
bdk_chain::local_chain::LocalChain::from_blocks([$(($height, $block_hash).into()),*])
}};
}
#[allow(unused_macros)]
macro_rules! chain {
($([$($tt:tt)*]),*) => { chain!( checkpoints: [$([$($tt)*]),*] ) };