From f8da3d0754b60e9e8d732b33f3bae898d9c86d6b Mon Sep 17 00:00:00 2001 From: ardocrat Date: Sat, 31 May 2025 17:44:37 +0300 Subject: [PATCH] fix: hyper client import --- src/wallet/connections/external.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/wallet/connections/external.rs b/src/wallet/connections/external.rs index 17d33868..9b6da896 100644 --- a/src/wallet/connections/external.rs +++ b/src/wallet/connections/external.rs @@ -35,14 +35,14 @@ pub struct ExternalConnection { /// Default external node URL for main network. const DEFAULT_MAIN_URLS: [&'static str; 2] = [ - "https://grincoin.org", - "https://grinnode.live:3413" - ]; + "https://grincoin.org", + "https://grinnode.live:3413" +]; /// Default external node URL for main network. const DEFAULT_TEST_URLS: [&'static str; 1] = [ - "https://testnet.grincoin.org" - ]; + "https://testnet.grincoin.org" +]; impl ExternalConnection { /// Get default connections for provided chain type. @@ -102,10 +102,10 @@ fn check_ext_conn(conn: &ExternalConnection, ui_ctx: &egui::Context) { if let Ok(_) = url.socket_addrs(|| None) { let addr = format!("{}v2/foreign", url.to_string()); // Setup http client. - let client = hyper::Client::builder() - .build::<_, hyper::Body>(hyper_tls::HttpsConnector::new()); - let mut req_setup = hyper::Request::builder() - .method(hyper::Method::POST) + let client = hyper_tor::Client::builder() + .build::<_, hyper_tor::Body>(hyper_tls::HttpsConnector::new()); + let mut req_setup = hyper_tor::Request::builder() + .method(hyper_tor::Method::POST) .uri(addr.clone()); // Setup secret key auth. if let Some(key) = conn.secret { @@ -114,9 +114,9 @@ fn check_ext_conn(conn: &ExternalConnection, ui_ctx: &egui::Context) { to_base64(&format!("grin:{}", key)) ); req_setup = req_setup - .header(hyper::header::AUTHORIZATION, basic_auth.clone()); + .header(hyper_tor::header::AUTHORIZATION, basic_auth.clone()); } - let req = req_setup.body(hyper::Body::from( + let req = req_setup.body(hyper_tor::Body::from( r#"{"id":1,"jsonrpc":"2.0","method":"get_version","params":{} }"#) ).unwrap(); // Send request.