Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ybensacq committed Aug 23, 2024
1 parent dc9e5f6 commit 733ea18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 0 additions & 2 deletions crates/ark-metadata/src/elasticsearch_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use crate::types::{RequestError, TokenMetadata};
use async_trait::async_trait;
pub struct NoOpElasticsearchManager;


#[cfg(any(test, feature = "mock"))]
use mockall::automock;

Expand All @@ -18,7 +17,6 @@ pub trait ElasticsearchManager {
) -> Result<(), RequestError>;
}


#[async_trait]
impl ElasticsearchManager for NoOpElasticsearchManager {
async fn upsert_token_metadata(
Expand Down
13 changes: 6 additions & 7 deletions crates/ark-metadata/src/metadata_manager.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::elasticsearch_manager::NoOpElasticsearchManager;
use crate::{
elasticsearch_manager::ElasticsearchManager,
file_manager::{FileInfo, FileManager},
Expand All @@ -16,7 +17,6 @@ use starknet::core::types::{BlockId, BlockTag, FieldElement};
use starknet::macros::selector;
use std::{str::FromStr, time::Duration};
use tracing::{debug, error, trace};
use crate::elasticsearch_manager::NoOpElasticsearchManager;

/// `MetadataManager` is responsible for managing metadata information related to tokens.
/// It works with the underlying storage and Starknet client to fetch and update token metadata.
Expand Down Expand Up @@ -186,13 +186,12 @@ impl<'a, T: Storage, C: StarknetClient, F: FileManager, E: ElasticsearchManager>
.await
.map_err(MetadataError::DatabaseError)?;


if let Some(elasticsearch_manager) = self.elasticsearch_manager {
elasticsearch_manager
.upsert_token_metadata(contract_address, token_id, chain_id, token_metadata)
.await
.map_err(|e| MetadataError::ElasticSearchError(e.to_string()))?;
}
elasticsearch_manager
.upsert_token_metadata(contract_address, token_id, chain_id, token_metadata)
.await
.map_err(|e| MetadataError::ElasticSearchError(e.to_string()))?;
}

Ok(())
}
Expand Down

0 comments on commit 733ea18

Please sign in to comment.