Skip to content

Commit ab7f64b

Browse files
committed
refactor(input-candidates): remove unused policy errors
1 parent ccf36cd commit ab7f64b

1 file changed

Lines changed: 0 additions & 46 deletions

File tree

src/input_candidates.rs

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use alloc::{vec, vec::Vec};
22
use core::fmt;
3-
use core::ops::Deref;
43

54
use bdk_coin_select::{metrics::LowestFee, Candidate, NoBnbSolution};
65
use bitcoin::{absolute, FeeRate, OutPoint};
@@ -241,51 +240,6 @@ impl<E: fmt::Display> fmt::Display for IntoSelectionError<E> {
241240
#[cfg(feature = "std")]
242241
impl<E: fmt::Debug + fmt::Display> std::error::Error for IntoSelectionError<E> {}
243242

244-
/// Occurs when we are missing outputs.
245-
#[derive(Debug)]
246-
pub struct MissingOutputs(HashSet<OutPoint>);
247-
248-
impl Deref for MissingOutputs {
249-
type Target = HashSet<OutPoint>;
250-
251-
fn deref(&self) -> &Self::Target {
252-
&self.0
253-
}
254-
}
255-
256-
impl fmt::Display for MissingOutputs {
257-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
258-
// TODO: should not use fmt::Debug on Display
259-
write!(f, "missing outputs: {:?}", self.0)
260-
}
261-
}
262-
263-
#[cfg(feature = "std")]
264-
impl std::error::Error for MissingOutputs {}
265-
266-
/// Occurs when a must-select policy cannot be fulfilled.
267-
#[derive(Debug)]
268-
pub enum PolicyFailure<PF> {
269-
/// Missing outputs.
270-
MissingOutputs(MissingOutputs),
271-
/// Policy failure.
272-
PolicyFailure(PF),
273-
}
274-
275-
impl<PF: fmt::Display> fmt::Display for PolicyFailure<PF> {
276-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
277-
match self {
278-
PolicyFailure::MissingOutputs(err) => write!(f, "{err}"),
279-
PolicyFailure::PolicyFailure(err) => {
280-
write!(f, "policy failure: {err}")
281-
}
282-
}
283-
}
284-
}
285-
286-
#[cfg(feature = "std")]
287-
impl<PF: fmt::Debug + fmt::Display> std::error::Error for PolicyFailure<PF> {}
288-
289243
/// Select for lowest fee with bnb
290244
pub fn selection_algorithm_lowest_fee_bnb(
291245
longterm_feerate: FeeRate,

0 commit comments

Comments
 (0)