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

chore!: remove dependency on Downloader #4

Merged
merged 1 commit into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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