]> Untitled Git - bdk/log
bdk
2 years agofix(chain): TxDescendants performs a BFS
Daniela Brozzoni [Fri, 29 Sep 2023 16:42:49 +0000 (18:42 +0200)]
fix(chain): TxDescendants performs a BFS

This commit also changes test_descendants_no_repeat to check
the order of the transactions returned

2 years agodoc(chain): Fix typos
Daniela Brozzoni [Fri, 29 Sep 2023 13:48:42 +0000 (15:48 +0200)]
doc(chain): Fix typos

Co-authored-by: Wei Chen <wzc110@gmail.com>
2 years agoMerge bitcoindevkit/bdk#1137: fix: Add the pinning of time/cc in README
Steve Myers [Tue, 3 Oct 2023 00:20:52 +0000 (19:20 -0500)]
Merge bitcoindevkit/bdk#1137: fix: Add the pinning of time/cc in README

f28e665c7dd1d929f0b4f80a79caecafaf4b385e ci: update code_coverage workflow to use rust stable version (Steve Myers)
edfd4c236d76c91b3599c333ae8456ed4f577064 fix: Add the pinning of time/cc in README (Daniela Brozzoni)

Pull request description:

  Should have been in #1135, sorry.

  ### 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 f28e665c7dd1d929f0b4f80a79caecafaf4b385e

Tree-SHA512: e1c2c05f436da1fd59b9988628318c0563b2dbe85a5f4fb8aef4c35d7601c441a542e8a2c3591c02f3a05ad9456cfc2d3f5e8605064498a56a39766f5bcbc2e1

2 years agoci: update code_coverage workflow to use rust stable version
Steve Myers [Sat, 30 Sep 2023 22:56:34 +0000 (17:56 -0500)]
ci: update code_coverage workflow to use rust stable version

2 years agoMerge bitcoindevkit/bdk#1132: fix: bump electrum version to 0.18
Daniela Brozzoni [Fri, 29 Sep 2023 13:27:40 +0000 (15:27 +0200)]
Merge bitcoindevkit/bdk#1132: fix: bump electrum version to 0.18

fe654310d7e46a0e05c8282bd7804ac0d5203816 fix: bump electrum version to 0.18 (sjeohp)

Pull request description:

  Fixes https://github.com/bitcoindevkit/bdk/issues/1123

ACKs for top commit:
  danielabrozzoni:
    ACK fe654310d7e46a0e05c8282bd7804ac0d5203816

Tree-SHA512: 184b82ba13c76c7e4fe14dcf1f30ee19345618ecf7f8eeb859963067eafa6c21dd79d90b36a44cd2cb50d4002623c4811789f8dbed9445272114b72b35461f8c

2 years agofix: Add the pinning of time/cc in README
Daniela Brozzoni [Fri, 29 Sep 2023 13:20:45 +0000 (15:20 +0200)]
fix: Add the pinning of time/cc in README

Should have been in #1135, sorry.

2 years agofix: bump electrum version to 0.18
sjeohp [Thu, 28 Sep 2023 16:49:19 +0000 (10:49 -0600)]
fix: bump electrum version to 0.18

2 years agoMerge bitcoindevkit/bdk#1135: ci: Pin time, cc in order to keep MSRV
Steve Myers [Thu, 28 Sep 2023 14:40:22 +0000 (09:40 -0500)]
Merge bitcoindevkit/bdk#1135: ci: Pin time, cc in order to keep MSRV

ea6411c6850eef4f6c171b3035b3d70a8b2a9dc5 ci: Pin time, cc in order to keep MSRV (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 ea6411c6850eef4f6c171b3035b3d70a8b2a9dc5

Tree-SHA512: e2400bd4a1583db8503efa05279f1d97b136dfbe63ae92bc33817fa6763f7f3b8789acf9aef0f36bb8a0486539637eaa101f638d223354d3c6193f2ab2ebdfdb

2 years agoci: Pin time, cc in order to keep MSRV
Daniela Brozzoni [Thu, 28 Sep 2023 11:03:47 +0000 (13:03 +0200)]
ci: Pin time, cc in order to keep MSRV

2 years agoMerge bitcoindevkit/bdk#1110: fix(esplora): use saturating_add in update_tx_graph()
Steve Myers [Tue, 26 Sep 2023 14:56:56 +0000 (09:56 -0500)]
Merge bitcoindevkit/bdk#1110: fix(esplora): use saturating_add in update_tx_graph()

bf9a4258496ef91bec4d15126d6e98a2450533ea ci: fix MSRV build by pinning tokio-util to 0.7.8 (Steve Myers)
d35668e76aa3ba429041305e54106c10429a8b1b ci(esplora): fix wasm cargo check by setting workspace resolver to version 2 (Steve Myers)
31d52e12c93469dc6af9a88eba42ad87315dd63b ci: fix msrv dependency versions for rustls-webpki and zip (Steve Myers)
6a5c9d7a00bfddbdf6bd279d003fefe3958dccc1 fix(esplora): use saturating_add in update_tx_graph() (Steve Myers)
4d1a9fd47ab61e1cba2d01fe1191df8c0064c767 test(esplora): add async_ext and blocking_ext integration tests (Steve Myers)

Pull request description:

  ### Description

  This fixes overflow error when calling update_tx_graph() from update_tx_graph_without_keychain().

  ### Notes to the reviewers

  You can reproduce the error by reverting 66a2bf5ef2a70f8de41941d2f07bec776d152b96.

  The tests could use some cleanup but get the job done for this PR.

  ### 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

  #### Bugfixes:

  * [ ] This pull request breaks the existing API
  * [x] I've added tests to reproduce the issue which are now passing
  * [ ] I'm linking the issue being fixed by this PR

Top commit has no ACKs.

Tree-SHA512: eace00e0c289a7ac161985c4b8e46ad660ec0d6777cd74027ef1f0ab245daea87e34258233281796efb60473cf4f18d2647c090a14c0f05f3dc8a1950ebe9dab

2 years agoci: fix MSRV build by pinning tokio-util to 0.7.8
Steve Myers [Tue, 26 Sep 2023 02:08:52 +0000 (21:08 -0500)]
ci: fix MSRV build by pinning tokio-util to 0.7.8

2 years agoci(esplora): fix wasm cargo check by setting workspace resolver to version 2
Steve Myers [Thu, 14 Sep 2023 19:39:20 +0000 (14:39 -0500)]
ci(esplora): fix wasm cargo check by setting workspace resolver to version 2

The resolver version must be set at the workspace level.
See: https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#cargos-new-feature-resolver

2 years agoci: fix msrv dependency versions for rustls-webpki and zip
Steve Myers [Mon, 4 Sep 2023 06:01:04 +0000 (01:01 -0500)]
ci: fix msrv dependency versions for rustls-webpki and zip

2 years agofix(esplora): use saturating_add in update_tx_graph()
Steve Myers [Mon, 4 Sep 2023 05:25:38 +0000 (00:25 -0500)]
fix(esplora): use saturating_add in update_tx_graph()

This fixes overflow error when calling update_tx_graph() from update_tx_graph_without_keychain().

2 years agotest(esplora): add async_ext and blocking_ext integration tests
Steve Myers [Mon, 4 Sep 2023 05:20:45 +0000 (00:20 -0500)]
test(esplora): add async_ext and blocking_ext integration tests

2 years agoMerge bitcoindevkit/bdk#969: Update documentation for fee_rate and fee_absolute metho...
Daniela Brozzoni [Tue, 19 Sep 2023 13:04:57 +0000 (15:04 +0200)]
Merge bitcoindevkit/bdk#969: Update documentation for fee_rate and fee_absolute methods in tx_builder.rs

e6519e3a52a1ab8023b5fdf423d8f748a3b0260d Enhance the documentation for the fee_rate and fee_absolute methods. (Jon Marrs)

Pull request description:

  ### Description

  This pr helps solve this issue: https://github.com/bitcoindevkit/bdk/issues/856

  I added documentation to the fee_rate() method to describe the units as either satoshis/vbyte (sats/vbyte) or satoshis/kwu (sats/kwu), depending on the FeeRate type.

  I also added documentation to the fee_absolute() method to clarify that the fee is determined by whichever method (fee_rate or fee_absolute) was called last, as the FeePolicy is an enum, and FeeRate/FeeAmount are mutually exclusive.

  ### Notes to the reviewers

  I thought it would be helpful to provide documentation to alleviate confusion over the fee_rate method and the fee_absolute method.

  ### 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)

  #### Bugfixes:

  * [x] I'm linking the issue being fixed by this PR

ACKs for top commit:
  danielabrozzoni:
    ACK e6519e3a52a1ab8023b5fdf423d8f748a3b0260d

Tree-SHA512: 59f62d1d1f8355e6353c6a2550e464732975c86c767648adc9143f2b3a9b894a90536a30a33e9de7efbe53f16392ec2e19008d884fb65ef037edae64a3cb6970

2 years agoEnhance the documentation for the fee_rate and fee_absolute methods.
Jon Marrs [Sat, 16 Sep 2023 16:39:49 +0000 (09:39 -0700)]
Enhance the documentation for the fee_rate and fee_absolute methods.

Signed-off-by: Jon Marrs <jdmarrs@gmail.com>
2 years agoMerge bitcoindevkit/bdk#1086: docs: fix spelling errors
Daniela Brozzoni [Mon, 18 Sep 2023 08:12:50 +0000 (10:12 +0200)]
Merge bitcoindevkit/bdk#1086: docs: fix spelling errors

94f8fa530b34ae1c099db3df070000121e8283cf docs: fix spelling errors (Steve Myers)

Pull request description:

  ### Description

  I did a global spell check and found and fixed a few spelling errors.

  ### Notes to the reviewers

  This is low priority but want to make sure it's done before we do a beta release.

  ### 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:
  realeinherjar:
    ACK 94f8fa5
  evanlinjin:
    ACK 94f8fa530b34ae1c099db3df070000121e8283cf

Tree-SHA512: eed0be31264c45d8ef4d6b77e30927591014a76d71696f324440989e77b488d6bf018002d6df2354575b25e5a50d49bca6592976a310e6de7009e44d6b35518d

2 years agodocs: fix spelling errors
Steve Myers [Mon, 21 Aug 2023 20:01:08 +0000 (15:01 -0500)]
docs: fix spelling errors

2 years agoMerge bitcoindevkit/bdk#1084: Enhance bdk chain structures
志宇 [Fri, 15 Sep 2023 01:24:05 +0000 (09:24 +0800)]
Merge bitcoindevkit/bdk#1084: Enhance bdk chain structures

1ff806c67f4da9ba58b7c7689fde0fe41a34a6f5 fix(chain)!: rm weird `From` impl (志宇)
d43ae0231fa4670b98780cad84466c14ae087292 refactor: improve docs, cleanup unnecessary types and improve code (Vladimir Fomene)
41042069809e3eeb4a8cc8a5a8db1af2c57c4a11 feat: impl Append for lots of tuples (LLFourn)
c56728ff1315e0deaf256af07fd1ff5e18fced8a refactor: Remove `scan` and `scan_txout` from SpkTxoutIndex and KeychainTxoutIndex (Vladimir Fomene)
32c40ac939bc514ac7f1d3f1d7cd1080011e20ba feat(electrum)!: change signature of `ElectrumExt` (志宇)
a28748c33976312b9e6671636ab7e305323efb03 refactor: Implement Default for WalletUpdate (Vladimir Fomene)
f42f8b8ff19c2e67888b476487e4e5c9edb0d0ff refactor: Allow for no chain update (Vladimir Fomene)
68572bfd2e32efdeefaa46618e8e248d3a87f143 refactor: move WalletChangeset to wallet module (Vladimir Fomene)
2392e50fd9793902d480556caa4ec225085c82d6 refactor: Move WalletUpdate to wallet module (Vladimir Fomene)
7c12dc994242bf2d7e35c2723f6e7000de97a388 refactor: Remove ForEachTxout trait (Vladimir Fomene)
6bcbb93233824ec391689191b8ca1f5459cec930 refactor: Edit ElectrumExt not to use WalletUpdate (Vladimir Fomene)

Pull request description:

  ### Description

  Fixes #1061

  ### Changelog notice

  - Move WalletUpdate to the wallet module
  - Remove ForEachTxout trait completely
  - Refactor ElectrumExt to not use WalletUpdate.

  ### 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 1ff806c67f4da9ba58b7c7689fde0fe41a34a6f5

Tree-SHA512: 05349713af9d2efa14a522ceaabb7513bb437d786adf2f93055765589a67e4eb68bda36ff415aeba07816c4d30988d4d55bac018e7697019270a219105ed65a2

2 years agofix(chain)!: rm weird `From` impl
志宇 [Thu, 14 Sep 2023 12:14:42 +0000 (20:14 +0800)]
fix(chain)!: rm weird `From` impl

And signature of `example_cli::KeychainChangeSet` is changed.

2 years agorefactor: improve docs, cleanup unnecessary types and improve code
Vladimir Fomene [Wed, 6 Sep 2023 06:47:45 +0000 (09:47 +0300)]
refactor: improve docs, cleanup unnecessary types and improve code

2 years agoMerge bitcoindevkit/bdk#1070: Rename methods of esplora ext
Daniela Brozzoni [Tue, 12 Sep 2023 14:35:23 +0000 (16:35 +0200)]
Merge bitcoindevkit/bdk#1070: Rename methods of esplora ext

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

2 years agorefactor: rename methods in EsploraExt and EsploraExtAsync
Vladimir Fomene [Wed, 9 Aug 2023 09:42:04 +0000 (12:42 +0300)]
refactor: rename methods in EsploraExt and EsploraExtAsync

2 years agofeat: impl Append for lots of tuples
LLFourn [Mon, 4 Sep 2023 23:53:50 +0000 (07:53 +0800)]
feat: impl Append for lots of tuples

2 years agorefactor: Remove `scan` and `scan_txout` from SpkTxoutIndex and KeychainTxoutIndex
Vladimir Fomene [Fri, 25 Aug 2023 09:52:09 +0000 (12:52 +0300)]
refactor: Remove `scan` and `scan_txout` from SpkTxoutIndex and KeychainTxoutIndex

2 years agofeat(electrum)!: change signature of `ElectrumExt`
志宇 [Sat, 26 Aug 2023 12:29:46 +0000 (20:29 +0800)]
feat(electrum)!: change signature of `ElectrumExt`

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: https://github.com/bitcoindevkit/bdk/pull/1084/commits/794bf37e637d3266b75827678f015e14f827d318#r1305432603

2 years agorefactor: Implement Default for WalletUpdate
Vladimir Fomene [Fri, 25 Aug 2023 09:49:29 +0000 (12:49 +0300)]
refactor: Implement Default for WalletUpdate

2 years agorefactor: Allow for no chain update
Vladimir Fomene [Thu, 24 Aug 2023 13:03:47 +0000 (16:03 +0300)]
refactor: Allow for no chain update

2 years agorefactor: move WalletChangeset to wallet module
Vladimir Fomene [Mon, 21 Aug 2023 12:18:16 +0000 (15:18 +0300)]
refactor: move WalletChangeset to wallet module

Consequently, remove the `WalletChangeset` dependency from
`example_electrum` and `example_esplora` examples.

2 years agorefactor: Move WalletUpdate to wallet module
Vladimir Fomene [Mon, 21 Aug 2023 09:13:58 +0000 (12:13 +0300)]
refactor: Move WalletUpdate to wallet module

2 years agorefactor: Remove ForEachTxout trait
Vladimir Fomene [Mon, 21 Aug 2023 08:45:42 +0000 (11:45 +0300)]
refactor: Remove ForEachTxout trait

2 years agorefactor: Edit ElectrumExt not to use WalletUpdate
Vladimir Fomene [Mon, 21 Aug 2023 08:20:38 +0000 (11:20 +0300)]
refactor: Edit ElectrumExt not to use WalletUpdate

2 years agoMerge bitcoindevkit/bdk#1093: fix: spks_of_all_keychains() shouldn't return an infini...
志宇 [Fri, 1 Sep 2023 07:47:40 +0000 (15:47 +0800)]
Merge bitcoindevkit/bdk#1093: fix: spks_of_all_keychains() shouldn't return an infinite iterator for non-wildcard descriptors

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

2 years agorefactor: Make test errors more readable
Daniela Brozzoni [Fri, 1 Sep 2023 07:13:33 +0000 (09:13 +0200)]
refactor: Make test errors more readable

2 years agofix: non-wildcard descriptors should return an..
Daniela Brozzoni [Thu, 31 Aug 2023 15:48:56 +0000 (17:48 +0200)]
fix: non-wildcard descriptors should return an..
..spk only if index is equal to 0

2 years agoMerge bitcoindevkit/bdk#1040: Add cli esplora example
Steve Myers [Thu, 31 Aug 2023 20:26:17 +0000 (15:26 -0500)]
Merge bitcoindevkit/bdk#1040: Add cli esplora example

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

2 years agofix: SpkIterator::new_with_range takes wildcards..
Daniela Brozzoni [Thu, 24 Aug 2023 14:53:50 +0000 (16:53 +0200)]
fix: SpkIterator::new_with_range takes wildcards..
..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
```

2 years agofix: s/index_tx_graph/indexed_tx_graph/g
LLFourn [Fri, 25 Aug 2023 06:18:29 +0000 (14:18 +0800)]
fix: s/index_tx_graph/indexed_tx_graph/g

2 years agofeat: add cli example for `esplora`
志宇 [Thu, 20 Jul 2023 00:29:12 +0000 (08:29 +0800)]
feat: add cli example for `esplora`

Co-authored-by: remix <remix7531@pm.me>
Co-authored-by: LLFourn <lloyd.fourn@gmail.com>
Co-authored-by: Daniela Brozzoni <danielabrozzoni@protonmail.com>
2 years agoMerge bitcoindevkit/bdk#1048: Remove TransactionDetails from Wallet API
志宇 [Thu, 31 Aug 2023 05:29:01 +0000 (13:29 +0800)]
Merge bitcoindevkit/bdk#1048: Remove TransactionDetails from Wallet API

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

2 years agoci: fix msrv dependency versions for rustls
Steve Myers [Wed, 30 Aug 2023 17:12:33 +0000 (12:12 -0500)]
ci: fix msrv dependency versions for rustls

2 years agotest(wallet): add check_fee!(wallet,psbt) macro and use it in place of psbt.fee_amount()
Steve Myers [Thu, 24 Aug 2023 14:52:31 +0000 (09:52 -0500)]
test(wallet): add check_fee!(wallet,psbt) macro and use it in place of psbt.fee_amount()

- removed test_calculate_fee_with_inserted_foreign_utxo() since it now duplicates test in test_add_foreign_utxo()

2 years agodocs(wallet): update docs for calculate_fee/fee_rate and add_foreign_utxo
Steve Myers [Thu, 24 Aug 2023 02:41:38 +0000 (21:41 -0500)]
docs(wallet): update docs for calculate_fee/fee_rate and add_foreign_utxo

2 years agofeat(wallet): add Wallet::insert_txout function and updated docs for fee functions
Steve Myers [Mon, 7 Aug 2023 04:05:41 +0000 (23:05 -0500)]
feat(wallet): add Wallet::insert_txout function and updated docs for fee functions

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

2 years agofeat(tx_graph)!: change TxGraph::calculate_fee to return Result<u64,CalculateFeeError>
Steve Myers [Tue, 1 Aug 2023 17:42:37 +0000 (12:42 -0500)]
feat(tx_graph)!: change TxGraph::calculate_fee to return Result<u64,CalculateFeeError>

added
- tx_graph::CalculateFeeError enum

BREAKING CHANGES:

changed
- TxGraph::calculate_fee function to return Result<u64,CalculateFeeError> instead of Option<i64>

2 years agofeat(wallet)!: remove TransactionDetails from bdk::Wallet API
Steve Myers [Thu, 27 Jul 2023 00:46:40 +0000 (19:46 -0500)]
feat(wallet)!: remove TransactionDetails from bdk::Wallet API

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

2 years agoMerge bitcoindevkit/bdk#1069: Implement Anchor for BlockId
志宇 [Mon, 28 Aug 2023 15:50:26 +0000 (23:50 +0800)]
Merge bitcoindevkit/bdk#1069: Implement Anchor for BlockId

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

2 years agodocs: Add doctest for Anchor implementation on BlockId
Vladimir Fomene [Wed, 16 Aug 2023 08:30:33 +0000 (11:30 +0300)]
docs: Add doctest for Anchor implementation on BlockId

2 years agoMerge bitcoindevkit/bdk#1089: fix: Correct the coin type in the derivation path for...
Daniela Brozzoni [Fri, 25 Aug 2023 12:43:43 +0000 (14:43 +0200)]
Merge bitcoindevkit/bdk#1089: fix: Correct the coin type in the derivation path for wallet examples

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

2 years agofix: Correct the coin type in the derivation path for the three wallet examples
Casey Bowman [Mon, 21 Aug 2023 21:51:12 +0000 (16:51 -0500)]
fix: Correct the coin type in the derivation path for the three wallet examples

fix: Correct the coin type in the derivation path for the three wallet examples

2 years agoMerge bitcoindevkit/bdk#1092: Use `apply_update` instead of `determine_changeset...
志宇 [Fri, 25 Aug 2023 07:21:27 +0000 (15:21 +0800)]
Merge bitcoindevkit/bdk#1092: Use `apply_update` instead of `determine_changeset` + `apply_changeset` around the code

c753584379185b0bd19d130ca39e44c8a6a65e65 refactor(chain): use `apply_update` instead of `determine_changeset` + `apply_changeset` (Wei Chen)

Pull request description:

  This PR implements #1081

ACKs for top commit:
  evanlinjin:
    ACK c753584379185b0bd19d130ca39e44c8a6a65e65

Tree-SHA512: cfb66a427dd76b8d11e07be24de9ba06958cda114b8eec260d492d30fba5a1cecbee2bb3e83b8636f9049eb8e920ad13aa76651a97a01290f53b0c7da8849b41

2 years agorefactor(chain): use `apply_update` instead of `determine_changeset` + `apply_changeset`
Wei Chen [Thu, 24 Aug 2023 12:25:14 +0000 (20:25 +0800)]
refactor(chain): use `apply_update` instead of `determine_changeset` + `apply_changeset`

2 years agoMerge bitcoindevkit/bdk#1085: docs: Update README.md
志宇 [Thu, 24 Aug 2023 12:26:33 +0000 (20:26 +0800)]
Merge bitcoindevkit/bdk#1085: docs: Update README.md

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

2 years agorefactor: Rename `wallet_esplora` to...
Daniela Brozzoni [Tue, 22 Aug 2023 12:03:47 +0000 (14:03 +0200)]
refactor: Rename `wallet_esplora` to...
...`wallet_esplora_blocking`

2 years agodocs: Update README.md
Daniela Brozzoni [Mon, 21 Aug 2023 12:05:09 +0000 (14:05 +0200)]
docs: Update README.md

- Fixes the release timeline
- Adds an explanation for the crates under `example-crates`

2 years agoMerge bitcoindevkit/bdk#1091: ci: Pin rustls-webpki to 0.100.1
Steve Myers [Tue, 22 Aug 2023 16:52:50 +0000 (11:52 -0500)]
Merge bitcoindevkit/bdk#1091: ci: Pin rustls-webpki to 0.100.1

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

2 years agoci: Pin rustls-webpki to 0.100.1
Daniela Brozzoni [Tue, 22 Aug 2023 15:35:32 +0000 (17:35 +0200)]
ci: Pin rustls-webpki to 0.100.1

2 years agoMerge bitcoindevkit/bdk#1082: docs: add License and Contributing sections to repo...
Daniela Brozzoni [Tue, 22 Aug 2023 13:19:41 +0000 (15:19 +0200)]
Merge bitcoindevkit/bdk#1082: docs: add License and Contributing sections to repo top-level README

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

2 years agoMerge bitcoindevkit/bdk#1087: ci: fix msrv dependency versions for reqest and h2
Daniela Brozzoni [Tue, 22 Aug 2023 09:47:48 +0000 (11:47 +0200)]
Merge bitcoindevkit/bdk#1087: ci: fix msrv dependency versions for reqest and h2

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

2 years agoci: fix msrv dependency versions for reqest and h2
Steve Myers [Mon, 21 Aug 2023 20:25:57 +0000 (15:25 -0500)]
ci: fix msrv dependency versions for reqest and h2

- 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

2 years agodocs: add License and Contributing sections to repo top-level README
Steve Myers [Sat, 19 Aug 2023 16:01:17 +0000 (11:01 -0500)]
docs: add License and Contributing sections to repo top-level README

- moved license files up to repo top-level directory
- minor cleanup of bdk/README.md License and Contribution sections

2 years agoMerge bitcoindevkit/bdk#1065: refactor!(chain): Unify ChangeSet nomenclature
志宇 [Fri, 18 Aug 2023 10:56:41 +0000 (18:56 +0800)]
Merge bitcoindevkit/bdk#1065: refactor!(chain): Unify ChangeSet nomenclature

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

2 years agoci: Update tokio version
Daniela Brozzoni [Fri, 18 Aug 2023 10:07:11 +0000 (12:07 +0200)]
ci: Update tokio version

2 years agofeat(chain): Add `initial_changeset` to graphs
Daniela Brozzoni [Wed, 16 Aug 2023 15:39:35 +0000 (17:39 +0200)]
feat(chain): Add `initial_changeset` to graphs

Add `initial_changeset` to TxGraph and IndexedTxGraph

2 years agorefactor!(chain): Unify ChangeSet nomenclature
Daniela Brozzoni [Mon, 7 Aug 2023 15:43:17 +0000 (17:43 +0200)]
refactor!(chain): Unify ChangeSet nomenclature

This commit renames:

- indexed_tx_graph::IndexedAdditions -> indexed_tx_graph::ChangeSet
- indexed_tx_graph::IndexedAdditions::graph_additions -> indexed_tx_graph::ChangeSet::graph
- indexed_tx_graph::IndexedAdditions::index_additions -> indexed_tx_graph::ChangeSet::indexer
- tx_graph::Additions -> tx_graph::ChangeSet
- keychain::DerivationAdditions -> keychain::ChangeSet
- CanonicalTx::node -> CanonicalTx::tx_node
- CanonicalTx::observed_as -> CanonicalTx::chain_position
- LocalChangeSet -> WalletChangeSet
- LocalChangeSet::chain_changeset -> WalletChangeSet::chain
- LocalChangeSet::indexed_additions -> WalletChangeSet::indexed_tx_graph
- LocalUpdate -> WalletUpdate

This commit also changes the visibility of TxGraph::determine_changeset
to be pub(crate), and the method accepts a TxGraph instead of &TxGraph

This commit removes:
- `TxGraph::insert_txout_preview`
- `TxGraph::insert_tx_preview`
- `insert_anchor_preview`
- `insert_seen_at_preview`

Solves #1022

2 years agofeat: Implement Anchor for BlockId
Vladimir Fomene [Wed, 9 Aug 2023 07:42:47 +0000 (10:42 +0300)]
feat: Implement Anchor for BlockId

2 years agoMerge bitcoindevkit/bdk#1077: fix: msrv issues
Daniela Brozzoni [Wed, 16 Aug 2023 13:47:01 +0000 (15:47 +0200)]
Merge bitcoindevkit/bdk#1077: fix: msrv issues

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

2 years agofix: msrv issues and update coverage toolchain
Vladimir Fomene [Wed, 16 Aug 2023 11:25:21 +0000 (14:25 +0300)]
fix: msrv issues and update coverage toolchain

2 years agoMerge bitcoindevkit/bdk#1023: Update rust bitcoin
志宇 [Fri, 4 Aug 2023 04:20:47 +0000 (12:20 +0800)]
Merge bitcoindevkit/bdk#1023: Update rust bitcoin

1da3b304bb0aa29e3bb013e0a583c34ec390b32d ci: Pin rustls to keep the MSRV (Daniela Brozzoni)
792b39fa92bfa1218a33bd6ded257fc105aec67c Explicitly deny multipath keys (Daniela Brozzoni)
b73385dbd2e4c46d0553fa6990e564743b705507 Update wallet_electrum to rust-bitcoin 0.30.0 (Daniela Brozzoni)
3dac3f9bba790e8c40a157aa6c9dc3fdf026255e Update example_electrum to rust-bitcoin 0.30.0 (Daniela Brozzoni)
2949bdc7b8ab40c44803fad8fccb2a8f420d1566 Update example_cli to rust-bitcoin 0.30.0 (Daniela Brozzoni)
468d2a0a3b349adb12564847d50a5e5b30c9df3e Update tmp_plan to rust-bitcoin 0.30.0 (Daniela Brozzoni)
b8ac16d03c070ead550d4b458ddad3159cea0001 Update coin_select to rust-bitcoin 0.30.0 (Daniela Brozzoni)
6c29e53ee8b20bfa73a693ef88a14a925492a19b Update wallet_esplora and wallet_esplora_async to... ...rust-bitcoin 0.30.0 (Daniela Brozzoni)
6eb079576f4387db41ec1b9fe729e1d9ab4f8c01 Update crates/esplora to rust-bitcoin 0.30.0 (Daniela Brozzoni)
91b0f0ba2913287449925c86761f363583e59190 Update crates/electrum to bitcoin 0.30.0 (Daniela Brozzoni)
f4e3ba3265fc61bf61ffb54486abfe005ce236d7 Update bdk to bitcoin 0.30.0 (Daniela Brozzoni)
853d3617514edebd0d7b6542a78b5874225a5473 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 1da3b304bb0aa29e3bb013e0a583c34ec390b32d

Tree-SHA512: ff1457ed711f9f8cdb446ea10aaf124632f539c02406da94317d8dc38013b321217d3bdcb2df4bd72b2ed92116b52e9c6b98ee91d4d508a579c67449a7caa549

2 years agoci: Pin rustls to keep the MSRV
Daniela Brozzoni [Thu, 3 Aug 2023 08:35:53 +0000 (10:35 +0200)]
ci: Pin rustls to keep the MSRV

2 years agoExplicitly deny multipath keys
Daniela Brozzoni [Wed, 19 Jul 2023 16:48:20 +0000 (18:48 +0200)]
Explicitly deny multipath keys

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.

2 years agoUpdate wallet_electrum to rust-bitcoin 0.30.0
Daniela Brozzoni [Wed, 28 Jun 2023 13:13:22 +0000 (15:13 +0200)]
Update wallet_electrum to rust-bitcoin 0.30.0

2 years agoUpdate example_electrum to rust-bitcoin 0.30.0
Daniela Brozzoni [Wed, 28 Jun 2023 13:12:56 +0000 (15:12 +0200)]
Update example_electrum to rust-bitcoin 0.30.0

2 years agoUpdate example_cli to rust-bitcoin 0.30.0
Daniela Brozzoni [Mon, 26 Jun 2023 10:18:43 +0000 (12:18 +0200)]
Update example_cli to rust-bitcoin 0.30.0

2 years agoUpdate tmp_plan to rust-bitcoin 0.30.0
Daniela Brozzoni [Mon, 26 Jun 2023 10:18:15 +0000 (12:18 +0200)]
Update tmp_plan to rust-bitcoin 0.30.0

2 years agoUpdate coin_select to rust-bitcoin 0.30.0
Daniela Brozzoni [Mon, 26 Jun 2023 10:18:15 +0000 (12:18 +0200)]
Update coin_select to rust-bitcoin 0.30.0

2 years agoUpdate wallet_esplora and wallet_esplora_async to...
Daniela Brozzoni [Mon, 26 Jun 2023 10:15:09 +0000 (12:15 +0200)]
Update wallet_esplora and wallet_esplora_async to...
...rust-bitcoin 0.30.0

2 years agoUpdate crates/esplora to rust-bitcoin 0.30.0
Daniela Brozzoni [Sat, 24 Jun 2023 16:06:23 +0000 (18:06 +0200)]
Update crates/esplora to rust-bitcoin 0.30.0

2 years agoUpdate crates/electrum to bitcoin 0.30.0
Daniela Brozzoni [Sat, 24 Jun 2023 16:06:23 +0000 (18:06 +0200)]
Update crates/electrum to bitcoin 0.30.0

2 years agoUpdate bdk to bitcoin 0.30.0
Daniela Brozzoni [Wed, 19 Jul 2023 13:27:48 +0000 (15:27 +0200)]
Update bdk to bitcoin 0.30.0

2 years agoUpdate bdk_chain to bitcoin 0.30.0
Daniela Brozzoni [Wed, 21 Jun 2023 15:59:34 +0000 (17:59 +0200)]
Update bdk_chain to bitcoin 0.30.0

2 years agoMerge bitcoindevkit/bdk#1034: Implement linked-list `LocalChain` and update chain...
志宇 [Thu, 3 Aug 2023 08:04:30 +0000 (16:04 +0800)]
Merge bitcoindevkit/bdk#1034: Implement linked-list `LocalChain` and update chain-src crates/examples

b206a985cffaa9b614841219371faa53ba23dfc3 fix: Even more refactoring to code and documentation (志宇)
bea8e5aff4f1e4d61db3970a6efaec86e686dbc3 fix: `TxGraph::missing_blocks` logic (志宇)
db15e03bdce78c6321f906f390b10b3d9e7501b2 fix: improve more docs and more refactoring (志宇)
95312d4d05618b4c464acc0fdff49fb17405ec88 fix: docs and some minor refactoring (志宇)
8bf7a997f70fdffd072fd37e12c385e731728c5a Refactor `debug_assertions` checks for `LocalChain` (志宇)
315e7e0b4b373d7175f21a48ff6480b6e919a2c6 fix: rm duplicate `bdk_tmp_plan` module (志宇)
af705da1a846214f104df8886201a23cfa4b6b74 Add exclusion of example cli `*.db` files in `.gitignore` (志宇)
eabeb6ccb169b32f7b7541c9dc6481693bdeeb8a 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 b206a985cffaa9b614841219371faa53ba23dfc3

Tree-SHA512: a513eecb4f1aae6a5c06a69854e4492961424312a75a42d74377d363b364e3d52415bc81b4aa3fbc3f369ded19bddd07ab895130ebba288e8a43e9d6186e9fcc

2 years agoMerge bitcoindevkit/bdk#1039: docs: add required style for commit messages
Steve Myers [Wed, 2 Aug 2023 21:35:32 +0000 (16:35 -0500)]
Merge bitcoindevkit/bdk#1039: docs: add required style for commit messages

e17f03e7555b7b6f5348b9854f3d4ef559e84d75 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 e17f03e7555b7b6f5348b9854f3d4ef559e84d75. 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 e17f03e7555b7b6f5348b9854f3d4ef559e84d75 - 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

2 years agofix: Even more refactoring to code and documentation
志宇 [Tue, 1 Aug 2023 10:27:24 +0000 (18:27 +0800)]
fix: Even more refactoring to code and documentation

Thank you to @LLFourn and @danielabrozzoni for these suggestions.

2 years agofix: `TxGraph::missing_blocks` logic
志宇 [Sat, 22 Jul 2023 14:41:33 +0000 (22:41 +0800)]
fix: `TxGraph::missing_blocks` logic

Added additional tests for unnecessary duplicate heights

2 years agofix: improve more docs and more refactoring
志宇 [Sat, 22 Jul 2023 11:42:12 +0000 (19:42 +0800)]
fix: improve more docs and more refactoring

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`.

2 years agofix: docs and some minor refactoring
志宇 [Sat, 22 Jul 2023 08:36:31 +0000 (16:36 +0800)]
fix: docs and some minor refactoring

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`.

2 years agoRefactor `debug_assertions` checks for `LocalChain`
志宇 [Sat, 22 Jul 2023 06:43:19 +0000 (14:43 +0800)]
Refactor `debug_assertions` checks for `LocalChain`

2 years agofix: rm duplicate `bdk_tmp_plan` module
志宇 [Thu, 20 Jul 2023 00:17:27 +0000 (08:17 +0800)]
fix: rm duplicate `bdk_tmp_plan` module

2 years agoAdd exclusion of example cli `*.db` files in `.gitignore`
志宇 [Thu, 20 Jul 2023 00:16:20 +0000 (08:16 +0800)]
Add exclusion of example cli `*.db` files in `.gitignore`

2 years agoImplement linked-list `LocalChain` and update chain-src crates/examples
志宇 [Wed, 19 Jul 2023 09:42:52 +0000 (17:42 +0800)]
Implement linked-list `LocalChain` and update chain-src crates/examples

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>
2 years agoMerge bitcoindevkit/bdk#1046: Avoid pinning dependencies, use --precise in ci
Daniela Brozzoni [Tue, 25 Jul 2023 15:05:53 +0000 (17:05 +0200)]
Merge bitcoindevkit/bdk#1046: Avoid pinning dependencies, use --precise in ci

ffb7c795e15d2d879f2d857e7607729ca4a53155 ci: Avoid pinning dependencies, use --precise (Daniela Brozzoni)
56b8eea64330044fd7761cb2439d7dcca05106f2 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 ffb7c795e15d2d879f2d857e7607729ca4a53155

Tree-SHA512: a2e5e0ffea87dc86e27c2f2f3550e6e6429e66f5fd8e0196e85915de5b0f14f0e4ee9d56c87b38b101eb28d86a65868054c20421f32ecd475ca73d00471e2f8d

2 years agoci: Avoid pinning dependencies, use --precise
Daniela Brozzoni [Mon, 24 Jul 2023 10:44:48 +0000 (12:44 +0200)]
ci: Avoid pinning dependencies, use --precise

Fixes #1035

2 years agoci: No need to add the llvm repository for wasm
Daniela Brozzoni [Tue, 25 Jul 2023 11:15:47 +0000 (13:15 +0200)]
ci: No need to add the llvm repository for wasm

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.

2 years agoMerge bitcoindevkit/bdk#1031: remove duplicate `is_empty`
Daniela Brozzoni [Mon, 24 Jul 2023 09:20:59 +0000 (11:20 +0200)]
Merge bitcoindevkit/bdk#1031: remove duplicate `is_empty`

f5074ee3aee319137db1ddfa1e99f7e111abcfd4 remove duplicate `is_empty` from DerivationAdditions (Vladimir Fomene)

Pull request description:

  Duplicate `is_empty` method

  ### 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 f5074ee3aee319137db1ddfa1e99f7e111abcfd4

Tree-SHA512: 1cb48d25c9e57dbe444646ebc33c838e3d58c2523d74b58a75f0d085f68d070ec6a644c46e0bccb8765af7167c8359f079a6222fc9d17ae28ce1e6dda820fc84

2 years agodocs: add required style for commit messages
Steve Myers [Wed, 19 Jul 2023 21:15:35 +0000 (16:15 -0500)]
docs: add required style for commit messages

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/.

2 years agoremove duplicate `is_empty` from DerivationAdditions
Vladimir Fomene [Fri, 14 Jul 2023 14:52:08 +0000 (17:52 +0300)]
remove duplicate `is_empty` from DerivationAdditions

2 years agoBump version to 1.0.0-alpha.1 v1.0.0-alpha.1
Steve Myers [Tue, 4 Jul 2023 17:28:06 +0000 (12:28 -0500)]
Bump version to 1.0.0-alpha.1

2 years ago[ci] fix docsrs error for bdk crate
Steve Myers [Tue, 20 Jun 2023 17:33:05 +0000 (12:33 -0500)]
[ci] fix docsrs error for bdk crate