Skip to content

Commit

Permalink
Change naming for non fungible tokens in methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kstepanovdev committed Nov 22, 2024
1 parent 5745429 commit 63a1c4a
Show file tree
Hide file tree
Showing 19 changed files with 105 additions and 123 deletions.
3 changes: 1 addition & 2 deletions grpc/src/asseturls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ impl DownloadError {
/// Generated client implementations.
pub mod asset_url_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::http::Uri;
use tonic::codegen::*;
use tonic::codegen::{http::Uri, *};
#[derive(Debug, Clone)]
pub struct AssetUrlServiceClient<T> {
inner: tonic::client::Grpc<T>,
Expand Down
8 changes: 4 additions & 4 deletions nft_ingester/src/api/backfilling_state_consistency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ use tracing::info;

pub struct BackfillingStateConsistencyChecker {
overwhelm_fungible_backfill_gap: Arc<AtomicBool>,
overwhelm_non_backfill_gap: Arc<AtomicBool>,
overwhelm_nft_backfill_gap: Arc<AtomicBool>,
}

impl BackfillingStateConsistencyChecker {
pub(crate) fn new() -> Self {
Self {
overwhelm_fungible_backfill_gap: Arc::new(AtomicBool::new(false)),
overwhelm_non_backfill_gap: Arc::new(AtomicBool::new(false)),
overwhelm_nft_backfill_gap: Arc::new(AtomicBool::new(false)),
}
}

Expand All @@ -34,7 +34,7 @@ impl BackfillingStateConsistencyChecker {
let rocks_db = rocks_db.clone();
let mut rx = rx.resubscribe();
let overwhelm_backfill_gap = match asset_type {
AssetType::NonFungible => self.overwhelm_non_backfill_gap.clone(),
AssetType::NonFungible => self.overwhelm_nft_backfill_gap.clone(),
AssetType::Fungible => self.overwhelm_fungible_backfill_gap.clone(),
};
tasks.lock().await.spawn(async move {
Expand All @@ -60,7 +60,7 @@ impl BackfillingStateConsistencyChecker {

impl ConsistencyChecker for BackfillingStateConsistencyChecker {
fn should_cancel_request(&self, _call: &Call) -> bool {
self.overwhelm_non_backfill_gap.load(Ordering::Relaxed)
self.overwhelm_nft_backfill_gap.load(Ordering::Relaxed)
&& self.overwhelm_fungible_backfill_gap.load(Ordering::Relaxed)
}
}
10 changes: 5 additions & 5 deletions nft_ingester/src/api/synchronization_state_consistency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ const INDEX_STORAGE_DEPENDS_METHODS: &[&str] = &[
];

pub struct SynchronizationStateConsistencyChecker {
overwhelm_non_fungible_seq_gap: Arc<AtomicBool>,
overwhelm_nft_seq_gap: Arc<AtomicBool>,
overwhelm_fungible_seq_gap: Arc<AtomicBool>,
}

impl SynchronizationStateConsistencyChecker {
pub(crate) fn new() -> Self {
Self {
overwhelm_non_fungible_seq_gap: Arc::new(AtomicBool::new(false)),
overwhelm_nft_seq_gap: Arc::new(AtomicBool::new(false)),
overwhelm_fungible_seq_gap: Arc::new(AtomicBool::new(false)),
}
}
Expand All @@ -52,7 +52,7 @@ impl SynchronizationStateConsistencyChecker {
) {
for asset_type in ASSET_TYPES {
let overwhelm_seq_gap = match asset_type {
AssetType::NonFungible => self.overwhelm_non_fungible_seq_gap.clone(),
AssetType::NonFungible => self.overwhelm_nft_seq_gap.clone(),
AssetType::Fungible => self.overwhelm_fungible_seq_gap.clone(),
};
let pg_client = pg_client.clone();
Expand All @@ -68,7 +68,7 @@ impl SynchronizationStateConsistencyChecker {
};

let last_known_updated_asset = match asset_type {
AssetType::NonFungible => rocks_db.last_known_non_fungible_asset_updated_key(),
AssetType::NonFungible => rocks_db.last_known_nft_asset_updated_key(),
AssetType::Fungible => rocks_db.last_known_fungible_asset_updated_key(),
};
let Ok(Some(primary_update_key)) = last_known_updated_asset else {
Expand Down Expand Up @@ -98,7 +98,7 @@ impl SynchronizationStateConsistencyChecker {

impl ConsistencyChecker for SynchronizationStateConsistencyChecker {
fn should_cancel_request(&self, call: &Call) -> bool {
if !&self.overwhelm_non_fungible_seq_gap.load(Ordering::Relaxed)
if !&self.overwhelm_nft_seq_gap.load(Ordering::Relaxed)
|| !&self.overwhelm_fungible_seq_gap.load(Ordering::Relaxed)
{
return false;
Expand Down
2 changes: 1 addition & 1 deletion nft_ingester/src/bin/ingester/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ pub async fn main() -> Result<(), IngesterError> {
match asset_type {
AssetType::NonFungible => {
synchronizer
.non_fungible_run(&rx, config.dump_sync_threshold, Duration::from_secs(5))
.nft_run(&rx, config.dump_sync_threshold, Duration::from_secs(5))
.await
}
AssetType::Fungible => {
Expand Down
4 changes: 2 additions & 2 deletions nft_ingester/src/bin/synchronizer/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ pub async fn main() -> Result<(), IngesterError> {
let synchronizer = synchronizer_clone.clone();
while shutdown_rx.is_empty() {
let result = synchronizer
.synchronize_non_fungible_asset_indexes(&shutdown_rx, config.dump_sync_threshold)
.synchronize_nft_asset_indexes(&shutdown_rx, config.dump_sync_threshold)
.await;

match result {
Expand All @@ -182,7 +182,7 @@ pub async fn main() -> Result<(), IngesterError> {
let synchronizer = synchronizer.clone();
while shutdown_rx.is_empty() {
let result = synchronizer
.synchronize_non_fungible_asset_indexes(&shutdown_rx, config.dump_sync_threshold)
.synchronize_fungible_asset_indexes(&shutdown_rx, config.dump_sync_threshold)
.await;

match result {
Expand Down
Loading

0 comments on commit 63a1c4a

Please sign in to comment.