Added
- Wallet::sent_and_received function
- Wallet::calculate_fee and Wallet::calculate_fee_rate functions
- Wallet::error::CalculateFeeError
BREAKING CHANGES:
Removed
- TransactionDetails struct
Changed
- Wallet::get_tx now returns CanonicalTx instead of TransactionDetails
- TxBuilder::finish now returns only a PartiallySignedTransaction
18e8da3937 docs: Add doctest for Anchor implementation on BlockId (Vladimir Fomene)
480c2730de feat: Implement Anchor for BlockId (Vladimir Fomene)
Pull request description:
### Description
This PR fixes#1062.
It implements the `Anchor` trait on `BlockId`.
### Checklists
#### All Submissions:
* [x] I've signed all my commits
* [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
* [x] I ran `cargo fmt` and `cargo clippy` before committing
#### New Features:
* [x] I've added tests for the new feature
* [x] I've added docs for the new feature
ACKs for top commit:
evanlinjin:
ACK 18e8da3937
Tree-SHA512: af9da8b4e9c7f2a110340efa4e4c86d9b96ea1275f0a66f08e26a47fcacd89e318a32c845e2a4302f3332eeb4c6a976c3771b1d9881adf4feda90d6ba1a2dd9d
21206fe773 fix: Correct the coin type in the derivation path for the three wallet examples (Casey Bowman)
Pull request description:
Corrects the derivation path for the three wallet examples. For testnet, the coin type should be 1 instead of 0.
Replaces #1076
ACKs for top commit:
danielabrozzoni:
ACK 21206fe773
Tree-SHA512: c323d90f16f338a1a678e28aa681b28848d8c5f02fd769dbf165d3a13df7804abed14760cf0dbe2be6194b107b25980b54be4703f36a7db63f6484c244dd3728
2263a58448 refactor: Rename `wallet_esplora` to... ...`wallet_esplora_blocking` (Daniela Brozzoni)
11ac26f6b2 docs: Update README.md (Daniela Brozzoni)
Pull request description:
### Description
- Fixes the release timeline
- Adds an explanation for the crates under `example-crates`
### Checklists
#### All Submissions:
* [x] I've signed all my commits
* [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
* [x] I ran `cargo fmt` and `cargo clippy` before committing
ACKs for top commit:
notmandatory:
ACK 2263a58448
evanlinjin:
ACK 2263a58448
Tree-SHA512: fd0eecb4a1051b8f88ae858ad6231b254beaad50f925d656a307c66bd6a20770cf698032d1d7e0179d93ac169cfa5d8c7c3b8def4c91334afc27f7a6f9d7558a
fa0bead024 ci: Pin rustls-webpki to 0.100.1 (Daniela Brozzoni)
Pull request description:
### Checklists
#### All Submissions:
* [x] I've signed all my commits
* [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
* [x] I ran `cargo fmt` and `cargo clippy` before committing
ACKs for top commit:
notmandatory:
ACK fa0bead024
Tree-SHA512: e8d0f21efef5abd222169bce2294e7de22699bd65e8366cd3e9c08e0858efd9163b4c428375b2a335c0358a0e7c591bd64899ee5c909cd09e0d14bfdda3d3633
2d543475e2 docs: add License and Contributing sections to repo top-level README (Steve Myers)
Pull request description:
### Description
Add explicit "License" and "Contributing" sections to the repo top-level `README.md` file to make it clear that it applies to everything in the project. Also moved license files up to repo top-level directory and did some minor cleanup of bdk/README.md License and Contribution sections to match top-level README.
ACKs for top commit:
danielabrozzoni:
ACK 2d543475e2
Tree-SHA512: 00442adf22258333d7672e8389b2380a8a81219f217bbffd525e253424a2aeeed13dd2316b3fe69d0bbeb13addbf2351697659c2abfec762e8e789fce3bb26e2
4f37b2a293 ci: fix msrv dependency versions for reqest and h2 (Steve Myers)
Pull request description:
### Description
Fix MSRV dependency versions for `reqwest` and`h2`, both latest version now require 1.63.0.
### Notes to the reviewers
- reqwest 0.11.19 has MSRV 1.63.0+, pin to 0.11.18
- h2 0.3.21 has MSRV 1.63.0+, pin to 0.3.20
### Changelog notice
None.
### Checklists
#### All Submissions:
* [x] I've signed all my commits
* [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
* [x] I ran `cargo fmt` and `cargo clippy` before committing
ACKs for top commit:
danielabrozzoni:
ACK 4f37b2a293
Tree-SHA512: 6cc5bdc793d57f8b28d10f70041c1faae686da95182e313c3c854d9d58f003a75a381f2e5ca660c9eb41356937197e9f84bc756695e06b3718e281d3e818af51
62f253103c ci: Update tokio version (Daniela Brozzoni)
80f5ecf3be feat(chain): Add `initial_changeset` to graphs (Daniela Brozzoni)
ea50b6a932 refactor!(chain): Unify ChangeSet nomenclature (Daniela Brozzoni)
Pull request description:
Solves #1022
### Changelog notice
Rename `indexed_tx_graph::IndexedAdditions` to `indexed_tx_graph::ChangeSet`
Rename `indexed_tx_graph::IndexedAdditions::graph_additions` to `indexed_tx_graph::ChangeSet::graph`
Rename `indexed_tx_graph::IndexedAdditions::index_additions` to `indexed_tx_graph::ChangeSet::indexer`
Rename `tx_graph::Additions` to `tx_graph::ChangeSet`
Rename `keychain::DerivationAdditions` to `keychain::ChangeSet`
Rename `CanonicalTx::node` to `CanonicalTx::tx_node`
Rename `CanonicalTx::observed_as` to `CanonicalTx::chain_position`
Rename `LocalChangeSet` to `WalletChangeSet`
Rename `LocalChangeSet::chain_changeset` to `WalletChangeSet::chain`
Rename `LocalChangeSet::indexed_additions` to `WalletChangeSet::indexed_tx_graph`
Rename `LocalUpdate` to `WalletUpdate`
Make `TxGraph::determine_changeset` `pub(crate)`
Add `TxGraph::initial_changeset`
Add `IndexedTxGraph::initial_changeset`
Remove `TxGraph::insert_txout_preview`
Remove `TxGraph::insert_tx_preview`
Remove `insert_anchor_preview`
Remove `insert_seen_at_preview`
### Notes to reviewers
I'm not sure whether we want to keep `TxGraph::determine_changeset` public or not
### Checklists
#### All Submissions:
* [x] I've signed all my commits
* [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
* [x] I ran `cargo fmt` and `cargo clippy` before committing
ACKs for top commit:
evanlinjin:
ACK 62f253103c
Tree-SHA512: 401bdf49c5f2082971cfcd54725ce98abd08263de7571205a324a2adbb5359be4f48454def415bedadde0a9c81db437b91c13cd6e892ba54b215059f75006dd5
b0b91b7418 fix: msrv issues and update coverage toolchain (Vladimir Fomene)
Pull request description:
Fix breaking MSRV for 1.57.0
#### All Submissions:
* [x] I've signed all my commits
* [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
* [x] I ran `cargo fmt` and `cargo clippy` before committing
ACKs for top commit:
danielabrozzoni:
ACK b0b91b7418
Tree-SHA512: d872f427da065c66346f0fd3ae19d4d62c535cf4444d236c0d1f6e9a5e169b7fd7773f643693daa23eeccbe6a3ddad6767f91520c7547360c07febc227a88f06
1da3b304bb ci: Pin rustls to keep the MSRV (Daniela Brozzoni)
792b39fa92 Explicitly deny multipath keys (Daniela Brozzoni)
b73385dbd2 Update wallet_electrum to rust-bitcoin 0.30.0 (Daniela Brozzoni)
3dac3f9bba Update example_electrum to rust-bitcoin 0.30.0 (Daniela Brozzoni)
2949bdc7b8 Update example_cli to rust-bitcoin 0.30.0 (Daniela Brozzoni)
468d2a0a3b Update tmp_plan to rust-bitcoin 0.30.0 (Daniela Brozzoni)
b8ac16d03c Update coin_select to rust-bitcoin 0.30.0 (Daniela Brozzoni)
6c29e53ee8 Update wallet_esplora and wallet_esplora_async to... ...rust-bitcoin 0.30.0 (Daniela Brozzoni)
6eb079576f Update crates/esplora to rust-bitcoin 0.30.0 (Daniela Brozzoni)
91b0f0ba29 Update crates/electrum to bitcoin 0.30.0 (Daniela Brozzoni)
f4e3ba3265 Update bdk to bitcoin 0.30.0 (Daniela Brozzoni)
853d361751 Update bdk_chain to bitcoin 0.30.0 (Daniela Brozzoni)
Pull request description:
### Description
Updates to rust-bitcoin 0.30.0 and miniscript 0.10.0
Not covered in this PR:
- https://github.com/bitcoindevkit/bdk/issues/1036. Although the latter is deprecated, I think it's better if I update it in a separate PR, as this one is pretty big already.
- https://github.com/bitcoindevkit/bdk/issues/1037
- https://github.com/bitcoindevkit/bdk/issues/1038
Heads up, I'm explicitly denying multipath descriptors until we have better tests for them. See the commit message of 23fba7aee9b55bf59db73c296b9fb025a256502e
### Changelog notice
- Update to `rust-bitcoin` 0.30.0 and `miniscript` 10.0.0
### Checklists
#### All Submissions:
* [x] I've signed all my commits
* [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
* [x] I ran `cargo fmt` and `cargo clippy` before committing
ACKs for top commit:
evanlinjin:
ACK 1da3b304bb
Tree-SHA512: ff1457ed711f9f8cdb446ea10aaf124632f539c02406da94317d8dc38013b321217d3bdcb2df4bd72b2ed92116b52e9c6b98ee91d4d508a579c67449a7caa549
Although there is *some* code to handle multipath keys inside bdk,
it's all untested, and from a few quick tests it
seems that it's pretty easy to find buggy edge cases.
Better to deny multipath descs for now, and revisit the
decision once we work on supporting multidescriptor wallets.
b206a985cf fix: Even more refactoring to code and documentation (志宇)
bea8e5aff4 fix: `TxGraph::missing_blocks` logic (志宇)
db15e03bdc fix: improve more docs and more refactoring (志宇)
95312d4d05 fix: docs and some minor refactoring (志宇)
8bf7a997f7 Refactor `debug_assertions` checks for `LocalChain` (志宇)
315e7e0b4b fix: rm duplicate `bdk_tmp_plan` module (志宇)
af705da1a8 Add exclusion of example cli `*.db` files in `.gitignore` (志宇)
eabeb6ccb1 Implement linked-list `LocalChain` and update chain-src crates/examples (志宇)
Pull request description:
Fixes#997
Replaces #1002
### Description
This PR changes the `LocalChain` implementation to have blocks stored as a linked-list. This allows the data-src thread to hold a shared ref to a single checkpoint and have access to the whole history of checkpoints without cloning or keeping a lock on `LocalChain`.
The APIs of `bdk::Wallet`, `esplora` and `electrum` are also updated to reflect these changes. Note that the `esplora` crate is rewritten to anchor txs in the confirmation block (using the esplora API's tx status block_hash). This guarantees 100% consistency between anchor blocks and their transactions (instead of anchoring txs to the latest tip). `ExploraExt` now has separate methods for updating the `TxGraph` and `LocalChain`.
A new method `TxGraph::missing_blocks` is introduced for finding "floating anchors" of a `TxGraph` update (given a chain).
Additional changes:
* `test_local_chain.rs` is refactored to make test cases easier to write. Additional tests are also added.
* Examples are updated.
* Exclude example-cli `*.db` files in `.gitignore`.
* Rm duplicate `bdk_tmp_plan` module.
### Notes to the reviewers
This is the smallest possible division of #1002 without resulting in PRs that do not compile. Since we have changed the API of `LocalChain`, we also need to change `esplora`, `electrum` crates and examples alongside `bdk::Wallet`.
### Changelog notice
* Implement linked-list `LocalChain`. This allows the data-src thread to hold a shared ref to a single checkpoint and have access to the whole history of checkpoints without cloning or keeping a lock on `LocalChain`.
* Rewrote `esplora` chain-src crate to anchor txs to their confirmation blocks (using esplora API's tx-status `block_hash`).
### Checklists
#### All Submissions:
* [x] I've signed all my commits
* [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
* [x] I ran `cargo fmt` and `cargo clippy` before committing
#### New Features:
* [x] I've added tests for the new feature
* [x] I've added docs for the new feature
ACKs for top commit:
LLFourn:
ACK b206a985cf
Tree-SHA512: a513eecb4f1aae6a5c06a69854e4492961424312a75a42d74377d363b364e3d52415bc81b4aa3fbc3f369ded19bddd07ab895130ebba288e8a43e9d6186e9fcc
e17f03e755 docs: add required style for commit messages (Steve Myers)
Pull request description:
### Description
Update CONTRIBUTING.md to specify that new commits should use 'Conventional Commits 1.0' style messages. See https://www.conventionalcommits.org/en/v1.0.0/. I also fixed our current MSRV in the doc and fixed a spelling error.
### Notes to the reviewers
I'm open to suggestions if anyone has another well documented style for commit messages.
### Changelog notice
None.
### Checklists
#### All Submissions:
* [x] I've signed all my commits
* [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
* [x] I ran `cargo fmt` and `cargo clippy` before committing
ACKs for top commit:
thunderbiscuit:
ACK e17f03e755. I've been using conventional commits for Padawan for over 2 years and think it's got good value, particularly on projects with bigger teams and number of contributors.
danielabrozzoni:
ACK e17f03e755 - I was hesitant at first, but I think this would make the commit messages cleaner (and in most cases even shorter). Going forward we should consider adding a CI check enforcing this.
Tree-SHA512: 5f4c42814e35e013ff7846110b2897a35720b8f4b8974f8c8004fc0f5161a10076cac62a7aa711c14295129999f93e238034972f28b77145c1917613f8856b03
Thank you @vladimirfomene for these suggestions.
* Rename `LocalUpdate::keychain` to `LocalUpdate::last_active_indices`.
* Change docs for `CheckPoint` to be more descriptive.
* Fix incorrect logic in `update_local_chain` for `EsploraExt` and
`EsploraAsyncExt`.
Shout out to @LLFourn for these suggestions.
* Improve/fix `LocalChain` documentation
* Refactor `TxGraph::missing_blocks` to make it more explicit that
`last_block` has state.
* `update_local_chain` method of `EsploraExt` and `EsploraAsyncExt` now
returns a `local_chain::Update` instead of just a `CheckPoint`.
This commit changes the `LocalChain` implementation to have blocks
stored as a linked-list. This allows the data-src thread to hold a
shared ref to a single checkpoint and have access to the whole history
of checkpoints without cloning or keeping a lock on `LocalChain`.
The APIs of `bdk::Wallet`, `esplora` and `electrum` are also updated to
reflect these changes. Note that the `esplora` crate is rewritten to
anchor txs in the confirmation block (using the esplora API's tx status
block_hash). This guarantees 100% consistency between anchor blocks and
their transactions (instead of anchoring txs to the latest tip).
`ExploraExt` now has separate methods for updating the `TxGraph` and
`LocalChain`.
A new method `TxGraph::missing_blocks` is introduced for finding
"floating anchors" of a `TxGraph` update (given a chain).
Additional changes:
* `test_local_chain.rs` is refactored to make test cases easier to
write. Additional tests are also added.
* Examples are updated.
* Fix `tempfile` dev dependency of `bdk_file_store` to work with MSRV
Co-authored-by: LLFourn <lloyd.fourn@gmail.com>
ffb7c795e1 ci: Avoid pinning dependencies, use --precise (Daniela Brozzoni)
56b8eea643 ci: No need to add the llvm repository for wasm (Daniela Brozzoni)
Pull request description:
Fixes#1035
### Checklists
#### All Submissions:
* [x] I've signed all my commits
* [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
* [x] I ran `cargo fmt` and `cargo clippy` before committing
ACKs for top commit:
evanlinjin:
ACK ffb7c795e1
Tree-SHA512: a2e5e0ffea87dc86e27c2f2f3550e6e6429e66f5fd8e0196e85915de5b0f14f0e4ee9d56c87b38b101eb28d86a65868054c20421f32ecd475ca73d00471e2f8d
Adding it fails with "The repository'http://apt.llvm.org/focal
llvm-toolchain-focal Release' does not have a Release file.", and for
some reason it's not needed anymore.