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

Enhance coin retrieval logic in Iota client #1472

Merged

Conversation

itsyaasir
Copy link
Contributor

@itsyaasir itsyaasir commented Dec 3, 2024

Description of change

  • Introduced a constant MINIMUM_BALANCE to define the minimum balance required for transactions.
  • Updated get_coin_for_transaction method to iterate through paginated coin data, selecting the coin with the highest balance that meets the minimum requirement.
  • Improved error handling to provide clearer messages when no suitable coins are found.

Links to any relevant issues

fixes issue #1470

Type of change

Add an x to the boxes that are relevant to your changes.

  • Bug fix (a non-breaking change which fixes an issue)
  • Enhancement (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Fix

How the change has been tested

Describe the tests that you ran to verify your changes.
Make sure to provide instructions for the maintainer as well as any relevant configurations.

Change checklist

Add an x to the boxes that are relevant to your changes.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

- Introduced a constant `MINIMUM_BALANCE` to define the minimum balance required for transactions.
- Updated `get_coin_for_transaction` method to iterate through paginated coin data, selecting the coin with the highest balance that meets the minimum requirement.
- Improved error handling to provide clearer messages when no suitable coins are found.

This change optimizes the process of selecting coins for transactions, ensuring that only coins with sufficient balance are considered.
@itsyaasir itsyaasir self-assigned this Dec 3, 2024
@itsyaasir itsyaasir marked this pull request as ready for review December 3, 2024 10:43
@itsyaasir itsyaasir requested a review from a team as a code owner December 3, 2024 10:43
@itsyaasir itsyaasir added Chore Tedious, typically non-functional change No changelog Excludes PR from becoming part of any changelog Rust Related to the core Rust code. Becomes part of the Rust changelog. labels Dec 3, 2024
@itsyaasir itsyaasir requested review from wulfraem and UMR1352 December 3, 2024 13:55
@itsyaasir itsyaasir requested a review from wulfraem December 4, 2024 07:36
@UMR1352 UMR1352 merged commit 4912994 into feat/identity-rebased-alpha Dec 4, 2024
1 check passed
@UMR1352 UMR1352 deleted the chore/improve-get-coin-for-transaction branch December 4, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chore Tedious, typically non-functional change No changelog Excludes PR from becoming part of any changelog Rust Related to the core Rust code. Becomes part of the Rust changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants