Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gemcoder21 committed Sep 15, 2024
1 parent 8e0019b commit b4bd9ae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 22 deletions.
15 changes: 4 additions & 11 deletions bin/img-downloader/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct Downloader {

impl Downloader {
fn new(args: Args, api_key: String) -> Self {
let client = CoinGeckoClient::new(api_key);
let client = CoinGeckoClient::new(api_key.as_str());
Self {
args,
client,
Expand All @@ -36,15 +36,11 @@ impl Downloader {
}

if !self.args.coin_id.is_empty() {
return self
.handle_coin_id(self.args.coin_id.as_str(), folder)
.await;
return self.handle_coin_id(self.args.coin_id.as_str(), folder).await;
}

if !self.args.coin_ids.is_empty() {
return self
.handle_coin_ids(self.args.coin_ids.clone(), folder)
.await;
return self.handle_coin_ids(self.args.coin_ids.clone(), folder).await;
}

if !self.args.coin_ids_url.is_empty() {
Expand Down Expand Up @@ -82,10 +78,7 @@ impl Downloader {
let mut page = self.args.page;
let total_pages = self.args.count.div_ceil(self.args.page_size);
while page <= total_pages {
let markets = self
.client
.get_coin_markets(page, self.args.page_size)
.await?;
let markets = self.client.get_coin_markets(page, self.args.page_size).await?;
for market in markets {
self.handle_coin(&market.id, folder).await?;
}
Expand Down
4 changes: 0 additions & 4 deletions crates/localizer/tests/localizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ fn test_specific_language() {
let localizer = LanguageLocalizer::new_with_language("es");
assert_eq!(&localizer.test(), "Prueba");

localizer.select_language("de").unwrap();

assert_eq!(&localizer.test(), "Prüfen");

localizer.select_language("pt-BR").unwrap();

assert_eq!(&localizer.test(), "Teste");
Expand Down
10 changes: 3 additions & 7 deletions crates/swapper/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,12 @@ pub struct Swapper {}
impl Swapper {
pub fn build(configuration: SwapperConfiguration) -> SwapperClient {
let oneinch_client = OneInchClient::new(
configuration.oneinch.url,
configuration.oneinch.key,
configuration.oneinch.url.as_str(),
configuration.oneinch.key.as_str(),
configuration.oneinch.fee_percent,
configuration.oneinch.fee_address,
);
let jupiter_client = JupiterClient::new(
configuration.jupiter.url,
configuration.jupiter.fee_percent,
configuration.jupiter.fee_address,
);
let jupiter_client = JupiterClient::new(configuration.jupiter.url, configuration.jupiter.fee_percent, configuration.jupiter.fee_address);

let providers: ProviderList = vec![
Box::new(AftermathProvider::new(
Expand Down

0 comments on commit b4bd9ae

Please sign in to comment.