]> Untitled Git - bdk/log
bdk
14 months agochore(deps): bump actions/checkout from 1 to 4 github/dependabot/github_actions/actions/checkout-4
dependabot[bot] [Mon, 14 Oct 2024 20:46:07 +0000 (20:46 +0000)]
chore(deps): bump actions/checkout from 1 to 4

Bumps [actions/checkout](https://github.com/actions/checkout) from 1 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v1...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
14 months agoMerge bitcoindevkit/bdk#1612: Refactor: Move transaction testing utilities from ...
Steve Myers [Mon, 14 Oct 2024 18:59:06 +0000 (13:59 -0500)]
Merge bitcoindevkit/bdk#1612: Refactor: Move transaction testing utilities from `crates/chain/tests/common` to `testenv` crate

88a8403707038264251b3e7fa18b8f21af8646ff refactor(test): move tx test utils to testenv (Vihiga Tyonum)

Pull request description:

  <!-- You can erase any parts of this template not applicable to your Pull Request. -->

  ### Description

  This change moves all transaction testing utilities (macros and functions) from `crates/chain/tests/common` to `crates/testenv/tx_utils` to minimize duplication.

  Closes #1602

  <!-- Describe the purpose of this PR, what's being adding and/or fixed -->

  ### Notes to the reviewers

  <!-- In this section you can include notes directed to the reviewers, like explaining why some parts
  of the PR were done in a specific way -->

  ### Changelog notice

  <!-- Notice the release manager should include in the release tag message changelog -->
  <!-- See https://keepachangelog.com/en/1.0.0/ for examples -->

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

  #### Bugfixes:

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

ACKs for top commit:
  ValuedMammal:
    ACK 88a8403707038264251b3e7fa18b8f21af8646ff
  notmandatory:
    ACK 88a8403707038264251b3e7fa18b8f21af8646ff

Tree-SHA512: aa85c6683d44463e8858f18840fd628d98f54757edff85fe0489c7954fc56998456ce8069e328eff46e907235d092059975c10e420fe7dfe83e5cdd9b63fc8ed

14 months agorefactor(test): move tx test utils to testenv
Vihiga Tyonum [Sat, 14 Sep 2024 20:52:50 +0000 (21:52 +0100)]
refactor(test): move tx test utils to testenv

- add `utils` mod to testenv crate to keep all
utilities moved from `crates/chain/test/common`
- replace all test tx macros in `chain` crate with
import from `testenv` crate
    - tests/test_indexed_tx_graph
    - tests/test_keychain_txout_index
    - tests/test_local_chain
    - tests/test_tx_graph
    - tests/test_tx_graph_conflicts
- deleted all moved macros and functions in
`crates/chain/test/common/mod`
- replace `bitcoin` external crate with
`bd_chain::bitcoin`
- move `DESCRIPTORS` sample array to `utils` for
other crates to use
- rename h! macro to hash! for clarity
- rename localchain! macro parameter from
'block_hash' to 'hash'

[Ticket: #1602]

14 months agoMerge bitcoindevkit/bdk#1639: Bump bdk_wallet version to 1.0.0-beta.5 v1.0.0-beta.5
valued mammal [Wed, 2 Oct 2024 16:22:12 +0000 (12:22 -0400)]
Merge bitcoindevkit/bdk#1639: Bump bdk_wallet version to 1.0.0-beta.5

b5e8e6b1ceed316a84bcc2660442cf0ba7bac7eb Bump bdk_wallet version to 1.0.0-beta.5 (valued mammal)

Pull request description:

  Bump bdk_wallet version to 1.0.0-beta.5

  bdk_core to 0.3.0
  bdk_chain to 0.20.0
  bdk_bitcoind_rpc to 0.16.0
  bdk_electrum to 0.19.0
  bdk_esplora to 0.19.0
  bdk_file_store to 0.17.0
  bdk_testenv to 0.10.0

ACKs for top commit:
  notmandatory:
    ACK b5e8e6b1ceed316a84bcc2660442cf0ba7bac7eb

Tree-SHA512: e5e9309a2bfd3f893ec8794ac316b3f2be0c333d8971883619a873a2663d451b267090e36a9d2eb44ce4a3cc4eabf47847f8335fb183a6c72475dcb6c57742a5

14 months agoBump bdk_wallet version to 1.0.0-beta.5
valued mammal [Wed, 2 Oct 2024 14:25:15 +0000 (10:25 -0400)]
Bump bdk_wallet version to 1.0.0-beta.5

bdk_core to 0.3.0
bdk_chain to 0.20.0
bdk_bitcoind_rpc to 0.16.0
bdk_electrum to 0.19.0
bdk_esplora to 0.19.0
bdk_file_store to 0.17.0
bdk_testenv to 0.10.0

14 months agoMerge bitcoindevkit/bdk#1620: feat(bdk_electrum): add `use-openssl` as a feature
Steve Myers [Wed, 2 Oct 2024 02:05:16 +0000 (21:05 -0500)]
Merge bitcoindevkit/bdk#1620: feat(bdk_electrum): add `use-openssl` as a feature

f602d1bfe24783449a88d5e82ab29f305cd2a02c feat(bdk_electrum): add `use-openssl` as a feature (Leonardo Lima)

Pull request description:

  partially addresses #1598

  <!-- You can erase any parts of this template not applicable to your Pull Request. -->

  ### Description

  It's a simple PR to expose the `use-openssl` from `electrum-client` to `bdk_electrum`. It partially addresses #1598, allowing the user to use `openssl` as an alternative to `rustls`, as there are some problems with it when handling some types of TLS certificates.

  Do we need to add some sort of `bdk_electrum` tests using the new exposed `use-openssl` feature ?

  <!-- Describe the purpose of this PR, what's being adding and/or fixed -->

  ### Notes to the reviewers

  <!-- In this section you can include notes directed to the reviewers, like explaining why some parts
  of the PR were done in a specific way -->

  ### Changelog notice

  - Adds `use-openssl` as feature to `bdk_electrum`, exposing `electrum-client` `use-openssl` feature.

  <!-- Notice the release manager should include in the release tag message changelog -->
  <!-- See https://keepachangelog.com/en/1.0.0/ for examples -->

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

  #### Bugfixes:

  * [ ] This pull request breaks the existing API
  * [ ] 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: 86e0fdeaa0b6a48e0c7ddde6e3890ce86510b86ad727adf05cde5e8c311a8c6b7614ae57bae0cff9e7b8443478a324e5ce9e5180023d501453a5c1e9e45920e1

14 months agofeat(bdk_electrum): add `use-openssl` as a feature
Leonardo Lima [Fri, 20 Sep 2024 02:06:28 +0000 (23:06 -0300)]
feat(bdk_electrum): add `use-openssl` as a feature

14 months agoMerge bitcoindevkit/bdk#1636: ci: fix build-test job with --no-default-features,...
valued mammal [Tue, 1 Oct 2024 23:17:27 +0000 (19:17 -0400)]
Merge bitcoindevkit/bdk#1636: ci: fix build-test job with --no-default-features, add miniscript/no-std

0e8082437401eccdef30737e739381d295530547 ci: fix build-test job with --no-default-features, add miniscript/no-std (Steve Myers)

Pull request description:

  ### Description

  Fixes the CI `build-test` job with `--no-default-features` by also adding `--features miniscript/no-std`.

  Until `rust-miniscript` removes the `no-std` feature we need to enable it when `--no-default-features` is used to build `bdk_wallet` or the whole workspace. See also the `check-no-std` job which does the same plus enables the `bdk_chain/hashbrown` feature which is also needed to build `bdk_wallet` with `--no-default-features` but is already enabled when building the whole workspace.

  ### Notes to the reviewers

  I think we didn't catch this on #1625 because the CI job names changed and I didn't update the branch merge requirements. Another possibility is it was passing because of cached build artifacts which I removed last night when I was trying to troubleshoot something else. I've updated the required CI jobs that need to pass before allowing a PR to be merged to `master` to include the ones with `--no-default-features --features bdk_chain/hashbrown` in the name.

  ### 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)
  * [ ] I ran `cargo fmt` and `cargo clippy` before committing

ACKs for top commit:
  ValuedMammal:
    ACK 0e8082437401eccdef30737e739381d295530547

Tree-SHA512: 5da486b7fd988575b6f9c06eb108a183b47c74d58fd451453d77b53ad26f58890ee605f4a154922688dc348bc5a3c413dcd9128fd4831d8923c64a33aa4a951c

14 months agoci: fix build-test job with --no-default-features, add miniscript/no-std
Steve Myers [Tue, 1 Oct 2024 19:33:27 +0000 (14:33 -0500)]
ci: fix build-test job with --no-default-features, add miniscript/no-std

Until rust-miniscript removes the no-std feature we need to enable it
when --no-default-features is used to build bdk_wallet or the
whole workspace. See also the check-no-std job which does the same plus
enables the bdk_chain/hashbrown feature which is also needed to build
bdk_wallet with --no-default-features but is already enabled when
building the whole workspace.

14 months agoMerge bitcoindevkit/bdk#1594: Replace trait `AnchorFromBlockPosition` with new struct
Steve Myers [Tue, 1 Oct 2024 15:16:52 +0000 (10:16 -0500)]
Merge bitcoindevkit/bdk#1594: Replace trait `AnchorFromBlockPosition` with new struct

ab8068b90ee476f8edf7d3d4a21d621818e30969 refactor(chain)!: Replace trait `AnchorFromBlockPosition` with new struct (Jiri Jakes)

Pull request description:

  ### Description

  This change replaces a way of creating new generic anchor from block and its height. Previous way was using conversion trait, newly it is a struct and `From`.

  Closes #1266.

  ### Notes to the reviewers

  - Removed `tx_pos`: I did not see its relevance (`Anchor` does not give access to it). Was it a relic from the past or something I overlooked?
  - I put `BlockPosition` into `tx_data_traits.rs` because I believe it should be next to `Anchor`. But then it's not a module just for traits. What would be better place?

  ### 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:
  LagginTimes:
    ACK ab8068b90ee476f8edf7d3d4a21d621818e30969
  LLFourn:
    ACK ab8068b90ee476f8edf7d3d4a21d621818e30969

Tree-SHA512: 9546ff177247796a36aeec6e015e564fb093cae0fe3b2962520843e8371bf3060f6d62f676a3989a49a6c25da6b7adbcde47c5fffe2f772f871980eb77cd1aea

14 months agoMerge bitcoindevkit/bdk#1625: feat(chain,core)!: move `Merge` to `bdk_core`
Steve Myers [Tue, 1 Oct 2024 14:53:31 +0000 (09:53 -0500)]
Merge bitcoindevkit/bdk#1625: feat(chain,core)!: move `Merge` to `bdk_core`

a4cf905d75ad7e09730b6d0aab5ef6cd2e735c2b feat(file_store): rm `bdk_chain` dependency (志宇)
993c4c055354ba6ddb0d81e8e5dbfa1f9bb631ac feat(chain,core)!: move `Merge` to `bdk_core` (志宇)

Pull request description:

  Fixes #1624

  ### Description

  Moving `Merge` into `bdk_core` (from `bdk_chain`) allows persist crates to only depend on `bdk_core`.

  ### Changelog notice

  * Move `Merge` into `bdk_core`.
  * Remove `bdk_chain` dependency from `bdk_file_store`.

  ### 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:
  LagginTimes:
    ACK a4cf905d75ad7e09730b6d0aab5ef6cd2e735c2b
  oleonardolima:
    ACK a4cf905d75ad7e09730b6d0aab5ef6cd2e735c2b
  ValuedMammal:
    ACK a4cf905d75ad7e09730b6d0aab5ef6cd2e735c2b
  notmandatory:
    ACK a4cf905d75ad7e09730b6d0aab5ef6cd2e735c2b

Tree-SHA512: a94e24e04929cf790defd7ca0c8b5194eb5e9b31d295a55f5d3326d3eeb46821eda73191f2f68d8bb7e178bacd2cccfa45c8ded0ce50aabd4b7293edb338c956

14 months agoMerge bitcoindevkit/bdk#1626: deps(esplora): bump esplora-client to 0.10.0
Steve Myers [Tue, 1 Oct 2024 02:04:00 +0000 (21:04 -0500)]
Merge bitcoindevkit/bdk#1626: deps(esplora): bump esplora-client to 0.10.0

c60529436dcf82298ea923f782adefd059272cc9 deps(esplora): bump esplora-client to 0.10.0 (valued mammal)

Pull request description:

  Bumps rust-esplora-client to 0.10.0

  also fixes #1120

  ### 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:
  LagginTimes:
    ACK c60529436dcf82298ea923f782adefd059272cc9
  oleonardolima:
    utACK c60529436dcf82298ea923f782adefd059272cc9
  notmandatory:
    ACK c60529436dcf82298ea923f782adefd059272cc9

Tree-SHA512: 212212b4f02f2c265b3b18645d8309b2c4846e652f988ff643cc9c7b936badabdc9f18bcb6ccda9322ee555e8883f748d988b473d240d010aa62b5a854ee80ef

14 months agoMerge bitcoindevkit/bdk#1616: feat(wallet)!: enable RBF by default on TxBuilder
Steve Myers [Mon, 30 Sep 2024 18:43:30 +0000 (13:43 -0500)]
Merge bitcoindevkit/bdk#1616: feat(wallet)!: enable RBF by default on TxBuilder

f15551b56fb4eb91bc0be5f940950c40ac465084 feat(wallet)!: enable RBF by default on TxBuilder (Luis Schwab)

Pull request description:

  ### Description

  Closes #791

  This PR enables RBF by default on `TxBuilder`

  ### Notes to the reviewers

  <!-- In this section you can include notes directed to the reviewers, like explaining why some parts
  of the PR were done in a specific way -->

  ### Changelog notice
  - On TxParams, `rbf` becomes `sequence`
  - Added `set_exact_sequence()`, so the user can define an arbitrary sequence value
  - `n_sequence` now defaults to `0xFFFFFFFD`
  - Adjusted tests accordingly

  ### 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
  * [ ] I've added docs for the new feature

  #### Bugfixes:

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

ACKs for top commit:
  notmandatory:
    ACK f15551b56fb4eb91bc0be5f940950c40ac465084

Tree-SHA512: 784538ffd102f315a7a96bd7f9afcdca7d35252ee2b4489d9853797c7f6d8cf95537f0dea3855ea9fffc9bf148c81a8c090cfdfd1e94144b9343651129ab9504

14 months agofeat(wallet)!: enable RBF by default on TxBuilder
Luis Schwab [Tue, 17 Sep 2024 17:04:01 +0000 (14:04 -0300)]
feat(wallet)!: enable RBF by default on TxBuilder

14 months agorefactor(chain)!: Replace trait `AnchorFromBlockPosition` with new struct
Jiri Jakes [Sun, 8 Sep 2024 08:05:30 +0000 (16:05 +0800)]
refactor(chain)!: Replace trait `AnchorFromBlockPosition` with new struct

This change replaces a way of creating new generic anchor from block,
its height and transaction position. Previous way was using conversion
trait, newly it is a struct and `From`.

14 months agoMerge bitcoindevkit/bdk#1623: fix!(wallet): `ChangeSet` should not be non-exhaustive
valued mammal [Sat, 28 Sep 2024 00:55:36 +0000 (20:55 -0400)]
Merge bitcoindevkit/bdk#1623: fix!(wallet): `ChangeSet` should not be non-exhaustive

d7dfe38ff6c0f1b984e15defc83c79e52a44afa9 fix!(wallet): `ChangeSet` should not be non-exhaustive (志宇)

Pull request description:

  Closes #1591

  ### Description

  As stated in #1591, it is handy to know when new values are added to `ChangeSet`.

  ### Notes to the reviewers

  ~

  ### Changelog notice

  * Remove `#[non_exhaustive]` attribute from `wallet::ChangeSet`.

  ### 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:
  oleonardolima:
    utACK d7dfe38ff6c0f1b984e15defc83c79e52a44afa9
  ValuedMammal:
    ACK d7dfe38ff6c0f1b984e15defc83c79e52a44afa9

Tree-SHA512: 2856d9af625ee788c5ddec0a51dace26a1cb1b57b327ffb8439fe8a45888cdf2ecaeac8d2c777620f83b66d211bac4d17fea3d1143800127316ba475b5064b23

14 months agoMerge bitcoindevkit/bdk#1603: fix(RUSTSEC-2024-0370): proc-macro-error is unmaintained
valued mammal [Sat, 28 Sep 2024 00:53:15 +0000 (20:53 -0400)]
Merge bitcoindevkit/bdk#1603: fix(RUSTSEC-2024-0370): proc-macro-error is unmaintained

d802d00a06035bec582eb5aadf0281f26bff6acd fix(RUSTSEC-2024-0370)!: bump `clap` to latest, removing transitive dependency on `proc-macro-error`. (Leonardo Lima)
45be3172a4abaa94ef2ff55784da31832bdd732a refactor(ci)!: update CI to build and test example in specific job (Leonardo Lima)
519728cd596c3bda60c6e70cbc12b611017e2d7f chore(examples)!: update all examples to have `example_` prefix (Leonardo Lima)
9b7b19586e1f74613f71b6c2403a7df419e13b65 chore: use path as `name` for cargo test targets (Leonardo Lima)
6e8f19607aff55b1949fc7e9f943a333b4fcfb8a fix(bdk_electrum): build with `--no-default-features` (Leonardo Lima)
33942ece8f2f1f0b3d85a201d659cde72a560646 fix(bdk_esplora): build with `--no-default-features` (Leonardo Lima)

Pull request description:

  A candidate for fixing #1593. It builds on top of #1615
  <!-- You can erase any parts of this template not applicable to your Pull Request. -->

  ### Description

  <!-- Describe the purpose of this PR, what's being adding and/or fixed -->

  In https://github.com/bitcoindevkit/bdk/issues/1593 it's mentioned that `proc-macro-error` is unmaintained for the
  past few years, with no fix other than using proc-macro-error2 instead.

  As on our scenario it's merely a transitive dependency of `clap`,
  through `clap_derive` feature, which in latest releases doesn't depend on
  `proc-macro-error` we can just bump it to latest.

  It's valid to note that by bumping it, both examples that relies on clap
  are no longer MSRV (1.63) compliant.

  That said, this PR does:

  - Standardize the example packages to have `example_` prefix.
  - Exclude examples from running in main `Build & Test` CI job.
  - Add new testing step to `Build & Test Example` CI job.
  - Bumps the `clap` to `4.5.17`.

  ### Notes to the reviewers

  <!-- In this section you can include notes directed to the reviewers, like explaining why some parts
  of the PR were done in a specific way -->

  ### Changelog notice

  <!-- Notice the release manager should include in the release tag message changelog -->
  <!-- See https://keepachangelog.com/en/1.0.0/ for examples -->

  - Standardize the example packages to have `example_` prefix.
  - Exclude examples from running in main `Build & Test` CI job.
  - Add new testing step to `Build & Test Example` CI job.
  - Bumps the `clap` to `4.5.17`.

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

  #### Bugfixes:

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

ACKs for top commit:
  ValuedMammal:
    ACK d802d00a06035bec582eb5aadf0281f26bff6acd

Tree-SHA512: 274ddcdf05175fa5bc9c78e81de9ce768b800942a2dd420abc415618948aa84b79f6542d8af0c9ba57adaca48ce91fb854546ece069bd4751598cca4ed8f7560

14 months agodeps(esplora): bump esplora-client to 0.10.0
valued mammal [Thu, 26 Sep 2024 15:38:39 +0000 (11:38 -0400)]
deps(esplora): bump esplora-client to 0.10.0

14 months agofeat(file_store): rm `bdk_chain` dependency
志宇 [Thu, 26 Sep 2024 09:51:02 +0000 (17:51 +0800)]
feat(file_store): rm `bdk_chain` dependency

14 months agofeat(chain,core)!: move `Merge` to `bdk_core`
志宇 [Thu, 26 Sep 2024 09:42:58 +0000 (17:42 +0800)]
feat(chain,core)!: move `Merge` to `bdk_core`

14 months agofix!(wallet): `ChangeSet` should not be non-exhaustive
志宇 [Thu, 26 Sep 2024 08:28:38 +0000 (16:28 +0800)]
fix!(wallet): `ChangeSet` should not be non-exhaustive

As stated in #1591, it is handy to know when new values are added to
`ChangeSet`.

15 months agofix(RUSTSEC-2024-0370)!: bump `clap` to latest, removing transitive
Leonardo Lima [Thu, 12 Sep 2024 15:08:35 +0000 (12:08 -0300)]
fix(RUSTSEC-2024-0370)!: bump `clap` to latest, removing transitive
dependency on `proc-macro-error`.

In #1593 it's mentioned that `proc-macro-error` is unmaintained for the
past few years, with no fix other than using proc-macro-error2 instead.

As on our scenario it's merely a transitive dependency of `clap`,
through `clap_derive` feature, which in latest releases doesn't depend on
`proc-macro-error` we can just bump it to latest.

It's valid to note that by bumping it, both examples that relies on clap
are no longer MSRV (1.63) compliant.

15 months agorefactor(ci)!: update CI to build and test example in specific job
Leonardo Lima [Thu, 12 Sep 2024 15:06:20 +0000 (12:06 -0300)]
refactor(ci)!: update CI to build and test example in specific job

15 months agochore(examples)!: update all examples to have `example_` prefix
Leonardo Lima [Thu, 12 Sep 2024 15:01:36 +0000 (12:01 -0300)]
chore(examples)!: update all examples to have `example_` prefix

15 months agochore: use path as `name` for cargo test targets
Leonardo Lima [Fri, 20 Sep 2024 15:03:54 +0000 (12:03 -0300)]
chore: use path as `name` for cargo test targets

15 months agofix(bdk_electrum): build with `--no-default-features`
Leonardo Lima [Mon, 16 Sep 2024 15:54:36 +0000 (12:54 -0300)]
fix(bdk_electrum): build with `--no-default-features`

- add `use-rustls` as required features for `test_electrum.rs`, using
  the `[[test]]` cargo target approach.

15 months agofix(bdk_esplora): build with `--no-default-features`
Leonardo Lima [Mon, 16 Sep 2024 15:51:29 +0000 (12:51 -0300)]
fix(bdk_esplora): build with `--no-default-features`

- add `blocking-https` as one of the default features, instead of
  `blocking-https-rustls`, they are basically the same in
  `esplora-client`.
- add `async` and `blocking as required features for each test, using
  the `[[test]]` cargo target.

15 months agoMerge bitcoindevkit/bdk#1596: doc(wallet): Add docs to explain the lookahead
valued mammal [Mon, 16 Sep 2024 16:19:32 +0000 (12:19 -0400)]
Merge bitcoindevkit/bdk#1596: doc(wallet): Add docs to explain the lookahead

028f687b21872b66a2907701e5a8e143d0f867a0 doc(wallet): Add docs to explain the lookahead (valued mammal)

Pull request description:

  Adds clarifying language to `CreateParams` and `LoadParams` regarding the `lookahead` parameter. Commit 028f687b21872b66a2907701e5a8e143d0f867a0 also includes some minor documentation fixes.

  If anyone is aware of any more documentation flaws that need attention I'm happy to add them here.

  cc #1540

  ### 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:
  LagginTimes:
    ACK 028f687b21872b66a2907701e5a8e143d0f867a0
  oleonardolima:
    ACK 028f687b21872b66a2907701e5a8e143d0f867a0
  evanlinjin:
    ACK 028f687b21872b66a2907701e5a8e143d0f867a0

Tree-SHA512: 971d09652948ed2e2dc86d255cfd18607d96b0806aa0e990190cd1d7035c6660ea2ac1092ef2c6c209e61920c0d4ff9d8c0a900bcc74a8662546d284fec3218f

15 months agoMerge bitcoindevkit/bdk#1613: ci: automated update to rustc 1.81.0
valued mammal [Mon, 16 Sep 2024 16:05:47 +0000 (12:05 -0400)]
Merge bitcoindevkit/bdk#1613: ci: automated update to rustc 1.81.0

503f315cdde32dabbc83efd3879ac5cb26aacdbc ci: automated update to rustc 1.81.0 (Github Action)

Pull request description:

  Automated update to Github CI workflow `cont_integration.yml` by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

ACKs for top commit:
  ValuedMammal:
    ACK 503f315cdde32dabbc83efd3879ac5cb26aacdbc

Tree-SHA512: 60269a5525d1a0aaab400d1ef287acf1b7631ea4c2e4b1627a7d66a8a40526dce79abcd4d339dfea32ef02f573672d7d76acad10319e9336949c8ce9e92a17ad

15 months agoci: automated update to rustc 1.81.0
Github Action [Sun, 15 Sep 2024 01:07:19 +0000 (01:07 +0000)]
ci: automated update to rustc 1.81.0

15 months agoMerge bitcoindevkit/bdk#1610: Bump bdk_wallet version to 1.0.0-beta.4 v1.0.0-beta.4
Steve Myers [Fri, 13 Sep 2024 20:58:13 +0000 (15:58 -0500)]
Merge bitcoindevkit/bdk#1610: Bump bdk_wallet version to 1.0.0-beta.4

b34b7778f44be05827fde84660f6b1ee144d9845 Bump bdk_wallet version to 1.0.0-beta.4 (Steve Myers)

Pull request description:

  Bump bdk_wallet version to 1.0.0-beta.4

  bdk_core to 0.2.0
  bdk_chain to 0.19.0
  bdk_bitcoind_rpc to 0.15.0
  bdk_electrum to 0.18.0
  bdk_esplora to 0.18.0
  bdk_file_store to 0.16.0
  bdk_testenv to 0.9.0

ACKs for top commit:
  ValuedMammal:
    ACK b34b7778f44be05827fde84660f6b1ee144d9845

Tree-SHA512: 0dd33aca0a35adff263225678767500b0890caff1326085aa09333692e3e70095cac42b6686f1db9abc63e769326d7d4fc418d861c48ec184c877be00715b0ea

15 months agoBump bdk_wallet version to 1.0.0-beta.4
Steve Myers [Fri, 13 Sep 2024 20:10:55 +0000 (15:10 -0500)]
Bump bdk_wallet version to 1.0.0-beta.4

bdk_core to 0.2.0
bdk_chain to 0.19.0
bdk_bitcoind_rpc to 0.15.0
bdk_electrum to 0.18.0
bdk_esplora to 0.18.0
bdk_file_store to 0.16.0
bdk_testenv to 0.9.0

15 months agoMerge bitcoindevkit/bdk#1608: Bump bdk_wallet version to 1.0.0-beta.3 v1.0.0-beta.3
Steve Myers [Fri, 13 Sep 2024 16:00:10 +0000 (11:00 -0500)]
Merge bitcoindevkit/bdk#1608: Bump bdk_wallet version to 1.0.0-beta.3

7a501c1c92c2859feb1a486a96f3dd9917d00a8c Bump bdk_wallet version to 1.0.0-beta.3 (Steve Myers)

Pull request description:

  ### Description

  Bump bdk_wallet version to 1.0.0-beta.3

  bdk_core to 0.1.1
  bdk_chain to 0.18.1
  bdk_bitcoind_rpc to 0.14.1
  bdk_electrum to 0.17.1
  bdk_esplora to 0.17.1
  bdk_file_store to 0.15.1
  bdk_testenv to 0.8.1

ACKs for top commit:
  ValuedMammal:
    ACK 7a501c1c92c2859feb1a486a96f3dd9917d00a8c

Tree-SHA512: 75572db6c9ad4c54584c82750fbb772a66f54aa62d7bbaa2ffbad1870116e7fdeaa78136ab994840282e5b73b67d61727be6fa109fb9e4e1e414f42eee15277e

15 months agoBump bdk_wallet version to 1.0.0-beta.3
Steve Myers [Fri, 13 Sep 2024 14:47:45 +0000 (09:47 -0500)]
Bump bdk_wallet version to 1.0.0-beta.3

bdk_core to 0.1.1
bdk_chain to 0.18.1
bdk_bitcoind_rpc to 0.14.1
bdk_electrum to 0.17.1
bdk_esplora to 0.17.1
bdk_file_store to 0.15.1
bdk_testenv to 0.8.1

15 months agoMerge bitcoindevkit/bdk#1605: fix(wallet): fix SingleRandomDraw to error if insuffici...
Steve Myers [Thu, 12 Sep 2024 21:13:39 +0000 (16:13 -0500)]
Merge bitcoindevkit/bdk#1605: fix(wallet): fix SingleRandomDraw to error if insufficient funds

22a2f83db5df5f48974a06deef6b45d41a05ef3b fix(wallet): fix SingleRandomDraw to throw an error if insufficient funds (Steve Myers)

Pull request description:

  ### Description

  * fix SingleRandomDraw to error if insufficient funds
  * fixed spelling and clippy errors (see: https://github.com/bitcoindevkit/bdk/pull/1581#discussion_r1756936178)
  * updated tests to check for error variant instead of a panic

  ### Notes to the reviewers

  Since the single random draw algo can be used on its own it needs to be able to return an insufficient funds error. I think the reason we didn't catch this before is that single random draw already check for sufficient required + optional utxo amounts and returns the insufficient funds error.

  ### Changelog notice

  * fix SingleRandomDraw coin selection to error if there are insufficient funds for a requested payment amount.

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

ACKs for top commit:
  ValuedMammal:
    ACK 22a2f83db5df5f48974a06deef6b45d41a05ef3b

Tree-SHA512: c434003ea6cec1423960a0c7d2f830324227f9f99d9d8f72bd7785368cf51c867036b80c300a97177a10998830ef4df924bdcad408730f9e5dddc92cda75dceb

15 months agoMerge bitcoindevkit/bdk#1601: fix(core): calling `CheckPoint::insert` with existing...
Steve Myers [Thu, 12 Sep 2024 21:11:37 +0000 (16:11 -0500)]
Merge bitcoindevkit/bdk#1601: fix(core): calling `CheckPoint::insert` with existing block must succeed

3ae9ecba8c893750fa2ed5dfdbb1f4ee84a0b228 test: fix off-by-one in `checkpoint_insert_existing` (valued mammal)
e6aeaea0c69472e4c2dcf0f5e2f632f43733529d doc(core): document panic for `CheckPoint::insert` (valued mammal)
2970b83f30ca7071f0502de395327eb3671a512b fix(core): calling `CheckPoint::insert` with existing block must succeed (志宇)

Pull request description:

  ### Description

  Previously, we were panicking when the caller tried to insert a block at height 0. However, this should succeed if the block hash does not change.

  ### Notes to the reviewers

  For context:

  * https://github.com/lightningdevkit/ldk-node/pull/358
  * https://discord.com/channels/753336465005608961/978744259693916230/1283050849429356629

  ### Changelog notice

  * Fix `CheckPoint::insert` to not panic when inserting existing genesis block (same block height and 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

  #### Bugfixes:

  ~~* [ ] This pull request breaks the existing API~~
  * [x] I've added tests to reproduce the issue which are now passing

ACKs for top commit:
  ValuedMammal:
    Self ACK 3ae9ecba8c893750fa2ed5dfdbb1f4ee84a0b228
  notmandatory:
    ACK 3ae9ecba8c893750fa2ed5dfdbb1f4ee84a0b228

Tree-SHA512: 638d8aacac59ad18b5ee369d08f39bb12cc37fa9b3f936404b60dbf44938ef850ca341d00566840b5a77909d31c9291ab56299d986d832005ca96cd91a0b0e55

15 months agotest: fix off-by-one in `checkpoint_insert_existing`
valued mammal [Thu, 12 Sep 2024 19:20:16 +0000 (15:20 -0400)]
test: fix off-by-one in `checkpoint_insert_existing`

15 months agodoc(core): document panic for `CheckPoint::insert`
valued mammal [Thu, 12 Sep 2024 19:18:01 +0000 (15:18 -0400)]
doc(core): document panic for `CheckPoint::insert`

15 months agofix(wallet): fix SingleRandomDraw to throw an error if insufficient funds
Steve Myers [Thu, 12 Sep 2024 18:14:54 +0000 (13:14 -0500)]
fix(wallet): fix SingleRandomDraw to throw an error if insufficient funds

* fixed spelling and clippy errors
* updated tests to check for error variant instead of a panic

15 months agoMerge bitcoindevkit/bdk#1581: Allow custom fallback algorithm for bnb
merge-script [Thu, 12 Sep 2024 13:46:44 +0000 (21:46 +0800)]
Merge bitcoindevkit/bdk#1581: Allow custom fallback algorithm for bnb

65be4ead03126430ab47bf192d0de0db1b1b883a test(coin_selection): add test for deterministic utxo selection (Steve Myers)
c18204d05925c4398e139c6e62c9640dacb67e17 feat(wallet)!: allow custom fallback algorithm for bnb (志宇)

Pull request description:

  ### Description

  This allows the caller to set a custom fallback algorithm when using `BranchAndBoundCoinSelection`. Previously, you were forced into using `SingleRandomDraw`.

  Signature of `CoinSelectionAlgorithm::coin_select` has been changed to take in a `&mut RangCore`. This allows us to pass the random number generator directly to the cs algorithm.

  Single random draw is now it's own type `SingleRandomDraw` and impls `CoinSelectionAlgorithm`.

  `BranchAndBoundCoinSelection` now handles it's own fallback algorithm internally, and a generic type parameter is added to specify the fallback algorithm.

  `coin_selection::Error` is renamed to `InsufficientFunds` and the BnB error variants are removed. The BnB error variants are no longer needed since those cases are handled internally by `BranchAndBoundCoinSelection` (via calling the fallback algorithm).

  ### Notes to the reviewers

  This is breaking change. Not sure how useful this is for our users. If it's deemed useful, consider including in beta.

  ### Changelog notice

  * Changed `CoinSelectionAlgorithm::coin_select` to take in an additional `&mut RangCore` variable. This allows us to pass a random number generator directly to the cs algorithm.
  * Added `SingeRandomDraw` type which impls `CoinSelectAlgorithm`.
  * Changed `BranchAndBoundCoinSelection` to call the fallback internally. An additional generic parameter is added set this.
  * Changed `coin_selection::Error` to `coin_selection::InsufficientFunds` (which is now a struct) and therefore removing bnb error variants.

  ### 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:
  oleonardolima:
    utACK 65be4ead03126430ab47bf192d0de0db1b1b883a
  evanlinjin:
    self-ACK 65be4ead03126430ab47bf192d0de0db1b1b883a

Tree-SHA512: 3699b65dd3e9b20ad5872a05321a54d0ece61ad582eabe340d4dafbf971cf23bf46b0daa7d1284ec7bc7472d52d54cfa592c9e869ace6e35b8a9dc6938c297a3

15 months agofix(core): calling `CheckPoint::insert` with existing block must succeed
志宇 [Thu, 12 Sep 2024 08:44:21 +0000 (16:44 +0800)]
fix(core): calling `CheckPoint::insert` with existing block must succeed

Previously, we were panicking when the caller tried to insert a block at
height 0. However, this should succeed if the block hash does not
change.

15 months agoMerge bitcoindevkit/bdk#1561: refactor(bdk_hwi): remove `bdk_hwi`, as `HWISigner...
Steve Myers [Wed, 11 Sep 2024 19:37:37 +0000 (14:37 -0500)]
Merge bitcoindevkit/bdk#1561: refactor(bdk_hwi): remove `bdk_hwi`, as `HWISigner`'s being moved to `rust-hwi`

cd8ddfe18441c562342bcaccf7cae3a0d9ebbd92 chore: remove `ci/automation.json` file, used by Dockerfile.ledger (Leonardo Lima)
75c97a6018033bbeaeeba6b69ca74b67dc47161d fix(ci)!: remove `Dockerfile.ledger` and `hwi` steps from coverage step (Leonardo Lima)
b118b82fb08ee661ac10ac1771640b0965cf1ee8 refactor(bdk_hwi)!: remove `bdk_hwi` (Leonardo Lima)
43257cfca6c8c2a3d5dc2b78da455ff9f16da5bd refactor(wallet)!: remove dangling unused `hardwaresigner.rs` file (Leonardo Lima)

Pull request description:

  <!-- You can erase any parts of this template not applicable to your Pull Request. -->
  fixes #1516
  depends on https://github.com/bitcoindevkit/rust-hwi/pull/104

  ### Description

  <!-- Describe the purpose of this PR, what's being adding and/or fixed -->

  This PR removed the `bdk_hwi` crate, and the dangling `hardwaresigner.rs` file from `bdk_wallet` crate.

  It simplifies the BDK project workspace as it removes the dependency on `rust-hwi`, pyo3 and some required steps on CI.

  The removal is fine, as the `HWISigner` is being moved to `rust-hwi` project instead, please check: https://github.com/bitcoindevkit/rust-hwi/pull/104

  ### Notes to the reviewers

  <!-- In this section you can include notes directed to the reviewers, like explaining why some parts
  of the PR were done in a specific way -->

  Please let me know what you think about the removal, and if I missed anything.

  ### Changelog notice

  <!-- Notice the release manager should include in the release tag message changelog -->
  <!-- See https://keepachangelog.com/en/1.0.0/ for examples -->

  - Removed dangling unused `hardwaresigner.rs` file from `bdk_wallet` crate.
  - Removed `bdk_hwi` crate, moved to `rust-hwi` project.

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

  #### Bugfixes:

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

ACKs for top commit:
  notmandatory:
    ACK cd8ddfe18441c562342bcaccf7cae3a0d9ebbd92

Tree-SHA512: 43fe716a3f107ae806b1c9bf83bd0a9f403d3c331443d78c9c4c55ac995577fd8b02ba13b77bbadb72b329e0fc94c22a7a9c8b2478ecad303d2c8db28393da2d

15 months agotest(coin_selection): add test for deterministic utxo selection
Steve Myers [Wed, 11 Sep 2024 02:38:06 +0000 (21:38 -0500)]
test(coin_selection): add test for deterministic utxo selection

Added back ignored branch and bounnd tests and cleaned up calculation for target amounts.

15 months agochore: remove `ci/automation.json` file, used by Dockerfile.ledger
Leonardo Lima [Wed, 11 Sep 2024 16:10:25 +0000 (13:10 -0300)]
chore: remove `ci/automation.json` file, used by Dockerfile.ledger

15 months agofix(ci)!: remove `Dockerfile.ledger` and `hwi` steps from coverage step
Leonardo Lima [Fri, 16 Aug 2024 01:09:37 +0000 (22:09 -0300)]
fix(ci)!: remove `Dockerfile.ledger` and `hwi` steps from coverage step

15 months agorefactor(bdk_hwi)!: remove `bdk_hwi`
Leonardo Lima [Fri, 16 Aug 2024 00:59:29 +0000 (21:59 -0300)]
refactor(bdk_hwi)!: remove `bdk_hwi`

- removes `bdk_hwi` crate, as `HWISigner`'s being moved to
rust-hwi.
- please refer to: https://github.com/bitcoindevkit/rust-hwi/pull/104

15 months agorefactor(wallet)!: remove dangling unused `hardwaresigner.rs` file
Leonardo Lima [Fri, 16 Aug 2024 00:41:29 +0000 (21:41 -0300)]
refactor(wallet)!: remove dangling unused `hardwaresigner.rs` file

It seems this file was left out on the previous migration from hardware
signers from `bdk_wallet` crate to the `bdk_hwi`, but it should've been
removed.

15 months agoMerge bitcoindevkit/bdk#1597: fix(wallet): do `check_wallet_descriptor` when creating...
Steve Myers [Wed, 11 Sep 2024 14:19:51 +0000 (09:19 -0500)]
Merge bitcoindevkit/bdk#1597: fix(wallet): do `check_wallet_descriptor` when creating and loading

5aecf4d6c48b75e610bbb9e31ad552878d797b5c fix(wallet): do `check_wallet_descriptor` when creating and loading (valued mammal)

Pull request description:

  Do `check_wallet_descriptor` for both external and internal descriptors when creating a wallet, and as a defensive measure also perform the check on the descriptors loaded from a changeset.

  fixes #1557

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

Tree-SHA512: c1503cc0350894cff762925276a2b5b94ac07155df8ff85c9277fb33001bc3137f479f1b8b1c5da4401a6a1b7184467915558e1fa761ae7ccef5d8886103cdad

15 months agoMerge bitcoindevkit/bdk#1599: fix: typos
Steve Myers [Wed, 11 Sep 2024 14:09:58 +0000 (09:09 -0500)]
Merge bitcoindevkit/bdk#1599: fix: typos

bc83e41126b75c32374a4fa6ba054c114ee62704 fix: typos (Jose Storopoli)

Pull request description:

  <!-- You can erase any parts of this template not applicable to your Pull Request. -->

  ### Description

  more typos caught up during rebasing of #1320.

  ### Notes to the reviewers

  ### Changelog notice

  <!-- Notice the release manager should include in the release tag message changelog -->
  <!-- See https://keepachangelog.com/en/1.0.0/ for examples -->

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

  #### Bugfixes:

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

ACKs for top commit:
  LagginTimes:
    ACK bc83e41126b75c32374a4fa6ba054c114ee62704
  oleonardolima:
    ACK bc83e41126b75c32374a4fa6ba054c114ee62704
  thunderbiscuit:
    ACK bc83e41126b75c32374a4fa6ba054c114ee62704.

Tree-SHA512: 1dc76d64ddb0273c60899a6617dcbc63fab75057447080260b7050bb5d178ef56c6f79f2c7f1ca5b7b4eb09e2b1e67d782be91598ab58e6a3b3179d6b5edf5c5

15 months agofeat(wallet)!: allow custom fallback algorithm for bnb
志宇 [Wed, 28 Aug 2024 09:49:55 +0000 (09:49 +0000)]
feat(wallet)!: allow custom fallback algorithm for bnb

Signature of `CoinSelectionAlgorithm::coin_select` has been changed to
take in a `&mut RangCore`. This allows us to pass the random number
generator directly to the cs algorithm.

Single random draw is now it's own type `SingleRandomDraw` and impls
`CoinSelectionAlgorithm`.

`BranchAndBoundCoinSelection` now handles it's own fallback algorithm
internally, and a generic type parameter is added to specify the
fallback algorithm.

`coin_selection::Error` is renamed to `InsufficientFunds` and the BnB
error variants are removed. The BnB error variants are no longer needed
since those cases are handled internally by
`BranchAndBoundCoinSelection` (via calling the fallback algorithm).

Add test_bnb_fallback_algorithm test and docs cleanup suggested by @ValuedMammal.

15 months agofix: typos
Jose Storopoli [Tue, 10 Sep 2024 09:51:36 +0000 (09:51 +0000)]
fix: typos

15 months agoMerge bitcoindevkit/bdk#1586: Change methods of `IndexedTxGraph`/`TxGraph`/`Wallet...
Steve Myers [Mon, 9 Sep 2024 19:58:20 +0000 (14:58 -0500)]
Merge bitcoindevkit/bdk#1586: Change methods of `IndexedTxGraph`/`TxGraph`/`Wallet` that insert txs to be more generic

87e61212f556bccfaa2a64b74f727cedc0f70e9c feat(chain,wallet)!: change methods to take in generic instead of `&Transaction` (志宇)
c39284d8299c5a8b34b73ce947e93425d5cdc121 feat(wallet): make `Wallet::insert_tx` generic (志宇)
67d5fa695f3f748d176c182d25be5ef70f5127ed feat(chain): make various insert tx methods more generic (志宇)

Pull request description:

  ### Description

  We want to reuse the `Arc` pointer whenever possible. However, some methods on `TxGraph` and `IndexedTxGraph` that insert transactions take in `&Transaction` or `Transaction` (thus forcing us to create a new `Arc<Transaction>` internally by cloning, even if the input tx is under a `Arc`).

  This PR changes these methods to take in a generic parameter, `T: Into<Arc<Transaction>>`, allowing us to reuse the `Arc` pointer whenever possible.

  ### Notes to the reviewers

  Methods that previously took in `Transaction` can be changed to take in `T: Into<Arc<Transaction>>` and be non-breaking (since `Arc<T>` impls `From<T>` automatically). These changes are contained in the first two commits.

  Methods that previously took in `&Transaction` will break. However, I think these api changes are small and the improvements are substantial enough to be worth it. These changes are contained in the last commit.

  ### Changelog notice

  * Changed `IndexedTxGraph` methods `insert_tx`, `batch_insert_relevant`, `batch_insert_relevant_unconfirmed`, `batch_insert_unconfirmed` to take in `T: Into<Arc<Transaction>>` instead of `Transaction` or `&Transaction`.
  * Changed `TxGraph` method `batch_insert_unconfirmed` to take in `T: Into<Arc<Transaction>>` instead of `Transaction`.
  * Changed `Wallet` methods `insert_tx`, `apply_unconfirmed_txs` to take in `T: Into<Arc<Transaction>>` instead of `Transaction` or `&Transaction`.

  ### 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:
  oleonardolima:
    utACK 87e61212f556bccfaa2a64b74f727cedc0f70e9c
  notmandatory:
    ACK 87e61212f556bccfaa2a64b74f727cedc0f70e9c

Tree-SHA512: 6be8cde80984caaaf544fa5738bc4de39428cd4cd352d242ecb73d7cf2e69794c869249e76653a32a47bb5d19e4b3a47036e063cdd32ad47642b44c99cb7ee7c

15 months agoMerge bitcoindevkit/bdk#1595: refactor(wallet): use `Amount` everywhere
Steve Myers [Mon, 9 Sep 2024 19:34:00 +0000 (14:34 -0500)]
Merge bitcoindevkit/bdk#1595: refactor(wallet): use `Amount` everywhere

292ec3cb3a41d7b9f42cfea536c39b27dba16d4c refactor(wallet): use `Amount` everywhere (valued mammal)

Pull request description:

  This is a followup to #1426 that refactors wallet internals to use `bitcoin::Amount` (nearly) everywhere. I chose not to change any public types in `coin_selection.rs` that still use `u64` as that might require more discussion.

  partially addresses #1432
  fixes #1434

  ### 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:
  oleonardolima:
    ACK 292ec3cb3a41d7b9f42cfea536c39b27dba16d4c
  notmandatory:
    ACK 292ec3cb3a41d7b9f42cfea536c39b27dba16d4c

Tree-SHA512: e84c543e796e151803321ad238023bd5f446448b4430dd6c62929180d159ee1ef867e98f69a4ef3b152c3146b8e30bbf01ce7952ac00b726847a224dca7e3be4

15 months agoMerge bitcoindevkit/bdk#1579: fix(wallet): only mark change address used if `create_t...
Steve Myers [Mon, 9 Sep 2024 16:31:42 +0000 (11:31 -0500)]
Merge bitcoindevkit/bdk#1579: fix(wallet): only mark change address used if `create_tx` succeeds

606fa0874db0f10cd1c64de0f1f097b12db3a16d ci: bump actions/upload-artifact to v4 (valued mammal)
75989d8cde3902f226bfa89aae05803b93a7cf1d test(wallet): Add `test_create_tx_increment_change_index` (valued mammal)
b60d1d29cb8908c354b43c49237acbea373c3dc7 fix(wallet): only mark change address used if `create_tx` succeeds (valued mammal)

Pull request description:

  If no drain script is specified in tx params then we get it from the change keychain by looking at the next unused address. Before this PR we marked the index used regardless of whether a change output is finally added. Then if creating a psbt failed, we never restored the unused status of the change address, so creating the next tx would have revealed an extra one.

  We want to mark the change address used so that other callers won't attempt to use the same address between the time we create the tx and when it appears on chain. With this PR we only mark the change address used if we successfully create a psbt and the drain script is used in the change output.

  fixes #1578

  ### Notes to the reviewers

  An early idea was to unmark the change address used if we fail to create a tx due to `InsufficientFunds`, but after looking into it I figure it doesn't totally make sense to mark the address used before we've determined that a change output is necessary. Further, `create_tx` can fail in other ways besides running coin selection, so I moved the `mark_used` logic to the end of the function.

  ### Changelog notice

  Fixed an issue that caused an unused internal address to be skipped when creating transactions (#1578)

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

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

ACKs for top commit:
  notmandatory:
    ACK 606fa0874db0f10cd1c64de0f1f097b12db3a16d

Tree-SHA512: 4715494d901efccff38d636f0538f193ff32db1de44f8d56a98bb0136483f3a8ce1315901bb98117d6870d5b7e4a3bdf3d208f005e2adc0b29625f84a9e8974e

15 months agoci: bump actions/upload-artifact to v4
valued mammal [Mon, 9 Sep 2024 15:51:11 +0000 (11:51 -0400)]
ci: bump actions/upload-artifact to v4

15 months agotest(wallet): Add `test_create_tx_increment_change_index`
valued mammal [Tue, 27 Aug 2024 16:24:41 +0000 (12:24 -0400)]
test(wallet): Add `test_create_tx_increment_change_index`

15 months agofix(wallet): only mark change address used if `create_tx` succeeds
valued mammal [Tue, 27 Aug 2024 15:54:25 +0000 (11:54 -0400)]
fix(wallet): only mark change address used if `create_tx` succeeds

If no drain script is specified in tx params then we get it from
the change keychain by looking at the next unused address. We want
to mark the change address used so that other callers won't attempt
to use the same address between the time we create the tx and when
it appears on chain.

Before, we marked the index used regardless of whether a change
output is finally added. Then if creating a PSBT failed, we never
restored the unused status of the change address, so creating the
next tx would have revealed an extra one. Now we only mark the change
address used if we successfully create a PSBT and the drain script
is used in the change output.

15 months agofix(wallet): do `check_wallet_descriptor` when creating and loading
valued mammal [Sat, 31 Aug 2024 17:02:25 +0000 (13:02 -0400)]
fix(wallet): do `check_wallet_descriptor` when creating and loading

15 months agodoc(wallet): Add docs to explain the lookahead
valued mammal [Fri, 6 Sep 2024 18:24:00 +0000 (14:24 -0400)]
doc(wallet): Add docs to explain the lookahead

15 months agorefactor(wallet): use `Amount` everywhere
valued mammal [Sat, 7 Sep 2024 23:21:04 +0000 (19:21 -0400)]
refactor(wallet): use `Amount` everywhere

15 months agoMerge bitcoindevkit/bdk#1584: docs: update CONTRIBUTING.md
Steve Myers [Thu, 5 Sep 2024 17:30:44 +0000 (12:30 -0500)]
Merge bitcoindevkit/bdk#1584: docs: update CONTRIBUTING.md

6b881f8ab46bd0f3c612e522df21dc48ae5e6955 docs: update CONTRIBUTING.md (valued mammal)

Pull request description:

  Update `CONTRIBUTING.md`

  * Made small corrections and added some things that were missing. If there's something else you think should be included let me know.

  closes #1394

  ### Changelog notice

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

ACKs for top commit:
  LagginTimes:
    ACK 6b881f8ab46bd0f3c612e522df21dc48ae5e6955
  notmandatory:
    ACK 6b881f8ab46bd0f3c612e522df21dc48ae5e6955
  storopoli:
    ACK 6b881f8ab46bd0f3c612e522df21dc48ae5e6955
  oleonardolima:
    ACK 6b881f8ab46bd0f3c612e522df21dc48ae5e6955

Tree-SHA512: 9a000cb86800e8dac582e2bab06613c28111268fa343d8621181e8bf1b4859029704d1258392248449c36af9dd5ecf8ab25dadfe5bcf62e40e10719a575d3b64

15 months agoMerge bitcoindevkit/bdk#1477: feat(wallet): add transactions_sort_by function
Steve Myers [Thu, 5 Sep 2024 05:03:05 +0000 (00:03 -0500)]
Merge bitcoindevkit/bdk#1477: feat(wallet): add transactions_sort_by function

83a0247e8ea6afd8329af5dd9b28f9892bd5e9c1 feat(wallet): add transactions_sort_by function (Steve Myers)

Pull request description:

  ### Description

  Added new type alias `WalletTx` which represents a `CanonicalTx<'a, Arc<Transaction>, ConfirmationTimeHeightAnchor>` and new `Wallet::transactions_sort_by` that returns a `Vec<WalletTx>` sorted by the given compare function.

  ### Notes to the reviewers

  fixes #794

  ### Changelog notice

  * Add new type alias `WalletTx` which represents a `CanonicalTx<'a, Arc<Transaction>, ConfirmationTimeHeightAnchor>`.
  * Add `Wallet::transactions_sort_by()` that returns a `Vec<WalletTx>` sorted by a given compare function.

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

Top commit has no ACKs.

Tree-SHA512: 5758b5edf8200b5534b7a7f538de640e85083bed3da2585109190f0efda3e238f5483d4a2dc073dc4b907644f58b7158a922ebe09d03a47201030162d4b0f4d3

15 months agofeat(wallet): add transactions_sort_by function
Steve Myers [Tue, 18 Jun 2024 01:48:03 +0000 (20:48 -0500)]
feat(wallet): add transactions_sort_by function

Added type WalletTx<'a> as an alias for CanonicalTx<'a, Arc<Transaction>, ConfirmationBlockTime>.

15 months agoMerge bitcoindevkit/bdk#1590: ci: pin `tokio-util` dependency version to build with...
merge-script [Thu, 5 Sep 2024 04:06:44 +0000 (12:06 +0800)]
Merge bitcoindevkit/bdk#1590: ci: pin `tokio-util` dependency version to build with rust 1.63

ea6876b70eb2b1ca9ee73e5719f1a9850e11827c ci: pin `tokio-util` dependency version to build with rust 1.63 (Wei Chen)

Pull request description:

  <!-- You can erase any parts of this template not applicable to your Pull Request. -->

  ### Description

  <!-- Describe the purpose of this PR, what's being adding and/or fixed -->
  `tokio-util` version 0.7.12 raised `msrv` to 1.70.
  The previous version 0.7.11 was pinned to CI to continue working.

  ### Notes to the reviewers

  <!-- In this section you can include notes directed to the reviewers, like explaining why some parts
  of the PR were done in a specific way -->

  ### Changelog notice

  <!-- Notice the release manager should include in the release tag message changelog -->
  <!-- See https://keepachangelog.com/en/1.0.0/ for examples -->
  * Pinned tokio-util dependency version to build with rust 1.63.

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

Tree-SHA512: f200dc753fabe993bf926506e213d16050808b00eeb9c2d36fbd45cb62e0611300c660839ea37e17b0513cba2a5da48321e186d173d2871b45d2fce266f4f2b0

15 months agoci: pin `tokio-util` dependency version to build with rust 1.63
Wei Chen [Thu, 5 Sep 2024 03:50:48 +0000 (11:50 +0800)]
ci: pin `tokio-util` dependency version to build with rust 1.63

15 months agoMerge pull request #1587 from evanlinjin/tx_update_map_anchors
Lloyd Fournier [Wed, 4 Sep 2024 23:14:44 +0000 (09:14 +1000)]
Merge pull request #1587 from evanlinjin/tx_update_map_anchors

feat(core): add `TxUpdate::map_anchors`

15 months agofeat(core): add `TxUpdate::map_anchors`
志宇 [Tue, 3 Sep 2024 07:28:27 +0000 (15:28 +0800)]
feat(core): add `TxUpdate::map_anchors`

15 months agofeat(chain,wallet)!: change methods to take in generic instead of `&Transaction`
志宇 [Mon, 2 Sep 2024 09:59:09 +0000 (17:59 +0800)]
feat(chain,wallet)!: change methods to take in generic instead of `&Transaction`

* `Wallet::apply_unconfirmed_txs`
* `IndexedTxGraph::batch_insert_relevant`
* `IndexedTxGraph::batch_insert_relevant_unconfirmed`

15 months agofeat(wallet): make `Wallet::insert_tx` generic
志宇 [Tue, 3 Sep 2024 05:18:20 +0000 (13:18 +0800)]
feat(wallet): make `Wallet::insert_tx` generic

Instead of having `Transaction` as input, have
`T: Into<Arc<Transaction>>`.

15 months agofeat(chain): make various insert tx methods more generic
志宇 [Mon, 2 Sep 2024 09:32:19 +0000 (17:32 +0800)]
feat(chain): make various insert tx methods more generic

Instead of having `Transaction` as input, we have a generic parameter
where the bound is `Into<Arc<Transaction>>` for the following methods:

* `IndexedTxGraph::insert_tx`
* `IndexedTxGraph::batch_insert_unconfirmed`
* `TxGraph::batch_insert_unconfirmed`

15 months agodocs: update CONTRIBUTING.md
valued mammal [Fri, 30 Aug 2024 18:09:33 +0000 (14:09 -0400)]
docs: update CONTRIBUTING.md

15 months agoMerge bitcoindevkit/bdk#1580: ci: add token for cron-update-rust.yml
Steve Myers [Fri, 30 Aug 2024 15:27:00 +0000 (10:27 -0500)]
Merge bitcoindevkit/bdk#1580: ci: add token for cron-update-rust.yml

b140b32648241884e0e5e222fd7a0fc4e05908f1 ci: gpg commit signing for cron-update-rust.yml (Steve Myers)
054d1483bb19e8415745033853ae0fa6943f01d9 ci: add token for cron-update-rust.yml (Steve Myers)

Pull request description:

  ### Description

  Add organization app token and GPG signing key for cron-update-rust.yml.

  ### Notes to the reviewers

  I went with the organization github app token option mentioned here:
  https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs

  I added gpg commit signing with below instructions. The instructions say to use PAT for signing but the plugin doesn't mention it's needed so I want to try it with only the github app token.
  https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#gpg-commit-signature-verification

ACKs for top commit:
  oleonardolima:
    ACK b140b32648241884e0e5e222fd7a0fc4e05908f1
  ValuedMammal:
    ACK b140b32648241884e0e5e222fd7a0fc4e05908f1

Tree-SHA512: 0730264ccd39645bbfe496abb43e5ac4c16de1ca9032ede4310ec190c4441152fa8adef09cf73c28c9b547d0de41e34431df88deba7d706389df564907081583

15 months agoMerge bitcoindevkit/bdk#1425: chore: add `print_stdout`/`print_stderr` lints to works...
Steve Myers [Thu, 29 Aug 2024 14:49:39 +0000 (09:49 -0500)]
Merge bitcoindevkit/bdk#1425: chore: add `print_stdout`/`print_stderr` lints to workspace level

e063ad89bde62e60b10435260e736c66515bf447 fix(esplora+wallet+file_store): remove remaining `println!` usage (Leonardo Lima)
b32b9447e089709b66f24d5700750f0aa6b8d6e1 chore(examples): allow `clippy::print_stdout` in examples (Leonardo Lima)
b614237127ec1e760414fcc8ee7c4b0c77c62d46 fix(tests)!: remove println! usage from tests (Leonardo Lima)
eaa1917a46245e177ad3e65b53e34c681f0043d0 chore: add `print_stdout`/`print_stderr` lints to workspace level (Leonardo Lima)

Pull request description:

  potentially fixes #1362
  <!-- You can erase any parts of this template not applicable to your Pull Request. -->

  ### Description

  It adds both `print_stdout` and `print_stderr` deny level lints on workspace level, but it does allow it on test fns through `clippy.toml` settings, and explicitly allow it on example code.

  <!-- Describe the purpose of this PR, what's being adding and/or fixed -->

  ### Notes to the reviewers
  It currently has the setting allowing it on test fns, but open for discussion below.

  <!-- In this section you can include notes directed to the reviewers, like explaining why some parts
  of the PR were done in a specific way -->

  ### Changelog notice

  - Add both `print_stdout` and `print_stderr` deny level lints on workspace level

  <!-- Notice the release manager should include in the release tag message changelog -->
  <!-- See https://keepachangelog.com/en/1.0.0/ for examples -->

  ### 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:
  notmandatory:
    ACK e063ad89bde62e60b10435260e736c66515bf447

Tree-SHA512: b3348efd86d09944eb36e4d87799eebc23f4e423861b3bad08365d286449f61b29ad332157eecfb7307191ef61d3b8285341e0ccb868581e54b570d6dd37547c

15 months agoci: gpg commit signing for cron-update-rust.yml
Steve Myers [Wed, 28 Aug 2024 04:54:01 +0000 (23:54 -0500)]
ci: gpg commit signing for cron-update-rust.yml

15 months agoci: add token for cron-update-rust.yml
Steve Myers [Wed, 28 Aug 2024 04:07:48 +0000 (23:07 -0500)]
ci: add token for cron-update-rust.yml

15 months agoMerge bitcoindevkit/bdk#1573: chore: add missing bdk_core README.md and remove specif... v1.0.0-beta.2
Steve Myers [Sun, 25 Aug 2024 17:56:49 +0000 (12:56 -0500)]
Merge bitcoindevkit/bdk#1573: chore: add missing bdk_core README.md and remove specific bdk_chain dev version

48b6a66f6e0edce305d41653f37b8549aaf7c060 chore(core): remove bdk_chain dev-dependency version (Steve Myers)
9bd500f5f198df4dfc72a1f71c93f9b20d65431d chore(core): add missing README.md (Steve Myers)

Pull request description:

  Add the missing README.md file for the bdk_core crate. This is required to publish to crates.io.

  Also had to removed fixed bdk_chain version from bdk_core dev dependencies to prevent missing dependency when publishing bdk_core before publishing new version of bdk_chain.

ACKs for top commit:
  ValuedMammal:
    ACK 48b6a66f6e0edce305d41653f37b8549aaf7c060

Tree-SHA512: 5fb31984f79771c5366ca078efa11330b24fd4d97e90531a2ba8f92ce6361c6dd4f123e8640269de9235bc5ebf3e6b5ced261e36f5b40f01db3f82add9a5ae68

15 months agochore(core): remove bdk_chain dev-dependency version
Steve Myers [Sun, 25 Aug 2024 17:25:23 +0000 (12:25 -0500)]
chore(core): remove bdk_chain dev-dependency version

15 months agochore(core): add missing README.md
Steve Myers [Sun, 25 Aug 2024 17:19:36 +0000 (12:19 -0500)]
chore(core): add missing README.md

15 months agoMerge bitcoindevkit/bdk#1572: Bump bdk version to 1.0.0-beta.2
Steve Myers [Sun, 25 Aug 2024 16:01:16 +0000 (11:01 -0500)]
Merge bitcoindevkit/bdk#1572: Bump bdk version to 1.0.0-beta.2

092e9be454b3f1f4754f3fefb70b203d7e86c423 Bump bdk version to 1.0.0-beta.2 (Steve Myers)

Pull request description:

  Bump versions for bdk 1.0.0-beta.2 release:

  bdk version to 1.0.0-beta.2
  bdk_chain to 0.18.0
  bdk_bitcoind_rpc to 0.14.0
  bdk_electrum to 0.17.0
  bdk_esplora to 0.17.0
  bdk_file_store to 0.15.0
  bdk_testenv to 0.8.0
  bdk_hwi to 0.5.0

ACKs for top commit:
  ValuedMammal:
    ACK 092e9be454b3f1f4754f3fefb70b203d7e86c423

Tree-SHA512: 39f5cb6efd413ac5efc1736176bf846a727f22f2dcabcae97e726f6793e0b8586358193531aca9118f141e313f21a3f63b6b3ed13343df40940d8435ab6264f3

15 months agoBump bdk version to 1.0.0-beta.2
Steve Myers [Sun, 25 Aug 2024 15:13:59 +0000 (10:13 -0500)]
Bump bdk version to 1.0.0-beta.2

bdk_chain to 0.18.0
bdk_bitcoind_rpc to 0.14.0
bdk_electrum to 0.17.0
bdk_esplora to 0.17.0
bdk_file_store to 0.15.0
bdk_testenv to 0.8.0
bdk_hwi to 0.5.0

15 months agoMerge bitcoindevkit/bdk#1569: Introduce `bdk_core`
志宇 [Sun, 25 Aug 2024 13:34:02 +0000 (13:34 +0000)]
Merge bitcoindevkit/bdk#1569: Introduce `bdk_core`

a5d076f215cd91173f55bda0d1cc59b9dde75511 chore(core)!: s/tx_graph::Update/TxUpdate/ (LLFourn)
dafb9aaef7d8d4bc83c8ba0845323b92b82fbb3d feat(bitcoind_rpc)!: depend on `bdk_core` instead of `bdk_chain` (志宇)
fea8eede760130db32c2cfaecc272f6c1ed979db feat(esplora)!: depend on `bdk_core` instead of `bdk_chain` (志宇)
0d302f5f204eeac8902a4b5943b9b820c6b575ab feat(electrum)!: depend on `bdk_core` instead of `bdk_chain` (志宇)
ab0315d14fa741a691ee0deef4567ea66cb44a60 feat!: move `spk_client`s to `bdk_core` (志宇)
bdea871a0d0d337772f226fdcf5cd734f3d857ba feat!: move `tx_graph::Update` to `bdk_core` (志宇)
77e31c71a5edc011df42daece1920903bc2b866f feat!: move `CheckPoint` to `bdk_core` (志宇)
a86c878a60f40ce30ab00c0b47fa6cddf30cfe30 refactor(chain): change `CheckPoint::apply_changeset` (志宇)
6f7626ad0bb6ca7e45428af11dbf930d746d9cd0 feat!: introduce `bdk_core` (志宇)

Pull request description:

  Based on #1568
  Closes #1543

  ### Description

  Introduce `bdk_core` crate. Move types over from `bdk_chain`. Chain sources (`bdk_electrum`, `bdk_esplora` and `bdk_bitcoind_rpc`) now only depend on `bdk_core`.

  ### Notes to the reviewers

  Please review commit-by-commit. I've moved things over, but slight API changes were necessary (mentioned in the commit messages).

  ### Changelog notice

  * Add `bdk_core` crate which contains core types that were previously in `bdk_chain`. Including: `BlockId`, `ConfirmationBlockTime`, `CheckPoint`, `CheckPointIter`, `tx_graph::Update` and `spk_client`-types.
  * Change chain sources (`bdk_esplora`, `bdk_electrum` and `bdk_bitcoind_rpc`) to only depend on `bdk_core`.

  ### 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:
  LLFourn:
    Self-ACK: a5d076f215cd91173f55bda0d1cc59b9dde75511
  evanlinjin:
    ACK a5d076f215cd91173f55bda0d1cc59b9dde75511

Tree-SHA512: 13ecd0a2d2fc840b281977f07dc11fed27459f77c676af470134d2184db4a1fc352073ef82b1622e04fc60edb885e587ae8b9909c9bafb4ae63fcd51325d1cad

15 months agochore(core)!: s/tx_graph::Update/TxUpdate/
LLFourn [Sun, 25 Aug 2024 05:35:18 +0000 (15:35 +1000)]
chore(core)!: s/tx_graph::Update/TxUpdate/

We shouldn't refer to `tx_graph` in `bdk_core`. TxGraph happens to
consume `Update` but it doesn't conceptually own the definition of an
update to transactions.

I tried to also remove a lot of references to "graph" where they
shouldn't be. "graph" is a very general kind of data structure so we
should avoid referring to it where it's not relevant. `tx_update` is
much better than `graph_update`.

15 months agoMerge pull request #1568 from evanlinjin/tx_graph_update
Lloyd Fournier [Sun, 25 Aug 2024 04:26:01 +0000 (14:26 +1000)]
Merge pull request #1568 from evanlinjin/tx_graph_update

Introduce `tx_graph::Update` and simplify `TxGraph` update logic

15 months agofeat(bitcoind_rpc)!: depend on `bdk_core` instead of `bdk_chain`
志宇 [Fri, 23 Aug 2024 18:38:55 +0000 (18:38 +0000)]
feat(bitcoind_rpc)!: depend on `bdk_core` instead of `bdk_chain`

15 months agofeat(esplora)!: depend on `bdk_core` instead of `bdk_chain`
志宇 [Fri, 23 Aug 2024 18:36:07 +0000 (18:36 +0000)]
feat(esplora)!: depend on `bdk_core` instead of `bdk_chain`

Helper methods have been changed to use concrete types (instead of
`A: Anchor` generic) - since `Anchor` is still part of `bdk_chain`.

Also fix esplora docs.

15 months agofeat(electrum)!: depend on `bdk_core` instead of `bdk_chain`
志宇 [Fri, 23 Aug 2024 18:26:28 +0000 (18:26 +0000)]
feat(electrum)!: depend on `bdk_core` instead of `bdk_chain`

`.populate_tx_cache` has been changed to take in a collection of
`Arc<Transaction>`.

15 months agofeat!: move `spk_client`s to `bdk_core`
志宇 [Fri, 23 Aug 2024 18:12:46 +0000 (18:12 +0000)]
feat!: move `spk_client`s to `bdk_core`

Also introduced extension trait for builder methods that take in a
`KeychainTxOutIndex`.

`Indexed<T>` and `KeychainIndexed<T>` are also moved to `bdk_core`.

15 months agofeat!: move `tx_graph::Update` to `bdk_core`
志宇 [Fri, 23 Aug 2024 16:57:59 +0000 (16:57 +0000)]
feat!: move `tx_graph::Update` to `bdk_core`

15 months agofeat!: move `CheckPoint` to `bdk_core`
志宇 [Fri, 23 Aug 2024 15:38:10 +0000 (15:38 +0000)]
feat!: move `CheckPoint` to `bdk_core`

Also add `CheckPoint::eq_ptr` which compares the internal pointers of
two `CheckPoint`s. This is used as an optimisation when comparing two
chains.

15 months agorefactor(chain): change `CheckPoint::apply_changeset`
志宇 [Fri, 23 Aug 2024 15:18:25 +0000 (15:18 +0000)]
refactor(chain): change `CheckPoint::apply_changeset`

to be a separate function: `apply_changeset_to_checkpoint`.

15 months agofeat!: introduce `bdk_core`
志宇 [Fri, 23 Aug 2024 15:08:55 +0000 (15:08 +0000)]
feat!: introduce `bdk_core`

This is an initial version with `chain_data` types ported over.

Types ported over include `BlockId`, `ConfirmationBlockTime`. The impls
for `Anchor` and `AnchorFromBlockPosition` of these types are moved to
where the traits are defined.

15 months agoMerge bitcoindevkit/bdk#1564: ci: add cron-update-rust.yml
Steve Myers [Fri, 23 Aug 2024 15:05:45 +0000 (10:05 -0500)]
Merge bitcoindevkit/bdk#1564: ci: add cron-update-rust.yml

b92f8c9ac1e000ccced89dc597a8ff278842d5ed ci: add cron-update-rust.yml (valued mammal)

Pull request description:

  This adds a cronjob to watch for updates to rust stable once a month. If the latest version changed, then a pull request is opened to see if clippy passes CI using the new toolchain.

  ### Notes to the reviewers

  Let me know what you think @notmandatory

  fixes #1431

  ### Changelog notice

  ### Checklists

  #### TODO

  * [ ] Setup access token for [create-pull-request](https://github.com/marketplace/actions/create-pull-request)

  #### 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:
  oleonardolima:
    tACK b92f8c9ac1e000ccced89dc597a8ff278842d5ed

Tree-SHA512: e251fb8d0456c30a244f4611131baea1afc4f8323a3bdc8d9536d276a8b4bb2c0269beba6b04b72ab2ea96897e421a16c3e8e6065a755d62ff98bfe13d0b02bd

15 months agotest(chain): `TxGraph` and `tx_graph::Update` conversion tests
志宇 [Fri, 23 Aug 2024 13:36:54 +0000 (13:36 +0000)]
test(chain): `TxGraph` and `tx_graph::Update` conversion tests

15 months agorevert(chain)!: rm `TxGraph::update_last_seen_unconfirmed`
志宇 [Fri, 23 Aug 2024 11:50:09 +0000 (11:50 +0000)]
revert(chain)!: rm `TxGraph::update_last_seen_unconfirmed`

This is no longer needed as `TxGraph::apply_update` now automatically
adds `seen_at` timestamps for unanchored transactions.

15 months agofeat(chain)!: `TxGraph::apply_update` auto-adds `seen_at` for unanchored
志宇 [Fri, 23 Aug 2024 09:53:42 +0000 (09:53 +0000)]
feat(chain)!: `TxGraph::apply_update` auto-adds `seen_at` for unanchored

Change `apply_update` to use the current timestamp as `seen_at` for
unanchored transactions of the update. This makes `apply_update` only
avaliable with the "std" feature.

Introduce `apply_update_at` which includes an optional `seen_at` input.
This is the no-std version of `apply_update`.

Also update docs.

15 months agodocs(chain): use `doc_cfg` feature
志宇 [Fri, 23 Aug 2024 12:14:42 +0000 (12:14 +0000)]
docs(chain): use `doc_cfg` feature

15 months agofeat!: introduce `tx_graph::Update`
志宇 [Fri, 23 Aug 2024 06:13:42 +0000 (06:13 +0000)]
feat!: introduce `tx_graph::Update`

Instead of updating a `TxGraph` with a `TxGraph`, we introduce a
dedicated data object (`tx_graph::Update`). This brings us closer to
completing #1543.

Co-authored-by: Wei Chen <wzc110@gmail.com>
15 months agoci: add cron-update-rust.yml
valued mammal [Wed, 21 Aug 2024 03:04:07 +0000 (23:04 -0400)]
ci: add cron-update-rust.yml

15 months agofeat(chain): get rid of `TxGraph::determine_changeset`
志宇 [Thu, 22 Aug 2024 08:39:08 +0000 (08:39 +0000)]
feat(chain): get rid of `TxGraph::determine_changeset`

Contain most of the insertion logic in `.insert_{}` methods, thus
simplifying `.apply_{}` methods. We can also get rid of
`.determine_changeset`.

15 months agoMerge bitcoindevkit/bdk#1562: fix(wallet)!: make `LoadParams` implicitly satisfy...
志宇 [Thu, 22 Aug 2024 06:47:48 +0000 (06:47 +0000)]
Merge bitcoindevkit/bdk#1562: fix(wallet)!: make `LoadParams` implicitly satisfy `Send`

295b9794caf142707c49666529268197694534e7 fix(wallet)!: make `LoadParams` implicitly satisfy `Send` (志宇)

Pull request description:

  ### Description

  Make `LoadParams` implicitly satisfy `Send`. This will hopefully make `AsyncWalletPersister` easier to implement.

  Refer to the [conversation on Discord](https://discord.com/channels/753336465005608961/753367451319926827/1273667818528964714).

  cc. @matthiasdebernardini

  ### Notes to the reviewers

  This is a breaking change, since we are tightening the bounds to some methods.

  ### Changelog notice

  * Change `LoadParams` to implicitly satisfy `Send`.

  ### 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:
  LLFourn:
    ACK 295b9794caf142707c49666529268197694534e7
  notmandatory:
    ACK 295b9794caf142707c49666529268197694534e7

Tree-SHA512: 952cd7fbb058166af93af0b8afa3e0f3c1afe600f5782364da8e3c74e7388ca682bab34e2c60b221055e25ade2f6ddb4a2e9451d6d181f14b0bcca053522155c