Skip to content

Commit

Permalink
rmv flask app, rename component & refactor func
Browse files Browse the repository at this point in the history
  • Loading branch information
juan518munoz committed Mar 11, 2024
1 parent 46b6ef4 commit d99e9bf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
5 changes: 1 addition & 4 deletions core/lib/zksync_core/src/api_conversion_rate/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use axum::{extract, extract::Json, routing::get, Router};
use rand::Rng;
use tokio::sync::watch;
use zksync_config::configs::native_token_fetcher::NativeTokenFetcherConfig;

Expand Down Expand Up @@ -32,7 +31,5 @@ pub(crate) async fn run_server(
// basic handler that responds with a static string
async fn get_conversion_rate(extract::Path(_token_address): extract::Path<String>) -> Json<u64> {
tracing::info!("Received request for conversion rate");
let mut rng = rand::thread_rng();
let random_number: u64 = rng.gen_range(1..=100);
Json(random_number)
Json(42)
}
6 changes: 3 additions & 3 deletions core/lib/zksync_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ pub enum Component {
/// Native Token fetcher
NativeTokenFetcher,
/// Conversion rate API, for local development.
ConversionRateApi,
DevConversionRateApi,
}

#[derive(Debug)]
Expand Down Expand Up @@ -273,7 +273,7 @@ impl FromStr for Components {
"eth_tx_manager" => Ok(Components(vec![Component::EthTxManager])),
"proof_data_handler" => Ok(Components(vec![Component::ProofDataHandler])),
"native_token_fetcher" => Ok(Components(vec![Component::NativeTokenFetcher])),
"conversion_rate_api" => Ok(Components(vec![Component::ConversionRateApi])),
"conversion_rate_api" => Ok(Components(vec![Component::DevConversionRateApi])),
other => Err(format!("{} is not a valid component name", other)),
}
}
Expand Down Expand Up @@ -334,7 +334,7 @@ pub async fn initialize_components(
let (stop_sender, stop_receiver) = watch::channel(false);

// spawn the conversion rate API if it is enabled
if components.contains(&Component::ConversionRateApi) {
if components.contains(&Component::DevConversionRateApi) {
let native_token_fetcher_config = configs
.native_token_fetcher_config
.clone()
Expand Down
8 changes: 0 additions & 8 deletions erc20_example.py

This file was deleted.

0 comments on commit d99e9bf

Please sign in to comment.