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

Enable Esplora async client #483

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thunderbiscuit
Copy link
Member

This is just to open up the work on async Esplora.

Copy link

coderabbitai bot commented Apr 2, 2024

Walkthrough

The project has undergone significant updates across its Android and JVM components. Java has been upgraded to version 17, Kotlin to version 1.9.23, and Rust to 1.73.0 in the workflows. Python testing now includes versions 3.11 and 3.12. Key Gradle plugins and dependencies have been updated, with notable changes in Android build configurations and enhanced error handling capabilities in the FFI module.

Changes

File Pattern Change Summary
.github/workflows/publish-*.yaml,
.github/workflows/test-*.yaml
Updated Java to 17, set Rust to 1.73.0.
For Python, introduced versions 3.11 and 3.12.
bdk-android/.../README.md,
bdk-jvm/README.md
Updated Kotlin version to 1.9.23.
JDK version updated to 17.0.2 for JVM.
bdk-android/build.gradle.kts,
bdk-android/lib/build.gradle.kts,
bdk-jvm/lib/build.gradle.kts
Updated plugins and configurations.
Added new Android-related plugins with specific versions.
bdk-android/gradle/wrapper/gradle-wrapper.properties,
bdk-jvm/gradle/wrapper/gradle-wrapper.properties
Updated Gradle version to 8.4 for Android and 8.7 for JVM.
Adjusted settings.
bdk-android/settings.gradle.kts,
bdk-jvm/settings.gradle.kts
Added plugin and dependency repositories configuration.
bdk-ffi/src/... Enhanced error handling with new enum variants and methods.
Updated FeeRate functionality.

Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 54f3235 and 27b3567.
Files ignored due to path filters (1)
  • bdk-ffi/Cargo.lock is excluded by !**/*.lock
Files selected for processing (3)
  • bdk-ffi/Cargo.toml (1 hunks)
  • bdk-ffi/src/bdk.udl (1 hunks)
  • bdk-ffi/src/error.rs (2 hunks)
Additional comments not posted (4)
bdk-ffi/Cargo.toml (1)

28-30: The update to the reqwest dependency and the adjustment of its features are well-documented with the comment explaining the removal of the "macos-system-configuration" feature. This is a good practice as it helps maintain the clarity of the project dependencies.

bdk-ffi/src/bdk.udl (1)

39-39: Consider renaming the Reqwest() method to something more descriptive, such as ReqwestError(), to clarify that it represents an error scenario. This would improve code readability and maintainability.

bdk-ffi/src/error.rs (2)

78-80: The addition of the Reqwest variant to the EsploraError enum is appropriate and aligns with the changes in the UDL file. The error message is generic but suitable for the context.


392-392: The update to the From implementation for BdkEsploraError to handle the new Reqwest variant is correctly done. This ensures proper error handling and conversion within the application.


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
Tips

Chat

There are 3 ways to chat with CodeRabbit:

Note: Auto-reply has been disabled for this repository by the repository owner. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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 testing code 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 testing code.
    • @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.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Comment on lines 4 to 73
use bdk::wallet::AddressInfo as BdkAddressInfo;
use bdk::wallet::Balance as BdkBalance;
use bdk::KeychainKind;

use bdk::LocalOutput as BdkLocalOutput;

use bdk::FeeRate as BdkFeeRate;
use bdk::bitcoin::FeeRate as BdkFeeRate;

use crate::error::FeeRateError;
use std::sync::Arc;

#[derive(Clone, Debug)]
pub struct FeeRate(pub BdkFeeRate);

impl FeeRate {
pub fn from_sat_per_vb(sat_per_vb: f32) -> Self {
FeeRate(BdkFeeRate::from_sat_per_vb(sat_per_vb))
pub fn from_sat_per_vb(sat_per_vb: u64) -> Result<Self, FeeRateError> {
let fee_rate: Option<BdkFeeRate> = BdkFeeRate::from_sat_per_vb(sat_per_vb);
match fee_rate {
Some(fee_rate) => Ok(FeeRate(fee_rate)),
None => Err(FeeRateError::ArithmeticOverflow),
}
}

pub fn from_sat_per_kwu(sat_per_kwu: f32) -> Self {
pub fn from_sat_per_kwu(sat_per_kwu: u64) -> Self {
FeeRate(BdkFeeRate::from_sat_per_kwu(sat_per_kwu))
}

pub fn as_sat_per_vb(&self) -> f32 {
self.0.as_sat_per_vb()
pub fn to_sat_per_vb_ceil(&self) -> u64 {
self.0.to_sat_per_vb_ceil()
}

pub fn to_sat_per_vb_floor(&self) -> u64 {
self.0.to_sat_per_vb_floor()
}

pub fn sat_per_kwu(&self) -> f32 {
self.0.sat_per_kwu()
pub fn to_sat_per_kwu(&self) -> u64 {
self.0.to_sat_per_kwu()
}
}

Copy link

Choose a reason for hiding this comment

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

📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [92-92]

The TODO comment regarding the Peek implementation in AddressIndex suggests incomplete functionality. It's important to address this to ensure full functionality and avoid unexpected behavior.

Would you like assistance in implementing or testing the Peek functionality?

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.

None yet

1 participant