From 39dd20f97dfe1453f27393fdc884b3a272da30de Mon Sep 17 00:00:00 2001 From: Marcel Ebert Date: Thu, 26 Sep 2024 18:06:23 +0200 Subject: [PATCH 1/3] Add test for ARS and PEN fiat prices --- dia-batching-server/src/api/polygon.rs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/dia-batching-server/src/api/polygon.rs b/dia-batching-server/src/api/polygon.rs index c903feb..b03544e 100644 --- a/dia-batching-server/src/api/polygon.rs +++ b/dia-batching-server/src/api/polygon.rs @@ -396,9 +396,13 @@ mod tests { AssetSpecifier { blockchain: "FIAT".to_string(), symbol: "TZS-USD".to_string() }; let aud_asset = AssetSpecifier { blockchain: "FIAT".to_string(), symbol: "AUD-USD".to_string() }; + let ars_asset = + AssetSpecifier { blockchain: "FIAT".to_string(), symbol: "ARS-USD".to_string() }; + let pen_asset = + AssetSpecifier { blockchain: "FIAT".to_string(), symbol: "PEN-USD".to_string() }; let usd_asset = AssetSpecifier { blockchain: "FIAT".to_string(), symbol: "USD-USD".to_string() }; - let assets = vec![&usd_asset, &brl_asset, &eur_asset, &ngn_asset, &tzs_asset, &aud_asset]; + let assets = vec![&usd_asset, &brl_asset, &eur_asset, &ngn_asset, &tzs_asset, &aud_asset, &ars_asset, &pen_asset]; let result = polygon_api.get_prices(assets.clone()).await; assert!(result.is_ok()); @@ -458,5 +462,23 @@ mod tests { assert_eq!(aud_price.name, aud_asset.symbol); assert_eq!(aud_price.blockchain, Some("FIAT".to_string())); assert!(aud_price.price > 0.into()); + + let ars_price = prices + .iter() + .find(|q| q.symbol == ars_asset.symbol) + .expect("Should return a ARS price"); + assert_eq!(ars_price.symbol, ars_asset.symbol); + assert_eq!(ars_price.name, ars_asset.symbol); + assert_eq!(ars_price.blockchain, Some("FIAT".to_string())); + assert!(ars_price.price > 0.into()); + + let pen_price = prices + .iter() + .find(|q| q.symbol == pen_asset.symbol) + .expect("Should return a PEN price"); + assert_eq!(pen_price.symbol, pen_asset.symbol); + assert_eq!(pen_price.name, pen_asset.symbol); + assert_eq!(pen_price.blockchain, Some("FIAT".to_string())); + assert!(pen_price.price > 0.into()); } } From be862385c81b4337c5e3f0fa1eb9d5ac9609b1cc Mon Sep 17 00:00:00 2001 From: Marcel Ebert Date: Thu, 26 Sep 2024 18:06:44 +0200 Subject: [PATCH 2/3] Add ARS and PEN to list of default supported currencies --- dia-batching-server/src/args.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dia-batching-server/src/args.rs b/dia-batching-server/src/args.rs index 68b1c8a..d39db9c 100644 --- a/dia-batching-server/src/args.rs +++ b/dia-batching-server/src/args.rs @@ -25,7 +25,7 @@ pub struct DiaApiArgs { #[clap(short, long, parse(from_str = parse_currency_vec), env = "SUPPORTED_CURRENCIES", - default_value = "FIAT:USD-USD,FIAT:EUR-USD,FIAT:BRL-USD,FIAT:AUD-USD,FIAT:NGN-USD,FIAT:TZS-USD,Pendulum:PEN,Amplitude:AMPE,Polkadot:DOT,Kusama:KSM,Astar:ASTR,Bifrost:BNC,Bifrost:vDOT,HydraDX:HDX,Moonbeam:GLMR,Polkadex:PDEX,Stellar:XLM,Picasso:PICA" + default_value = "FIAT:USD-USD,FIAT:EUR-USD,FIAT:BRL-USD,FIAT:AUD-USD,FIAT:NGN-USD,FIAT:TZS-USD,FIAT:PEN-USD,FIAT:ARS-USD,Pendulum:PEN,Amplitude:AMPE,Polkadot:DOT,Kusama:KSM,Astar:ASTR,Bifrost:BNC,Bifrost:vDOT,HydraDX:HDX,Moonbeam:GLMR,Polkadex:PDEX,Stellar:XLM,Picasso:PICA" )] pub supported_currencies: SupportedCurrencies, From 8a63c500c5ff379b84176efd7a1d6e6a5f5d7be3 Mon Sep 17 00:00:00 2001 From: Marcel Ebert Date: Fri, 27 Sep 2024 14:54:49 +0200 Subject: [PATCH 3/3] Remove useless action from CI --- .github/workflows/check.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 219cfeb..46955e0 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -36,9 +36,4 @@ jobs: - name: Check Build run: | - SKIP_WASM_BUILD=1 cargo check --release - - - name: Check Build for Benchmarking - run: > - pushd node && - cargo check --features=runtime-benchmarks --release + SKIP_WASM_BUILD=1 cargo check --release \ No newline at end of file