20900218ceba728c8051a3c017a6341d74cbaee3 refactor: rename methods in EsploraExt and EsploraExtAsync (Vladimir Fomene)
Pull request description:
### Description
This PR fixes#1058. Built on top of #1040
### 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:
* [ ] I've added tests for the new feature
* [ ] I've added docs for the new feature
ACKs for top commit:
realeinherjar:
ACK 2090021
danielabrozzoni:
ACK 20900218ceba728c8051a3c017a6341d74cbaee3 - code looks good, `example_esplora` and `wallet_esplora_blocking` work just fine.
Tree-SHA512: 5b5285aaa67a0c4e8174e480cceec7d934ec04a74d81740e1c82f6b8673c3e3d9c676dc43257a170320089efe2d3cb0d33123b4a395fc3e7fec63f85bdf70c79
We remove `ElectrumUpdate` and return tuples instead for `ElectrumExt`
methods. We introduce the `IncompleteTxGraph` structure to specifically
hodl the incomplete `TxGraph`.
This change is motivated by @LLFourn's comment: 794bf37e63 (r1305432603)
e48b911c8d23cceab2071cc92085fe6675d55ca9 refactor: Make test errors more readable (Daniela Brozzoni)
a7a1d9b2fb9fda4d86fe17cf90d9c0d46c4d8609 fix: non-wildcard descriptors should return an.. ..spk only if index is equal to 0 (Daniela Brozzoni)
cc1a43c495639f0dbe6da52501cb48f17b8cbbd2 fix: SpkIterator::new_with_range takes wildcards.. ..into account (Daniela Brozzoni)
Pull request description:
### Description
When you pass a non-wildcard descriptor in `new_with_range`, we make
sure that the range length is at most 1; if that's not the case, we
shorten it.
We would previously use `new_with_range` without this check and with a
non-wildcard descriptor in `spks_of_all_keychains`, this meant creating
a spkiterator that would go on producing the same spks over and over
again, causing some issues with syncing on electrum/esplora.
To reproduce the bug, run in `example-crates/example_electrum`:
```
cargo run "sh(wsh(or_d(c:pk_k(cPGudvRLDSgeV4hH9NUofLvYxYBSRjju3cpiXmBg9K8G9k1ikCMp),c:pk_k(cSBSBHRrzqSXFmrBhLkZMzQB9q4P9MnAq92v8d9a5UveBc9sLX32))))#zp9pcfs9" scan
```
### Changelog notice
- Fixed a bug where `KeychainTxOutIndex::spks_of_all_keychains`/`KeychainTxOutIndex::spks_of_keychain` would return an iterator yielding infinite spks even for non-wildcard descriptors.
### 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 e48b911c8d23cceab2071cc92085fe6675d55ca9
Tree-SHA512: 87627505049eadcec979a05888ec0d8a25c4743c03696a7db68348d457c2bf006d9b3b69c99e208f7812fc5b0234dd5a98b4a923c2486615c7678c3ab523f8cf
f41cc1cb374d6bae553dd997ebb325ced21025f0 fix: s/index_tx_graph/indexed_tx_graph/g (LLFourn)
da8cfd39e9733f6da12b0fe10b8ccf5e5894e090 feat: add cli example for `esplora` (志宇)
Pull request description:
### Description
This PR builds on top of #1034 and adds a cli-example for our `esplora` chain-src crate.
### Notes to the reviewers
Don't merge this until #1034 is merged. The only relevant commit is 5ff0412d8edba933760c79a40be29c8365719096.
### Changelog notice
* Add cli-example for `esplora`.
### 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:
~* [ ] I've added tests for the new feature~
* [x] I've added docs for the new feature
ACKs for top commit:
danielabrozzoni:
ACK f41cc1cb374d6bae553dd997ebb325ced21025f0
notmandatory:
ACK f41cc1cb374d6bae553dd997ebb325ced21025f0
Tree-SHA512: a41fa456a9509f75feea0af013deaaad846cc6b60e5e6671672630a716e8c962361cbc9bb2d62c68e96d5fdb9e580912c19ff5fcab1acaf604b5b4a10eb40cee
..into account
When you pass a non-wildcard descriptor in `new_with_range`, we make
sure that the range length is at most 1; if that's not the case, we
shorten it.
We would previously use `new_with_range` without this check and with a
non-wildcard descriptor in `spks_of_all_keychains`, this meant creating
a spkiterator that would go on producing the same spks over and over
again, causing some issues with syncing on electrum/esplora.
To reproduce the bug, run in `example-crates/example_electrum`:
```
cargo run "sh(wsh(or_d(c:pk_k(cPGudvRLDSgeV4hH9NUofLvYxYBSRjju3cpiXmBg9K8G9k1ikCMp),c:pk_k(cSBSBHRrzqSXFmrBhLkZMzQB9q4P9MnAq92v8d9a5UveBc9sLX32))))#zp9pcfs9" scan
```
5fb5061645ae92d37091a215e48e84423fea48a3 ci: fix msrv dependency versions for rustls (Steve Myers)
dd5b8d759954f39baa4523fa10b4a64efe48a25b test(wallet): add check_fee!(wallet,psbt) macro and use it in place of psbt.fee_amount() (Steve Myers)
465d53cc88b32bf8098dc61e9afdbb28d22b213d docs(wallet): update docs for calculate_fee/fee_rate and add_foreign_utxo (Steve Myers)
036299803f9f94c7c8218a75f3c206fa8c4297ab feat(wallet): add Wallet::insert_txout function and updated docs for fee functions (Steve Myers)
d443fe7f6613776a3dce00def0b655c4b2b36728 feat(tx_graph)!: change TxGraph::calculate_fee to return Result<u64,CalculateFeeError> (Steve Myers)
b4c31cd5bad4fea18044aab2cffd657b16ec185b feat(wallet)!: remove TransactionDetails from bdk::Wallet API (Steve Myers)
Pull request description:
### Description
Removed `TransactionDetails` and changed `Wallet::get_tx` to return a `CanonicalTx`, and `TxBuilder::finish` to return only a `PartiallySignedTransaction`. This should fix#922 and fix#1015.
I also added `Wallet` functions to get a `Transaction` send and receive amounts, fee, and `FeeRate`.
see: https://github.com/bitcoindevkit/bdk/issues/922#issuecomment-1652814975
### Notes to the reviewers
Alot of wallet tests had to change since `TxBuilder::finish` only returns a PSBT now.
I added a new `CalculateFeeError` which follows changes coming in #1028.
### Changelog notice
Added
- Wallet::sent_and_received function
- Wallet::calculate_fee and Wallet::calculate_fee_rate functions
- Wallet::error::CalculateFeeError
- Wallet::insert_txout function to allow inserting foreign TxOuts
BREAKING CHANGES:
Removed
- TransactionDetails struct
Changed
- Wallet::get_tx now returns CanonicalTx instead of TransactionDetails
- TxBuilder::finish now returns only a PartiallySignedTransaction
### 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 5fb5061645ae92d37091a215e48e84423fea48a3
Tree-SHA512: 1a0be1c229b8871e5ee23ba6874ff40370170477a0a8bb104c0197e7fd97765d84854285f863dd1b38a34c3b71815e75e4db5b25288c81caea99a14ddaa78254
added
- Wallet::insert_txout function to allow inserting foreign TxOuts
- test to verify error when trying to calculate fee with missing foreign utxo
- test to calculate fee with inserted foreign utxo
updated
- docs for Wallet::calculate_fee, Wallet::calculate_fee_rate, and TxGraph::calculate_fee
with note about missing foreign utxos
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
18e8da393779617e8a501d7e21b0a9db1a8b11f1 docs: Add doctest for Anchor implementation on BlockId (Vladimir Fomene)
480c2730de524cbb19a72d8cc8c41cb73ab556df 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 18e8da393779617e8a501d7e21b0a9db1a8b11f1
Tree-SHA512: af9da8b4e9c7f2a110340efa4e4c86d9b96ea1275f0a66f08e26a47fcacd89e318a32c845e2a4302f3332eeb4c6a976c3771b1d9881adf4feda90d6ba1a2dd9d
21206fe773a6ebb9f12c534ccb0bfbd694684b58 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 21206fe773a6ebb9f12c534ccb0bfbd694684b58
Tree-SHA512: c323d90f16f338a1a678e28aa681b28848d8c5f02fd769dbf165d3a13df7804abed14760cf0dbe2be6194b107b25980b54be4703f36a7db63f6484c244dd3728
2263a58448f5f04a74e076132aea93f21c584bc0 refactor: Rename `wallet_esplora` to... ...`wallet_esplora_blocking` (Daniela Brozzoni)
11ac26f6b28b6694dfc04e9fc72c208e454632c7 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 2263a58448f5f04a74e076132aea93f21c584bc0
evanlinjin:
ACK 2263a58448f5f04a74e076132aea93f21c584bc0
Tree-SHA512: fd0eecb4a1051b8f88ae858ad6231b254beaad50f925d656a307c66bd6a20770cf698032d1d7e0179d93ac169cfa5d8c7c3b8def4c91334afc27f7a6f9d7558a
fa0bead02488d2bcfb9828e61c06a36a3dab70d4 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 fa0bead02488d2bcfb9828e61c06a36a3dab70d4
Tree-SHA512: e8d0f21efef5abd222169bce2294e7de22699bd65e8366cd3e9c08e0858efd9163b4c428375b2a335c0358a0e7c591bd64899ee5c909cd09e0d14bfdda3d3633
2d543475e2d7aa5503199699bb9bb4c0e519d0a8 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 2d543475e2d7aa5503199699bb9bb4c0e519d0a8
Tree-SHA512: 00442adf22258333d7672e8389b2380a8a81219f217bbffd525e253424a2aeeed13dd2316b3fe69d0bbeb13addbf2351697659c2abfec762e8e789fce3bb26e2
4f37b2a293df57cdc7c4bae7d4ae8e0f04dd8032 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 4f37b2a293df57cdc7c4bae7d4ae8e0f04dd8032
Tree-SHA512: 6cc5bdc793d57f8b28d10f70041c1faae686da95182e313c3c854d9d58f003a75a381f2e5ca660c9eb41356937197e9f84bc756695e06b3718e281d3e818af51
62f253103c3fd158ad66a0bba11399e7083226f2 ci: Update tokio version (Daniela Brozzoni)
80f5ecf3be2550808f1bf1870df2504c09395dee feat(chain): Add `initial_changeset` to graphs (Daniela Brozzoni)
ea50b6a932ca492f27ac4aaea93c6b6ba11fa0e8 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 62f253103c3fd158ad66a0bba11399e7083226f2
Tree-SHA512: 401bdf49c5f2082971cfcd54725ce98abd08263de7571205a324a2adbb5359be4f48454def415bedadde0a9c81db437b91c13cd6e892ba54b215059f75006dd5
b0b91b74186575f11a4fba77ffd64005c482740e 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 b0b91b74186575f11a4fba77ffd64005c482740e
Tree-SHA512: d872f427da065c66346f0fd3ae19d4d62c535cf4444d236c0d1f6e9a5e169b7fd7773f643693daa23eeccbe6a3ddad6767f91520c7547360c07febc227a88f06