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

Ensure that fee minimum estimate is returned when no estimates #59

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

mrfelton
Copy link
Member

@mrfelton mrfelton commented Jul 15, 2024

This pull request primarily introduces a new feature to the DataProviderManager class and adds corresponding tests. The main change is the addition of a condition to handle cases when there are no fee estimates above the fee minimum. In such cases, a single estimate at the fee minimum is added. Two new tests have been added to validate this functionality.

  • src/lib/DataProviderManager.ts: Added a condition to check if the length of feeEstimates is zero. If it is, a single estimate at the fee minimum is added to feeEstimates.

Testing:

  • test/DataProviderManager-minfee.test.ts: Added two new tests. The first test checks that estimates below the fee minimum are excluded. The second test ensures that if no valid estimates are available, a single estimate at the fee minimum is returned.

@mrfelton mrfelton added the type:bug Indicates an unexpected problem or unintended behavior label Jul 15, 2024
@mrfelton mrfelton requested a review from pmilic021 July 15, 2024 16:03
@mrfelton mrfelton self-assigned this Jul 15, 2024
Comment on lines +41 to +45
const feeEstimates = {
"1": 1,
"2": 1,
"3": 1,
};
Copy link

@pmilic021 pmilic021 Jul 15, 2024

Choose a reason for hiding this comment

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

Should be empty, correct? nvm, just noticed it is all below the min

Copy link
Member Author

@mrfelton mrfelton Jul 15, 2024

Choose a reason for hiding this comment

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

The fee minimum us set at 2. So this is simulating the case where three estimates are sourced but all of them are below the min fee limit.

@mrfelton mrfelton merged commit 229429e into master Jul 15, 2024
1 check failed
@mrfelton mrfelton deleted the fix/feeminimum branch July 15, 2024 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants