Skip to content

Commit

Permalink
clippy + nit after PR
Browse files Browse the repository at this point in the history
  • Loading branch information
StanChe committed Jan 17, 2025
1 parent 73190b9 commit 3c762af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 4 additions & 8 deletions nft_ingester/src/api/dapi/change_logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::{
fetch_asset_data,
};

const OFFSET_SLOTS: u64 = 300; // Roughly 2 minutes in Solana time. After this time we consider peding/non-finalized data as invalid and use finalized version instead.
const OFFSET_SLOTS: u64 = 300; // Roughly 2 minutes in Solana time. After this time we consider pending/non-finalized data as invalid and use finalized version instead.

#[derive(Debug, Default, Clone, Eq, PartialEq)]
struct SimpleChangeLog {
Expand Down Expand Up @@ -107,11 +107,8 @@ pub async fn get_proof_for_assets<
node_idx: leaf.node_idx as i64,
leaf_idx: leaf.leaf_idx.map(|idx| idx as i64),
level: leaf.level as i64,
seq: hash
.update_version
.map(|v| v.get_seq())
.flatten()
.unwrap_or_default() as i64,
seq: hash.update_version.and_then(|v| v.get_seq()).unwrap_or_default()
as i64,
hash: hash.value,
},
nonce,
Expand Down Expand Up @@ -143,8 +140,7 @@ pub async fn get_proof_for_assets<
cli_hash: hash.value,
cli_level: node.level as i64,
cli_node_idx: node.node_idx as i64,
cli_seq: hash.update_version.map(|v| v.get_seq()).flatten().unwrap_or_default()
as i64,
cli_seq: hash.update_version.and_then(|v| v.get_seq()).unwrap_or_default() as i64,
cli_tree: node.tree_key.to_bytes().to_vec(),
}
})
Expand Down
4 changes: 3 additions & 1 deletion rocks-db/src/clients/asset_streaming_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ use crate::{
Storage,
};

const OFFSET_SLOTS: u64 = 300;

#[async_trait]
impl AssetDetailsStreamer for Storage {
async fn get_asset_details_stream_in_range(
Expand Down Expand Up @@ -202,7 +204,7 @@ async fn get_complete_asset_details(
.get(Parameter::TopSeenSlot)?
.flatten()
.unwrap_or_default()
.wrapping_sub(300);
.wrapping_sub(OFFSET_SLOTS);

Ok(AssetCompleteDetailsGrpc {
pubkey: static_data.pubkey,
Expand Down

0 comments on commit 3c762af

Please sign in to comment.