]> Untitled Git - bdk/commitdiff
Merge bitcoindevkit/bdk#1779: `transactions` method should only return relevant trans...
authorSteve Myers <steve@notmandatory.org>
Wed, 18 Dec 2024 15:25:54 +0000 (09:25 -0600)
committerSteve Myers <steve@notmandatory.org>
Wed, 18 Dec 2024 15:26:49 +0000 (09:26 -0600)
75fae3ef56be838787306fc81862eb5ae500f635 test(wallet): verify Wallet::transactions method only returns relevant txs (Steve Myers)
3e1fd2b0a2b39668e5ab29c6968e85949623e447 fix(wallet): `transactions` method should only return relevant txs (志宇)

Pull request description:

  Fixes #1239

  ### Description

  Currently the behavior of `Wallet::transactions` is not well defined and unintuitive.

  The approach taken in this PR is to make `Wallet::transactions` return what most wallets would like the caller to see (i.e. transactions that are part of the canonical history and spend from/to a tracked spk). A.k.a make the method more restrictive.

  Documentation is updated to refer the caller to the underlying `bdk_chain` structures for any over usecase.

  After #1765 gets merged, the behavior of `Wallet::transactions` will become even more unintuitive. Refer to https://github.com/bitcoindevkit/bdk/pull/1765#pullrequestreview-2503968540.

  ### Notes to the reviewers

  **Why not have multiple methods in `Wallet` that return different sets of transactions?**

  I think it's better to only provide common usecase histories from `Wallet` and I can only think of one.

  ### Changelog notice

  * Change `Wallet::transactions` to only include "relevant" transactions.

  ### 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:
  luisschwab:
    tACK 75fae3ef56be838787306fc81862eb5ae500f635
  notmandatory:
    tACK 75fae3ef56be838787306fc81862eb5ae500f635
  oleonardolima:
    tACK 75fae3ef56be838787306fc81862eb5ae500f635
  ValuedMammal:
    ACK 75fae3ef

Tree-SHA512: abf159e0c5d44842d7e0fc5ebc6829d34646fbc45d07bb145ce327f368db0e571ab7c5731a12e63258dfc74abb9d4ff1b841842de8341e0f21b5cbb2becc5e5f


Trivial merge