feat(chain)!: rm local_chain::Update
The intention is to remove the `Update::introduce_older_blocks` parameter and update the local chain directly with `CheckPoint`. This simplifies the API and there is a way to do this efficiently.
This commit is contained in:
@@ -32,12 +32,9 @@ macro_rules! local_chain {
|
||||
macro_rules! chain_update {
|
||||
[ $(($height:expr, $hash:expr)), * ] => {{
|
||||
#[allow(unused_mut)]
|
||||
bdk_chain::local_chain::Update {
|
||||
tip: bdk_chain::local_chain::LocalChain::from_blocks([$(($height, $hash).into()),*].into_iter().collect())
|
||||
.expect("chain must have genesis block")
|
||||
.tip(),
|
||||
introduce_older_blocks: true,
|
||||
}
|
||||
bdk_chain::local_chain::LocalChain::from_blocks([$(($height, $hash).into()),*].into_iter().collect())
|
||||
.expect("chain must have genesis block")
|
||||
.tip()
|
||||
}};
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ use std::ops::{Bound, RangeBounds};
|
||||
use bdk_chain::{
|
||||
local_chain::{
|
||||
AlterCheckPointError, ApplyHeaderError, CannotConnectError, ChangeSet, CheckPoint,
|
||||
LocalChain, MissingGenesisError, Update,
|
||||
LocalChain, MissingGenesisError,
|
||||
},
|
||||
BlockId,
|
||||
};
|
||||
@@ -17,7 +17,7 @@ mod common;
|
||||
struct TestLocalChain<'a> {
|
||||
name: &'static str,
|
||||
chain: LocalChain,
|
||||
update: Update,
|
||||
update: CheckPoint,
|
||||
exp: ExpectedResult<'a>,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user