Skip to content

Commit

Permalink
Merge bitcoindevkit#1031: remove duplicate is_empty
Browse files Browse the repository at this point in the history
f5074ee remove duplicate `is_empty` from DerivationAdditions (Vladimir Fomene)

Pull request description:

  Duplicate `is_empty` method

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

ACKs for top commit:
  danielabrozzoni:
    ACK f5074ee

Tree-SHA512: 1cb48d25c9e57dbe444646ebc33c838e3d58c2523d74b58a75f0d085f68d070ec6a644c46e0bccb8765af7167c8359f079a6222fc9d17ae28ce1e6dda820fc84
  • Loading branch information
danielabrozzoni committed Jul 24, 2023
2 parents f4d2a76 + f5074ee commit cb626e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions crates/chain/src/keychain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
}
Expand Down
1 change: 1 addition & 0 deletions crates/chain/tests/test_keychain_txout_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mod common;
use bdk_chain::{
collections::BTreeMap,
keychain::{DerivationAdditions, KeychainTxOutIndex},
Append,
};

use bitcoin::{secp256k1::Secp256k1, OutPoint, Script, Transaction, TxOut};
Expand Down

0 comments on commit cb626e9

Please sign in to comment.