ref(chain)!: create module indexer

and replace keychain module with `balance.rs`
This commit is contained in:
valued mammal
2024-06-28 09:07:36 -04:00
parent a112b4d97c
commit c3fc1dd123
25 changed files with 133 additions and 136 deletions

View File

@@ -19,10 +19,10 @@ use alloc::{
sync::Arc,
vec::Vec,
};
pub use bdk_chain::keychain::Balance;
pub use bdk_chain::Balance;
use bdk_chain::{
indexed_tx_graph,
keychain::KeychainTxOutIndex,
indexer::keychain_txout::KeychainTxOutIndex,
local_chain::{
self, ApplyHeaderError, CannotConnectError, CheckPoint, CheckPointIter, LocalChain,
},
@@ -112,7 +112,7 @@ pub struct Wallet {
/// An update to [`Wallet`].
///
/// It updates [`bdk_chain::keychain::KeychainTxOutIndex`], [`bdk_chain::TxGraph`] and [`local_chain::LocalChain`] atomically.
/// It updates [`KeychainTxOutIndex`], [`bdk_chain::TxGraph`] and [`local_chain::LocalChain`] atomically.
#[derive(Debug, Clone, Default)]
pub struct Update {
/// Contains the last active derivation indices per keychain (`K`), which is used to update the
@@ -2451,7 +2451,7 @@ fn create_signers<E: IntoWalletDescriptor>(
let _ = index
.insert_descriptor(KeychainKind::Internal, descriptor)
.map_err(|e| {
use bdk_chain::keychain::InsertDescriptorError;
use bdk_chain::indexer::keychain_txout::InsertDescriptorError;
match e {
InsertDescriptorError::DescriptorAlreadyAssigned { .. } => {
crate::descriptor::error::Error::ExternalAndInternalAreTheSame

View File

@@ -1,13 +1,12 @@
#![allow(unused)]
use bdk_chain::indexed_tx_graph::Indexer;
use bdk_chain::{BlockId, ConfirmationTime, ConfirmationTimeHeightAnchor, TxGraph};
use bdk_wallet::wallet::Update;
use bdk_wallet::{KeychainKind, LocalOutput, Wallet};
use bitcoin::hashes::Hash;
use bdk_wallet::{
wallet::{Update, Wallet},
KeychainKind, LocalOutput,
};
use bitcoin::{
transaction, Address, Amount, BlockHash, FeeRate, Network, OutPoint, Transaction, TxIn, TxOut,
Txid,
hashes::Hash, transaction, Address, Amount, BlockHash, FeeRate, Network, OutPoint, Transaction,
TxIn, TxOut, Txid,
};
use std::str::FromStr;