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

Use reqwest, remove http, ureq and hyper #1632

Merged
merged 11 commits into from
Oct 3, 2024
92 changes: 63 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ termcolor_output = "1.0.1"
ed25519-dalek = ">= 2.1.1"

# networking
http = "1.0.0"
jsonrpsee-http-client = "0.20.1"
jsonrpsee-core = "0.20.1"
tokio = "1.28.1"
Expand Down
20 changes: 10 additions & 10 deletions cmd/soroban-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,12 @@ wasmparser = { workspace = true }
sha2 = { workspace = true }
csv = "1.1.6"
ed25519-dalek = { workspace = true }
reqwest = { version = "0.12.7", features = ["json", "blocking", "stream"] }
jsonrpsee-http-client = "0.20.1"
jsonrpsee-core = "0.20.1"
hyper = "0.14.27"
hyper-tls = "0.5"
http = "0.2.9"
regex = "1.6.0"
wasm-opt = { version = "0.114.0", optional = true }
chrono = { version = "0.4.27", features = ["serde"]}
chrono = { version = "0.4.27", features = ["serde"] }
rpassword = "7.2.0"
dirs = "4.0.0"
toml = "0.5.9"
Expand All @@ -107,13 +105,12 @@ gix = { version = "0.58.0", default-features = false, features = [
"blocking-http-transport-reqwest-rust-tls",
"worktree-mutation",
] }
ureq = { version = "2.9.1", features = ["json"] }
async-compression = { version = "0.4.12", features = [ "tokio", "gzip" ] }
async-compression = { version = "0.4.12", features = ["tokio", "gzip"] }

tempfile = "3.8.1"
toml_edit = "0.21.0"
rust-embed = { version = "8.2.0", features = ["debug-embed"] }
bollard = { workspace=true }
bollard = { workspace = true }
futures-util = "0.3.30"
futures = "0.3.30"
home = "0.5.9"
Expand All @@ -126,15 +123,18 @@ glob = "0.3.1"
open = "5.3.0"
url = "2.5.2"

# For hyper-tls
[target.'cfg(unix)'.dependencies]
openssl = { version = "=0.10.55", features = ["vendored"] }
reqwest = { version = "0.12.7", features = [
"json",
"blocking",
"stream",
"native-tls-vendored",
leighmcculloch marked this conversation as resolved.
Show resolved Hide resolved
] }

[build-dependencies]
crate-git-revision = "0.0.4"
serde.workspace = true
thiserror.workspace = true
ureq = { version = "2.9.1", features = ["json"] }


[dev-dependencies]
Expand Down
5 changes: 2 additions & 3 deletions cmd/soroban-cli/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use clap::CommandFactory;
use dotenvy::dotenv;
use std::thread;
use tracing_subscriber::{fmt, EnvFilter};

use crate::upgrade_check::upgrade_check;
Expand Down Expand Up @@ -75,8 +74,8 @@ pub async fn main() {
// Spawn a thread to check if a new version exists.
// It depends on logger, so we need to place it after
// the code block that initializes the logger.
thread::spawn(move || {
upgrade_check(root.global_args.quiet);
tokio::spawn(async move {
upgrade_check(root.global_args.quiet).await;
});

let printer = print::Print::new(root.global_args.quiet);
Expand Down
3 changes: 1 addition & 2 deletions cmd/soroban-cli/src/commands/contract/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use std::{
sync::atomic::AtomicBool,
};
use toml_edit::{Document, TomlError};
use ureq::get;

use crate::{commands::global, print};

Expand Down Expand Up @@ -261,7 +260,7 @@ impl Runner {
}

fn check_internet_connection() -> bool {
if let Ok(_req) = get(GITHUB_URL).call() {
if let Ok(_req) = reqwest::blocking::get(GITHUB_URL) {
return true;
}

Expand Down
4 changes: 1 addition & 3 deletions cmd/soroban-cli/src/commands/network/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ pub enum Error {
#[error("network arg or rpc url and network passphrase are required if using the network")]
Network,
#[error(transparent)]
Http(#[from] http::Error),
#[error(transparent)]
Rpc(#[from] rpc::Error),
#[error(transparent)]
Hyper(#[from] hyper::Error),
HttpClient(#[from] reqwest::Error),
#[error("Failed to parse JSON from {0}, {1}")]
FailedToParseJSON(String, serde_json::Error),
#[error("Invalid URL {0}")]
Expand Down
Loading
Loading