Skip to content

Commit

Permalink
Merge pull request #46 from mattsse/matt/add-apple-silicon-download-test
Browse files Browse the repository at this point in the history
test: adds test to ensure we can download latest native M1 build
  • Loading branch information
roynalnaruto authored Jun 20, 2022
2 parents 804cabd + b069dbc commit e1219f6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
23 changes: 23 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,4 +423,27 @@ mod tests {
install(&version).await.unwrap();
t.await.unwrap().unwrap();
}

// ensures we can download the latest native solc for apple silicon
#[tokio::test(flavor = "multi_thread")]
async fn can_download_latest_native_apple_silicon() {
let latest: Version = "0.8.15".parse().unwrap();

let artifacts = all_releases(Platform::MacOsAarch64).await.unwrap();

let artifact = artifacts.releases.get(&latest).unwrap();
let download_url = artifact_url(
Platform::MacOsAarch64,
&latest,
artifact.to_string().as_str(),
)
.unwrap();

let checksum = artifacts.get_checksum(&latest).unwrap();

let resp = reqwest::get(download_url).await.unwrap();
assert!(resp.status().is_success());
let binbytes = resp.bytes().await.unwrap();
ensure_checksum(&binbytes, &latest, checksum).unwrap();
}
}
4 changes: 2 additions & 2 deletions src/releases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ static LINUX_AARCH64_RELEASES: Lazy<Releases> = Lazy::new(|| {
static MACOS_AARCH64_NATIVE: Lazy<Version> = Lazy::new(|| Version::new(0, 8, 5));

static MACOS_AARCH64_URL_PREFIX: &str =
"https://github.com/roynalnaruto/solc-builds/raw/9cb46201533a2cb739059e09b5d9c211cfc62c4e/macosx/aarch64";
"https://github.com/roynalnaruto/solc-builds/raw/7c716cc2f619fee991723c7341d97f58413ab953/macosx/aarch64";

static MACOS_AARCH64_RELEASES_URL: &str =
"https://github.com/roynalnaruto/solc-builds/raw/9cb46201533a2cb739059e09b5d9c211cfc62c4e/macosx/aarch64/list.json";
"https://github.com/roynalnaruto/solc-builds/raw/7c716cc2f619fee991723c7341d97f58413ab953/macosx/aarch64/list.json";

/// Defines the struct that the JSON-formatted release list can be deserialized into.
///
Expand Down

0 comments on commit e1219f6

Please sign in to comment.