-
Notifications
You must be signed in to change notification settings - Fork 48
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
fix: change target's type in fee estimate map #65
fix: change target's type in fee estimate map #65
Conversation
739a5cb
to
962d2a1
Compare
Pull Request Test Coverage Report for Build 8167049960Details
💛 - Coveralls |
cfecec7
to
053a88e
Compare
@vladimirfomene I got curious, did the CI suddenly start failing? |
053a88e
to
b2002ea
Compare
@oleonardolima is failing because some dependencies have been updated so we have to pin them to make sure we are able to build with our MSRV |
b2002ea
to
255649c
Compare
Oh, thanks! I saw that the rustls dependency version got yanked, and lead to this 😅 |
ce3f98b
to
830aa9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
@vladimirfomene through a re-review and some manual tests here, I saw that a fn and a test still expect the old parameter signature, and would need to be updated as well:
|
Please rebase to pick up changes in #69 that fix CI. |
d59775b
to
3add7f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 3add7f9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 3add7f9
3add7f9
to
82e87fb
Compare
WalkthroughThe recent updates involve modifying the Changes
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (3)
- src/async.rs (2 hunks)
- src/blocking.rs (1 hunks)
- src/lib.rs (2 hunks)
Additional comments: 4
src/blocking.rs (1)
- 284-284: The change from
String
tou16
for the key type in theHashMap
returned byget_fee_estimates
aligns with the PR objectives to match the data types used byelectrs
. This is a positive change for type safety and consistency.src/async.rs (1)
- 369-375: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [372-385]
The update in the
get_fee_estimates
method to useu16
as the key type for theHashMap
instead ofString
is consistent with the changes made in theBlockingClient
and aligns with the PR's goal to improve type safety and consistency withelectrs
. This is a commendable change.src/lib.rs (2)
- 91-97: The
convert_fee_rate
function has been updated to accept aHashMap<u16, f64>
instead ofHashMap<String, f64>
. This change aligns with the PR's objective to useu16
as the key type for fee rate estimates, ensuring type safety and consistency with the data provided byelectrs
. The logic within the function correctly handles the new key type, sorting the keys in reverse order and finding the appropriate fee rate based on the confirmation target. This change improves the usability and reliability of the library when interacting with Bitcoin's Electrum server.- 336-336: The test
feerate_parsing
has been updated to use aHashMap<u16, f64>
foresplora_fees
, reflecting the changes made to theconvert_fee_rate
function. This ensures that the test remains valid and accurately tests the functionality with the new key data type. The assertions within the test check for correct fee rate conversion based on given confirmation targets, which is essential for verifying the correctness of theconvert_fee_rate
function after the data type change.
FYI I had to rebase this since #75 was merged. |
…rate` ec5ee82 test: improve test `feerate_parsing` (valued mammal) ed219e2 fix: don't return default 1.0 feerate if not found by `convert_fee_rate` (valued mammal) Pull request description: Change `convert_fee_rate` to return `Option<f32>` instead of Result. PR #65 made this function effectively infallible by removing the parse int error while falling back to a bogus 1.0 feerate if a value isn't found in fee estimates. We could make it return an error if for example the given fee estimates map is empty without changing the function signature but in that case we would need a new `Error` variant making it a breaking change anyway, therefore just change the function to return `Option` which should only be `None` if given a target of 0 or an empty map assuming esplora always has a fee estimate for a target of 1 confirmation. fixes #80 ACKs for top commit: notmandatory: ACK ec5ee82 Tree-SHA512: 32fd2a8a57bcc1a6fb8569d779aca8a273c843d38afe6f092f0c70c7dad0ff7b37595284985ca4d3c5e253810b70857600043817fd9f928ee0c706108f8a9bcb
Fixes #64.
Summary by CodeRabbit