Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mintd: sort pks by amount in /v1/keys #406

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

ok300
Copy link
Contributor

@ok300 ok300 commented Oct 14, 2024

This PR brings two related changes:

  • it ensures the mint keys exposed in /v1/keys/{keyset_id} are sorted by amount. Before, they were sorted alphabetically for the String representation of Amounts ("123", "2", "33" vs now "2", "33", "123").
  • it simplifies the first step in Id generation, namely the sorting of pubkeys. Before, there were two conversions (Amount to String to u64) before sorting, for each PublicKey. Now, the two conversions are skipped and the keys are directly sorted by Amount.

@ok300 ok300 force-pushed the ok300-mintd-sort-keyset-keys branch from 803434b to cdded19 Compare October 14, 2024 19:57
Copy link
Collaborator

@thesimplekid thesimplekid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thesimplekid thesimplekid merged commit 4efeb7d into cashubtc:main Oct 14, 2024
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants