Skip to content

Commit

Permalink
Merge pull request #4 from apollodao/chore/remove-downloader-dep
Browse files Browse the repository at this point in the history
chore!: remove dependency on Downloader
  • Loading branch information
pacmanifold authored Jan 4, 2023
2 parents 5d88844 + cce922e commit 02b01a7
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 197 deletions.
169 changes: 0 additions & 169 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 @@ -62,7 +62,6 @@ osmosis-testing = { git = "https://github.com/apollodao/osmosis-rust.git", branc
config = { version = "0.13.2", features = ["yaml"] }
tokio = { version="1.22.0", features = ["macros"] }
tonic = { version="0.8.2", default-features = false }
downloader = "0.2.6"
git2 = "0.15.0"
git2_credentials = "0.9.1"
anyhow = "1.0.66"
Expand Down
28 changes: 1 addition & 27 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use std::{

use config::Config;
use cosmwasm_schema::cw_serde;
use downloader::Downloader;
use git2::Repository;
use git2_credentials::CredentialHandler;
use osmosis_testing::{FeeSetting, RunnerResult, SigningAccount};
Expand Down Expand Up @@ -151,7 +150,6 @@ impl TestConfig {
.collect();

let mut chain_download_list: Vec<Contract> = vec![];
let mut url_download_list: Vec<Contract> = vec![];
let mut clone_list: Vec<Contract> = vec![];
let mut compile_list: Vec<Contract> = vec![];

Expand All @@ -162,10 +160,7 @@ impl TestConfig {
.collect::<Vec<&str>>()
.pop()
.unwrap();
if extension == "wasm" {
// URL is a wasm file, so we can just download it
url_download_list.push(contract);
} else if extension == "git" {
if extension == "git" {
// URL is a git repo, so we need to clone it
clone_list.push(contract);
} else {
Expand Down Expand Up @@ -209,10 +204,6 @@ impl TestConfig {
}
}

for contract in url_download_list {
self.download_contract_from_url(&contract, &self.artifacts_folder);
}

for contract in clone_list {
self.clone_repo(&contract, &self.artifacts_folder)
.expect("Error cloning artifact");
Expand Down Expand Up @@ -345,23 +336,6 @@ impl TestConfig {
}
Ok(())
}
fn download_contract_from_url(&self, contract: &Contract, artifact_folder: &str) {
let mut downloader = Downloader::builder()
.download_folder(std::path::Path::new(&artifact_folder))
.parallel_requests(32)
.build()
.unwrap();
downloader
.download(&[downloader::Download::new(&contract.url)])
.unwrap();
//let fp = format!("{}/{}", DEFAULT_ARTIFACTS_FOLDER, contract.artifacts[0]);
// if !Path::new(&fp).exists() {
// println!("File to download [{}]", contract.url);
// downloader.download(&[downloader::Download::new(&contract.url)]).unwrap();
// } else {
// println!("File already exist [{}]", fp);
// }
}

fn download_contract_from_chain(&self, http_client: &HttpClient, contract: &Contract) {
let contract_path = format!("{}/{}", self.artifacts_folder, contract.artifact);
Expand Down

0 comments on commit 02b01a7

Please sign in to comment.