Skip to content

Commit

Permalink
fix: s/index_tx_graph/indexed_tx_graph/g
Browse files Browse the repository at this point in the history
  • Loading branch information
LLFourn committed Aug 25, 2023
1 parent 45cbe6b commit edd3744
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion crates/bdk/src/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ impl<D> Wallet<D> {

let changeset = db.load_from_persistence().map_err(NewError::Persist)?;
chain.apply_changeset(&changeset.chain);
indexed_graph.apply_changeset(changeset.index_tx_graph);
indexed_graph.apply_changeset(changeset.indexed_tx_graph);

let persist = Persist::new(db);

Expand Down
12 changes: 6 additions & 6 deletions crates/chain/src/keychain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,26 +133,26 @@ pub struct WalletChangeSet<K, A> {
/// ChangeSet to [`IndexedTxGraph`].
///
/// [`IndexedTxGraph`]: crate::indexed_tx_graph::IndexedTxGraph
pub index_tx_graph: indexed_tx_graph::ChangeSet<A, ChangeSet<K>>,
pub indexed_tx_graph: indexed_tx_graph::ChangeSet<A, ChangeSet<K>>,
}

impl<K, A> Default for WalletChangeSet<K, A> {
fn default() -> Self {
Self {
chain: Default::default(),
index_tx_graph: Default::default(),
indexed_tx_graph: Default::default(),
}
}
}

impl<K: Ord, A: Anchor> Append for WalletChangeSet<K, A> {
fn append(&mut self, other: Self) {
Append::append(&mut self.chain, other.chain);
Append::append(&mut self.index_tx_graph, other.index_tx_graph);
Append::append(&mut self.indexed_tx_graph, other.indexed_tx_graph);
}

fn is_empty(&self) -> bool {
self.chain.is_empty() && self.index_tx_graph.is_empty()
self.chain.is_empty() && self.indexed_tx_graph.is_empty()
}
}

Expand All @@ -166,9 +166,9 @@ impl<K, A> From<local_chain::ChangeSet> for WalletChangeSet<K, A> {
}

impl<K, A> From<indexed_tx_graph::ChangeSet<A, ChangeSet<K>>> for WalletChangeSet<K, A> {
fn from(index_tx_graph: indexed_tx_graph::ChangeSet<A, ChangeSet<K>>) -> Self {
fn from(indexed_tx_graph: indexed_tx_graph::ChangeSet<A, ChangeSet<K>>) -> Self {
Self {
index_tx_graph,
indexed_tx_graph,
..Default::default()
}
}
Expand Down
6 changes: 3 additions & 3 deletions example-crates/example_electrum/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fn main() -> anyhow::Result<()> {

let graph = Mutex::new({
let mut graph = IndexedTxGraph::new(index);
graph.apply_changeset(init_changeset.index_tx_graph);
graph.apply_changeset(init_changeset.indexed_tx_graph);
graph
});

Expand Down Expand Up @@ -277,7 +277,7 @@ fn main() -> anyhow::Result<()> {

let chain = chain.apply_update(final_update.chain)?;

let index_tx_graph = {
let indexed_tx_graph = {
let mut changeset =
indexed_tx_graph::ChangeSet::<ConfirmationHeightAnchor, _>::default();
let (_, indexer) = graph
Expand All @@ -292,7 +292,7 @@ fn main() -> anyhow::Result<()> {
};

ChangeSet {
index_tx_graph,
indexed_tx_graph,
chain,
}
};
Expand Down
4 changes: 2 additions & 2 deletions example-crates/example_esplora/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ fn main() -> anyhow::Result<()> {
// aren't strictly needed here.
let graph = Mutex::new({
let mut graph = IndexedTxGraph::new(index);
graph.apply_changeset(init_changeset.index_tx_graph);
graph.apply_changeset(init_changeset.indexed_tx_graph);
graph
});
let chain = Mutex::new({
Expand Down Expand Up @@ -309,7 +309,7 @@ fn main() -> anyhow::Result<()> {
let (missing_block_heights, tip) = {
let chain = &*chain.lock().unwrap();
let heights_to_fetch = changeset
.index_tx_graph
.indexed_tx_graph
.graph
.anchors
.iter()
Expand Down

0 comments on commit edd3744

Please sign in to comment.