]> Untitled Git - bdk/commitdiff
remove duplicate `is_empty` from DerivationAdditions
authorVladimir Fomene <vladimirfomene@gmail.com>
Fri, 14 Jul 2023 14:52:08 +0000 (17:52 +0300)
committerVladimir Fomene <vladimirfomene@gmail.com>
Fri, 14 Jul 2023 14:52:08 +0000 (17:52 +0300)
crates/chain/src/keychain.rs
crates/chain/tests/test_keychain_txout_index.rs

index f9b2436f291724d274b1f9327435f3c7ac10b893..2362c2c424d37928182fa127b0ee09778ab6be36 100644 (file)
@@ -46,11 +46,6 @@ pub use txout_index::*;
 pub struct DerivationAdditions<K>(pub BTreeMap<K, u32>);
 
 impl<K> DerivationAdditions<K> {
-    /// Returns whether the additions are empty.
-    pub fn is_empty(&self) -> bool {
-        self.0.is_empty()
-    }
-
     /// Get the inner map of the keychain to its new derivation index.
     pub fn as_inner(&self) -> &BTreeMap<K, u32> {
         &self.0
@@ -72,6 +67,7 @@ impl<K: Ord> Append for DerivationAdditions<K> {
         self.0.append(&mut other.0);
     }
 
+    /// Returns whether the additions are empty.
     fn is_empty(&self) -> bool {
         self.0.is_empty()
     }
index 5f586584cb7d8b263a548768a8639c804efd4df5..a92e74486dab2f16bf19ccdd9ac359545492e8d6 100644 (file)
@@ -5,6 +5,7 @@ mod common;
 use bdk_chain::{
     collections::BTreeMap,
     keychain::{DerivationAdditions, KeychainTxOutIndex},
+    Append,
 };
 
 use bitcoin::{secp256k1::Secp256k1, OutPoint, Script, Transaction, TxOut};