From 3c1e5d4953ae1653d4fb084d27cd4cc1006328b6 Mon Sep 17 00:00:00 2001 From: LLFourn Date: Fri, 25 Aug 2023 14:18:29 +0800 Subject: [PATCH] fix: s/index_tx_graph/indexed_tx_graph/g --- crates/bdk/src/wallet/mod.rs | 2 +- crates/chain/src/keychain.rs | 12 ++++++------ example-crates/example_electrum/src/main.rs | 6 +++--- example-crates/example_esplora/src/main.rs | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/crates/bdk/src/wallet/mod.rs b/crates/bdk/src/wallet/mod.rs index 7a72ce4ab4..f7bc5f49b9 100644 --- a/crates/bdk/src/wallet/mod.rs +++ b/crates/bdk/src/wallet/mod.rs @@ -248,7 +248,7 @@ impl Wallet { 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); diff --git a/crates/chain/src/keychain.rs b/crates/chain/src/keychain.rs index 64d68d81e9..3a6cddf80f 100644 --- a/crates/chain/src/keychain.rs +++ b/crates/chain/src/keychain.rs @@ -133,14 +133,14 @@ pub struct WalletChangeSet { /// ChangeSet to [`IndexedTxGraph`]. /// /// [`IndexedTxGraph`]: crate::indexed_tx_graph::IndexedTxGraph - pub index_tx_graph: indexed_tx_graph::ChangeSet>, + pub indexed_tx_graph: indexed_tx_graph::ChangeSet>, } impl Default for WalletChangeSet { fn default() -> Self { Self { chain: Default::default(), - index_tx_graph: Default::default(), + indexed_tx_graph: Default::default(), } } } @@ -148,11 +148,11 @@ impl Default for WalletChangeSet { impl Append for WalletChangeSet { 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() } } @@ -166,9 +166,9 @@ impl From for WalletChangeSet { } impl From>> for WalletChangeSet { - fn from(index_tx_graph: indexed_tx_graph::ChangeSet>) -> Self { + fn from(indexed_tx_graph: indexed_tx_graph::ChangeSet>) -> Self { Self { - index_tx_graph, + indexed_tx_graph, ..Default::default() } } diff --git a/example-crates/example_electrum/src/main.rs b/example-crates/example_electrum/src/main.rs index 2a5c1310c0..4c5fde6a33 100644 --- a/example-crates/example_electrum/src/main.rs +++ b/example-crates/example_electrum/src/main.rs @@ -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 }); @@ -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::::default(); let (_, indexer) = graph @@ -292,7 +292,7 @@ fn main() -> anyhow::Result<()> { }; ChangeSet { - index_tx_graph, + indexed_tx_graph, chain, } }; diff --git a/example-crates/example_esplora/src/main.rs b/example-crates/example_esplora/src/main.rs index 56ea42d5cf..f33125be8e 100644 --- a/example-crates/example_esplora/src/main.rs +++ b/example-crates/example_esplora/src/main.rs @@ -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({