]> Untitled Git - bdk/commit
Remove Blockchain from wallet
authorLLFourn <lloyd.fourn@gmail.com>
Wed, 26 Jan 2022 04:17:48 +0000 (15:17 +1100)
committerLLFourn <lloyd.fourn@gmail.com>
Thu, 24 Feb 2022 09:39:00 +0000 (20:39 +1100)
commit326bfe82a89eaa79acf90c34442234c7e53e1caf
tree8450951eaf8e1b189fe47945f4186593a2470f86
parentb23a0747b5152bda9adcbb9e90108bfe09d2ba7a
Remove Blockchain from wallet

Although somewhat convenient to have, coupling the Wallet with
the blockchain trait causes development friction and complexity.
What if sometimes the wallet is "offline" (no access to the blockchain)
but sometimes its online?
The only thing the Wallet needs the blockchain for is to sync.
But not all applications will even use the sync method and the sync
method doesn't require the full blockchain functionality.
So we instead pass the blockchain in when we want to sync.

- To further reduce the coupling with blockchain I removed the get_height call from `new` and just use the height of the
last sync in the database.
- I split up the blockchain trait a bit into subtraits.
22 files changed:
CHANGELOG.md
README.md
examples/address_validator.rs
examples/compact_filters_balance.rs
examples/compiler.rs
src/blockchain/any.rs
src/blockchain/compact_filters/mod.rs
src/blockchain/electrum.rs
src/blockchain/esplora/reqwest.rs
src/blockchain/esplora/ureq.rs
src/blockchain/mod.rs
src/blockchain/rpc.rs
src/database/any.rs
src/database/memory.rs
src/descriptor/template.rs
src/lib.rs
src/testutils/blockchain_tests.rs
src/wallet/address_validator.rs
src/wallet/export.rs
src/wallet/mod.rs
src/wallet/signer.rs
src/wallet/tx_builder.rs