]> Untitled Git - bdk/commit
refactor(keychain): Fix KeychainTxOutIndex range queries
authorLLFourn <lloyd.fourn@gmail.com>
Thu, 6 Jun 2024 00:17:55 +0000 (10:17 +1000)
committer志宇 <hello@evanlinjin.me>
Thu, 13 Jun 2024 14:52:43 +0000 (22:52 +0800)
commitbc2a8be97919f0d09b61438527bda24796bcec94
tree4889160d73dcd36b17c06bc30379e5a5f3795c85
parent3b2ff0cc953204c9925ace8e2f0bbef409c63ad5
refactor(keychain): Fix KeychainTxOutIndex range queries

The underlying SpkTxOutIndex should not use DescriptorIds to index
because this loses the ordering relationship of the spks so queries on
subranges of keychains work.

Along with that we enforce that there is a strict 1-to-1 relationship
between descriptors and keychains. Violating this leads to an error in
insert_descriptor now.

In general I try to make the translation layer between the SpkTxOutIndex
and the KeychainTxOutIndex thinner. Ergonomics of this will be improved
in next commit.

The test from the previous commit passes.
12 files changed:
clippy.toml
crates/chain/src/keychain/txout_index.rs
crates/chain/src/spk_client.rs
crates/chain/src/spk_txout_index.rs
crates/chain/tests/test_indexed_tx_graph.rs
crates/chain/tests/test_keychain_txout_index.rs
crates/wallet/src/descriptor/error.rs
crates/wallet/src/wallet/mod.rs
example-crates/example_bitcoind_rpc_polling/src/main.rs
example-crates/example_cli/src/lib.rs
example-crates/example_electrum/src/main.rs
example-crates/example_esplora/src/main.rs