Skip to content

Commit

Permalink
Remove asset_was_decompressed
Browse files Browse the repository at this point in the history
Replaced with WHERE clauses on each upsert.
Move remaining upserts from mint_v1 to db.rs.
Remove upsert to asset_v1_account_attachments from mint_V1.
Combine upserts for asset base info and royalty amount.
  • Loading branch information
danenbm committed Dec 4, 2023
1 parent e38f64a commit 933e299
Show file tree
Hide file tree
Showing 12 changed files with 207 additions and 244 deletions.
3 changes: 0 additions & 3 deletions nft_ingester/src/program_transformers/bubblegum/burn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ where
T: ConnectionTrait + TransactionTrait,
{
if let Some(cl) = &parsing_result.tree_update {
// Note: We do not check whether the asset has been decompressed here because we know if it
// was burned then it could not have been decompressed later.

let seq = save_changelog_event(cl, bundle.slot, bundle.txn_id, txn, cl_audits).await?;
let leaf_index = cl.index;
let (asset_id, _) = Pubkey::find_program_address(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
error::IngesterError,
program_transformers::bubblegum::{
asset_was_decompressed, save_changelog_event, upsert_asset_with_leaf_info,
save_changelog_event, upsert_asset_with_leaf_info,
upsert_asset_with_owner_and_delegate_info, upsert_asset_with_seq,
},
};
Expand Down Expand Up @@ -31,12 +31,6 @@ where
..
} => {
let id_bytes = id.to_bytes();

// First check to see if this asset has been decompressed and if so do not update.
if asset_was_decompressed(txn, id_bytes.to_vec()).await? {
return Ok(());
}

let owner_bytes = owner.to_bytes().to_vec();
let delegate = if owner == delegate || delegate.to_bytes() == [0; 32] {
None
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use crate::program_transformers::bubblegum::{
asset_was_decompressed, upsert_asset_with_seq, upsert_collection_info,
};
use crate::program_transformers::bubblegum::{upsert_asset_with_seq, upsert_collection_info};
use blockbuster::{
instruction::InstructionBundle,
programs::bubblegum::{BubblegumInstruction, LeafSchema, Payload},
Expand Down Expand Up @@ -44,11 +42,6 @@ where
LeafSchema::V1 { id, .. } => id.to_bytes().to_vec(),
};

// First check to see if this asset has been decompressed and if so do not update.
if asset_was_decompressed(txn, id_bytes.to_vec()).await? {
return Ok(());
}

let tree_id = cl.id.to_bytes();
let nonce = cl.index as i64;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
error::IngesterError,
program_transformers::bubblegum::{
asset_was_decompressed, save_changelog_event, upsert_asset_with_leaf_info,
save_changelog_event, upsert_asset_with_leaf_info,
upsert_asset_with_owner_and_delegate_info, upsert_asset_with_seq, upsert_creator_verified,
},
};
Expand Down Expand Up @@ -52,11 +52,6 @@ where
} => {
let id_bytes = id.to_bytes();

// First check to see if this asset has been decompressed and if so do not update.
if asset_was_decompressed(txn, id_bytes.to_vec()).await? {
return Ok(());
}

let owner_bytes = owner.to_bytes().to_vec();
let delegate = if owner == delegate || delegate.to_bytes() == [0; 32] {
None
Expand Down
Loading

0 comments on commit 933e299

Please sign in to comment.