bdk icon indicating copy to clipboard operation
bdk copied to clipboard

Add support for custom sorting and deprecate BIP69

Open Yureien opened this issue 3 years ago • 3 comments

Description

Resolves #534.

This PR adds a way to add custom sorting functions for both inputs and outputs. BIP69 is permanently deprecated.

Notes to the reviewers

Fn was used instead of FnMut to reduce complexity, since it's inside an Arc. We can try supporting FnMut but that would also require us to use a Mutex and I'm not sure whether it's worth the added complexity.

Additionally, I cannot decide what kind of test will be good for this. Should I implement just a simple sort (like a.value.cmp(&b.value)) and test if it's in proper order?

All Submissions:

  • [x] I've signed all my commits
  • [x] I followed the contribution guidelines
  • [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
  • [x] I've updated CHANGELOG.md

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

Yureien avatar Feb 27 '22 06:02 Yureien

But I don't recall if we have decided to depreciate BIP69

Yes, the idea is to deprecate it, but never remove it. It's just to make the users aware of its issues, they will be shown a warning and they can decide if they want to keep using it or not.

afilini avatar Mar 10 '22 11:03 afilini

Hi, please rebase to pickup changes in #596. Thanks!

notmandatory avatar May 04 '22 17:05 notmandatory

Hey @Yureien, are you still working on this?

danielabrozzoni avatar Jul 27 '22 09:07 danielabrozzoni

I'm closing this PR as the author hasn't been working on it for a while. If that's not the case, and instead you wish to keep working on this, feel free to re-open it :)

danielabrozzoni avatar Nov 14 '22 14:11 danielabrozzoni