bitcoindevkit / rust-esplora-client

Bitcoin Esplora API client library. Supports plaintext, TLS and Onion servers. Blocking or async.
MIT License
28 stars 44 forks source link

fix: change target's type in fee estimate map #65

Closed vladimirfomene closed 6 months ago

vladimirfomene commented 9 months ago

Fixes #64.

Summary by CodeRabbit

coveralls commented 9 months ago

Pull Request Test Coverage Report for Build 8167049960

Details


Totals Coverage Status
Change from base Build 8166942496: -0.04%
Covered Lines: 909
Relevant Lines: 1072

💛 - Coveralls
oleonardolima commented 9 months ago

@vladimirfomene I got curious, did the CI suddenly start failing?

vladimirfomene commented 9 months ago

@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

oleonardolima commented 9 months ago

@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

Oh, thanks! I saw that the rustls dependency version got yanked, and lead to this 😅

oleonardolima commented 9 months ago

@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:

notmandatory commented 8 months ago

Please rebase to pick up changes in #69 that fix CI.

coderabbitai[bot] commented 6 months ago

Walkthrough

The recent updates involve modifying the get_fee_estimates method in both the AsyncClient and BlockingClient to use u16 instead of String as the key type for confirmation targets in the returned HashMap. Additionally, the convert_fee_rate function now also expects a HashMap with u16 keys. These changes streamline the handling of fee rate estimates, aligning data types with external sources like electrs.

Changes

Files Change Summary
src/async.rs, src/blocking.rs Updated get_fee_estimates to return HashMap<u16, f64> for confirmation targets.
src/lib.rs Adjusted convert_fee_rate to accept HashMap<u16, f64> and updated processing logic.

Assessment against linked issues

Objective Addressed Explanation
Keys in feerates mapping should be u16, not String. (#64)

Poem

In the realm of code, where the bits do hop,
A rabbit worked, with no intent to stop.
🐇💻 With a leap and a bound, it refined its craft,
Changing strings to numbers, with its latest draft.
"U16!", it cheered, with a joyful tone,
For in the world of types, a seed was sown.
🌟✨ Through the digital fields, it danced with glee,
Celebrating the change, for all to see.

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?

Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

Tips ### Chat There are 3 ways to chat with CodeRabbit: - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit-tests for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit tests for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit tests.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` 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) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - The JSON schema for the configuration file is available [here](https://coderabbit.ai/integrations/coderabbit-overrides.v2.json). - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json` ### CodeRabbit Discord Community Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback.
notmandatory commented 6 months ago

FYI I had to rebase this since #75 was merged.