Make sorting Transactions a stable sort #1147

Merged
benthecarman merged 1 commit from stable-sort into main 2025-10-02 09:11:47 +00:00
benthecarman commented 2025-10-01 15:03:49 +00:00 (Migrated from github.com)

Description

If you had 2 Transactions that had the same timestamp the sort could be unstable and could cause annoying issues. Now it will compare the ids if they are equal and should always have a stable sorting implementation now.

Notes to the reviewers


Suggested CHANGELOG Updates

CHANGED

ADDED

REMOVED

FIXED

Sorting Transactions is now more stable


Checklist

### Description <!-- Describe the purpose of this PR, what's being adding and/or fixed --> If you had 2 Transactions that had the same timestamp the sort could be unstable and could cause annoying issues. Now it will compare the ids if they are equal and should always have a stable sorting implementation now. ### 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 --> ----- ### Suggested [CHANGELOG](https://github.com/cashubtc/cdk/blob/main/CHANGELOG.md) Updates <!-- Please do not edit the actual changelog but note what you changed here. --> #### CHANGED #### ADDED #### REMOVED #### FIXED Sorting `Transaction`s is now more stable ---- ### Checklist * [ ] I followed the [code style guidelines](https://github.com/cashubtc/cdk/blob/main/CODE_STYLE.md) * [ ] I ran `just final-check` before committing
davidcaseria (Migrated from github.com) approved these changes 2025-10-01 16:41:22 +00:00
thesimplekid (Migrated from github.com) approved these changes 2025-10-02 09:11:40 +00:00
thesimplekid (Migrated from github.com) left a comment

Thanks

Thanks
github-actions[bot] commented 2025-10-28 12:58:41 +00:00 (Migrated from github.com)

Successfully created backport PR for v0.13.x:

Successfully created backport PR for `v0.13.x`: - #1228
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cashubtc/cdk!1147
No description provided.