]> Untitled Git - bdk/commit
chain: improvements to `IndexedTxGraph` and `TxGraph` APIs
author志宇 <hello@evanlinjin.me>
Thu, 5 Oct 2023 18:05:31 +0000 (02:05 +0800)
committer志宇 <hello@evanlinjin.me>
Mon, 9 Oct 2023 14:14:04 +0000 (22:14 +0800)
commit4f5695d43add3eab37ab12e897ac7c49f0d0787e
treefd667bcd3a560786519a9e8e00898a92d4ea2629
parent150d6f8ab6cd1eb1c9448d61e7bd71db0dd32a01
chain: improvements to `IndexedTxGraph` and `TxGraph` APIs

For `IndexedTxGraph`:
- Remove `InsertTxItem` type (this is too complex).
    - `batch_insert_relevant` now uses a simple tuple `(&tx, anchors)`.
    - `batch_insert` is now also removed, as the same functionality can be
      done elsewhere.
- Add internal helper method `index_tx_graph_changeset` so we don't need
  to create a seprate `TxGraph` update in each method.
- `batch_insert_<relevant>_unconfirmed` no longer takes in an option of
  last_seen.
- `batch_insert_unconfirmed` no longer takes a reference of a
  transaction (since we apply all transactions anyway, so there is no
  need to clone).

For `TxGraph`:
- Add `batch_insert_unconfirmed` method.
crates/bdk/src/wallet/mod.rs
crates/bitcoind_rpc/tests/test_emitter.rs
crates/chain/src/indexed_tx_graph.rs
crates/chain/src/tx_graph.rs
crates/chain/tests/test_indexed_tx_graph.rs
example-crates/example_bitcoind_rpc_polling/src/main.rs