Skip to content

Commit 20fea22

Browse files
refactor: remove unused ApplyBlockError
1 parent c2d0850 commit 20fea22

2 files changed

Lines changed: 1 addition & 34 deletions

File tree

src/wallet/error.rs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use alloc::{
2020
string::{String, ToString},
2121
};
2222
use bitcoin::{absolute, psbt, Amount, BlockHash, Network, OutPoint, Sequence, Txid};
23-
use chain::local_chain::CannotConnectError;
2423
use core::fmt;
2524

2625
/// The error type when loading a [`Wallet`] from a [`ChangeSet`].
@@ -128,38 +127,6 @@ impl From<LoadMismatch> for LoadError {
128127
}
129128
}
130129

131-
/// An error that may occur when applying a block to [`Wallet`].
132-
#[derive(Debug)]
133-
pub enum ApplyBlockError {
134-
/// Occurs when the update chain cannot connect with original chain.
135-
CannotConnect(CannotConnectError),
136-
/// Occurs when the `connected_to` hash does not match the hash derived from `block`.
137-
UnexpectedConnectedToHash {
138-
/// Block hash of `connected_to`.
139-
connected_to_hash: BlockHash,
140-
/// Expected block hash of `connected_to`, as derived from `block`.
141-
expected_hash: BlockHash,
142-
},
143-
}
144-
145-
impl fmt::Display for ApplyBlockError {
146-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
147-
match self {
148-
ApplyBlockError::CannotConnect(err) => err.fmt(f),
149-
ApplyBlockError::UnexpectedConnectedToHash {
150-
expected_hash: block_hash,
151-
connected_to_hash: checkpoint_hash,
152-
} => write!(
153-
f,
154-
"`connected_to` hash {checkpoint_hash} differs from the expected hash {block_hash} (which is derived from `block`)"
155-
),
156-
}
157-
}
158-
}
159-
160-
#[cfg(feature = "std")]
161-
impl std::error::Error for ApplyBlockError {}
162-
163130
/// Errors returned by miniscript when updating inconsistent PSBTs
164131
#[derive(Debug, Clone)]
165132
pub enum MiniscriptPsbtError {

src/wallet/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ use crate::wallet::{
8080
// re-exports
8181
pub use bdk_chain::Balance;
8282
pub use changeset::ChangeSet;
83-
pub use error::{ApplyBlockError, LoadError, LoadMismatch};
83+
pub use error::{LoadError, LoadMismatch};
8484
pub use event::*;
8585
pub use params::*;
8686
pub use persisted::*;

0 commit comments

Comments
 (0)