Skip to content

Conversation

@jmwample
Copy link

@jmwample jmwample commented Feb 21, 2025

Update the dependency on reqwest to the latest minor version.

Add a type alias that allows downstream libraries to construct and provide an underlying reqwest::Client without being forced to match the library version in their code. i.e. this allows things like:

use tendermint_rpc::{HttpClient, Client, client::{CompatMode, http::ReqwestClient}};

#[tokio::main]
async fn main() {

    // Name your user agent after your app?
    static APP_USER_AGENT: &str = concat!(
        env!("CARGO_PKG_NAME"),
        "/",
        env!("CARGO_PKG_VERSION"),
   );

    let inner = ReqwestClient::builder()
        .user_agent(APP_USER_AGENT)
        .hickory_dns(true)
        .build()
        .unwrap();

    let client = HttpClient::builder("http://127.0.0.1:26657")
        .client(inner)
        .compat_mode(CompatMode::V0_37)
        .build()
        .unwrap();

    let abci_info = client.abci_info()
        .await
        .unwrap();

    println!("Got ABCI info: {:?}", abci_info);
}

  • Referenced an issue explaining the need for the change
  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Added entry in .changelog/

Note

Updates reqwest to 0.12 and adds a re-exported InnerClient alias used across HttpClient APIs for easier client injection.

  • RPC HTTP client:
    • Dependency: Bump reqwest from 0.11.20 to 0.12 in rpc/Cargo.toml.
    • Client re-export: Add pub type InnerClient = reqwest::Client; and switch HttpClient internals/Builder/new_from_parts to use InnerClient.
  • Changelog: Add entry noting the reqwest update and reqwest::Client re-export.

Written by Cursor Bugbot for commit eded429. This will update automatically on new commits. Configure here.

@melekes melekes added the rpc label Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants