From d76e0dd512376c4dc6392e24cd2620635337982e Mon Sep 17 00:00:00 2001 From: nikhil kumar Date: Fri, 15 May 2026 19:45:08 +0530 Subject: [PATCH] fix: relayer_getFeeData, replayer on_hyper_http client to on_http client --- Cargo.lock | 3 +++ Cargo.toml | 2 +- src/methods/fee_data.rs | 4 ++-- src/methods/send_tx/shared.rs | 2 +- src/provider/fetch.rs | 6 +++--- src/provider/simulate.rs | 2 +- src/provider/tx.rs | 2 +- 7 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 41bbef2..0123566 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -259,6 +259,7 @@ dependencies = [ "lru", "parking_lot 0.12.5", "pin-project", + "reqwest", "schnellru", "serde", "serde_json", @@ -303,6 +304,7 @@ dependencies = [ "alloy-transport-http", "futures", "pin-project", + "reqwest", "serde", "serde_json", "tokio", @@ -489,6 +491,7 @@ dependencies = [ "http-body-util", "hyper 1.8.0", "hyper-util", + "reqwest", "serde_json", "tower", "tracing", diff --git a/Cargo.toml b/Cargo.toml index 1775460..84efddd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -alloy = { version = "0.6", default-features = false, features = ["json-abi", "network", "provider-http", "rpc-types-eth", "signer-local", "serde", "hyper"] } +alloy = { version = "0.6", default-features = false, features = ["json-abi", "network", "provider-http", "rpc-types-eth", "signer-local", "serde", "hyper", "reqwest-rustls-tls"] } alloy-eip7702 = { version = "0.4", features = ["k256", "serde"] } alloy-rlp = "0.3" anyhow = "1.0" diff --git a/src/methods/fee_data.rs b/src/methods/fee_data.rs index 190e7b7..778324d 100644 --- a/src/methods/fee_data.rs +++ b/src/methods/fee_data.rs @@ -150,8 +150,8 @@ pub async fn build_fee_data_response( .ok_or_else(unsupported_chain_error)?; async fn eth_call_bytes(rpc_url: &str, to_address: &str, calldata: &[u8]) -> Option> { - let provider = ProviderBuilder::new().on_hyper_http(Url::parse(rpc_url).ok()?); - let to: Address = to_address.parse().ok()?; + let provider = ProviderBuilder::new().on_http(Url::parse(rpc_url).unwrap()); + let to: Address = to_address.parse().unwrap(); let tx = TransactionRequest::default() .to(to) .input(Bytes::from(calldata.to_vec()).into()); diff --git a/src/methods/send_tx/shared.rs b/src/methods/send_tx/shared.rs index cd960c1..6c33748 100644 --- a/src/methods/send_tx/shared.rs +++ b/src/methods/send_tx/shared.rs @@ -149,7 +149,7 @@ pub async fn process_single_transaction( if let Some(rpc_url) = cfg.rpc_url_for_chain(&chain_id.to_string()) { if let Ok(endpoint) = Url::parse(&rpc_url) { - let provider = ProviderBuilder::new().on_hyper_http(endpoint); + let provider = ProviderBuilder::new().on_http(endpoint); if let Ok(balance) = provider.get_balance(wallet_address).await { if balance < required { return Err(insufficient_balance_error()); diff --git a/src/provider/fetch.rs b/src/provider/fetch.rs index 0df4ee8..3591cab 100644 --- a/src/provider/fetch.rs +++ b/src/provider/fetch.rs @@ -17,7 +17,7 @@ pub async fn fetch_receipt_for_status( } let rpc_url = cfg.rpc_url_for_chain(&chain_id.to_string())?; - let provider = ProviderBuilder::new().on_hyper_http(Url::parse(&rpc_url).ok()?); + let provider = ProviderBuilder::new().on_http(Url::parse(&rpc_url).ok()?); let hash_hex = tx_hash.strip_prefix("0x").unwrap_or(tx_hash); let hash_bytes = hex::decode(hash_hex).ok()?; @@ -70,7 +70,7 @@ pub async fn fetch_gas_fees(chain_id: u64, cfg: &Config) -> Result format!("0x{:x}", p), @@ -115,7 +115,7 @@ pub async fn fetch_and_store_receipt( } let rpc_url = cfg.rpc_url_for_chain(&req.chain_id.to_string())?; - let provider = ProviderBuilder::new().on_hyper_http(Url::parse(&rpc_url).ok()?); + let provider = ProviderBuilder::new().on_http(Url::parse(&rpc_url).ok()?); let hash_hex = tx_hash.strip_prefix("0x").unwrap_or(tx_hash); let hash_bytes = hex::decode(hash_hex).ok()?; diff --git a/src/provider/simulate.rs b/src/provider/simulate.rs index 354be0e..95c0c58 100644 --- a/src/provider/simulate.rs +++ b/src/provider/simulate.rs @@ -60,7 +60,7 @@ pub async fn simulate_transaction( } let rpc_endpoint = Url::parse(&rpc_url).map_err(|e| format!("Invalid RPC URL: {}", e))?; - let provider = ProviderBuilder::new().on_hyper_http(rpc_endpoint); + let provider = ProviderBuilder::new().on_http(rpc_endpoint); let tx = TransactionRequest::default() .to(wallet_addr) diff --git a/src/provider/tx.rs b/src/provider/tx.rs index 77bd355..8d6edc1 100644 --- a/src/provider/tx.rs +++ b/src/provider/tx.rs @@ -47,7 +47,7 @@ pub async fn send_relay_transaction( let provider = ProviderBuilder::new() .with_recommended_fillers() .wallet(wallet) - .on_hyper_http(rpc_endpoint); + .on_http(rpc_endpoint); let to_address: Address = wallet_address .parse()