Skip to content

Deprecate list_unspent which has an unnecessary .collect()#766

Closed
evanlinjin wants to merge 1 commit intobitcoindevkit:masterfrom
evanlinjin:deprecate_list_unspent
Closed

Deprecate list_unspent which has an unnecessary .collect()#766
evanlinjin wants to merge 1 commit intobitcoindevkit:masterfrom
evanlinjin:deprecate_list_unspent

Conversation

@evanlinjin
Copy link
Member

Description

Introduce Wallet::iter_unspent, which replaces Wallet::list_unspent. Thus avoiding an unnecessary .collect() for most use cases.

Changelog notice

Introduce Wallet::iter_unspent, which replaces Wallet::list_unspent. Thus avoiding an unnecessary .collect() for most use cases.

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • 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

@evanlinjin evanlinjin self-assigned this Sep 29, 2022
@evanlinjin evanlinjin added the new feature New feature or request label Sep 29, 2022
Use `iter_unspent` instead, as it returns an iterator directly.
@evanlinjin evanlinjin force-pushed the deprecate_list_unspent branch from bbe8087 to a75b17d Compare September 29, 2022 09:24
@danielabrozzoni
Copy link
Member

Concept ACK! I just wonder, will this method change again after the bdk-core integration, or do you think it can remain the same? I'd avoid breaking this API in 0.24, and then immediately deprecate iter_unspent in 1.0
From my understanding of bdk_core, I think it can remain the same, but I might be wrong

@evanlinjin
Copy link
Member Author

Concept ACK! I just wonder, will this method change again after the bdk-core integration, or do you think it can remain the same? I'd avoid breaking this API in 0.24, and then immediately deprecate iter_unspent in 1.0 From my understanding of bdk_core, I think it can remain the same, but I might be wrong

Good point. Let's discuss later today.

@rajarshimaitra
Copy link
Contributor

Concept ACK..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants