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

Provide sorting method for selecting proofs to swap #387

Closed

Conversation

davidcaseria
Copy link
Contributor

@davidcaseria davidcaseria commented Oct 3, 2024

Following up on a conversation with @thesimplekid about proof selection.

The Wallet now has a single select_proofs that uses a SelectProofsOptions struct to control which proofs are selected.

One notable change is the method of selecting active proofs. The four methods are now exposed:

  • Largest: the highest value first
  • Closest: the closest in value first
  • Smallest: the smallest in value first
  • Fewest: the fewest number of proofs over the amount

crates/cdk/src/wallet/proofs.rs Outdated Show resolved Hide resolved
crates/cdk/src/wallet/proofs.rs Outdated Show resolved Hide resolved
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.

Nice work on this. Just a few comments

crates/cdk/src/wallet/proofs.rs Outdated Show resolved Hide resolved
crates/cdk/src/wallet/proofs.rs Outdated Show resolved Hide resolved
crates/cdk/src/wallet/proofs.rs Outdated Show resolved Hide resolved
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.

3 participants