Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
JordyRo1 committed Jan 23, 2024
1 parent 1b0a205 commit 5ab7731
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ async fn init_publishers(
.first()
.unwrap();

publishers_map.insert(publisher, publisher_address.clone());
publishers_map.insert(publisher, publisher_address);
}
(publishers_map, publisher_registry_address)
}
Expand Down
6 changes: 1 addition & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use diesel_async::AsyncPgConnection;

use dotenv::dotenv;
use processing::common::check_data_provider_balance;
use starknet::core::utils::cairo_short_string_to_felt;
use std::env;
use std::time::Duration;
use tokio::time::interval;
Expand Down Expand Up @@ -221,10 +220,7 @@ pub(crate) async fn balance_monitor() {
.clone()
.iter()
.map(|(name, address)| {
tokio::spawn(Box::pin(check_data_provider_balance(
name.clone(),
address.clone(),
)))
tokio::spawn(Box::pin(check_data_provider_balance(name.clone(), address)))
})
.collect();
let results: Vec<_> = futures::future::join_all(tasks).await;
Expand Down
9 changes: 3 additions & 6 deletions src/monitoring/data_providers_balance.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use bigdecimal::ToPrimitive;
use starknet::{
core::{
types::{BlockId, BlockTag, FieldElement, FunctionCall},
utils::cairo_short_string_to_felt,
},
core::types::{BlockId, BlockTag, FieldElement, FunctionCall},
macros::selector,
providers::Provider,
};
Expand All @@ -25,7 +22,7 @@ pub async fn data_provider_balance(data_provider: FieldElement) -> Result<f64, M
contract_address: FieldElement::from_hex_be(&token_address)
.expect("failed to convert token address"),
entry_point_selector: selector!("balanceOf"),
calldata: vec![data_provider.clone().into()],
calldata: vec![data_provider.into()],
},
BlockId::Tag(BlockTag::Latest),
)
Expand Down Expand Up @@ -54,5 +51,5 @@ pub async fn data_provider_balance(data_provider: FieldElement) -> Result<f64, M
"Failed to convert to f64".to_string(),
))?;

Ok((on_chain_balance))
Ok(on_chain_balance)
}
1 change: 0 additions & 1 deletion src/monitoring/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pub mod price_deviation;
pub mod source_deviation;
pub mod time_since_last_update;

pub use data_providers_balance::data_provider_balance;
pub use price_deviation::price_deviation;
pub use source_deviation::source_deviation;
pub use time_since_last_update::time_since_last_update;

0 comments on commit 5ab7731

Please sign in to comment.