Skip to content

Commit

Permalink
Do not raise error when trying to fund account on windows. (#1259)
Browse files Browse the repository at this point in the history
  • Loading branch information
fnando authored Mar 15, 2024
1 parent 8a264be commit 5f367ed
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ jobs:
- os: windows-latest-8-cores
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
env:
CI_TESTS: true
steps:
- uses: actions/checkout@v3
- uses: stellar/actions/rust-cache@main
Expand Down
34 changes: 34 additions & 0 deletions cmd/crates/soroban-test/tests/it/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,40 @@ fn generate_key() {
);
}

#[test]
fn generate_key_on_testnet() {
if std::env::var("CI_TEST").is_err() {
return;
}
let sandbox = TestEnv::default();
sandbox
.new_assert_cmd("keys")
.arg("generate")
.arg("--rpc-url=https://soroban-testnet.stellar.org:443")
.arg("--network-passphrase=Test SDF Network ; September 2015")
.arg("test_2")
.assert()
.stdout("")
.stderr("")
.success();

sandbox
.new_assert_cmd("keys")
.arg("ls")
.assert()
.stdout(predicates::str::contains("test_2\n"));
println!(
"aa {}",
sandbox
.new_assert_cmd("keys")
.arg("address")
.arg("test_2")
.assert()
.success()
.stdout_as_str()
);
}

#[test]
fn seed_phrase() {
let sandbox = TestEnv::default();
Expand Down
17 changes: 5 additions & 12 deletions cmd/soroban-cli/src/commands/network/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,18 +194,11 @@ impl Network {
let response = match uri.scheme_str() {
Some("http") => hyper::Client::new().get(uri.clone()).await?,
Some("https") => {
#[cfg(target_os = "windows")]
{
return Err(Error::WindowsNotSupported(uri.to_string()));
}
#[cfg(not(target_os = "windows"))]
{
let https = hyper_tls::HttpsConnector::new();
hyper::Client::builder()
.build::<_, hyper::Body>(https)
.get(uri.clone())
.await?
}
let https = hyper_tls::HttpsConnector::new();
hyper::Client::builder()
.build::<_, hyper::Body>(https)
.get(uri.clone())
.await?
}
_ => {
return Err(Error::InvalidUrl(uri.to_string()));
Expand Down

0 comments on commit 5f367ed

Please sign in to comment.