Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return if compression leaf not found #67

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions indexer/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,12 @@
let asset_id = get_asset_id(&merkle_tree, tkn_instruction.nonce);

let compression_leaf =
CompressionLeaf::find_by_asset_id(conn, asset_id.to_string())
.await?
.context("compression leaf not found")?;
CompressionLeaf::find_by_asset_id(conn, asset_id.to_string()).await?;

if compression_leaf.is_none() {
return Ok(());
}
let compression_leaf = compression_leaf.context("Compression leaf not found")?;

let collection_mint_id = compression_leaf.id;
let leaf_owner = compression_leaf.leaf_owner.clone();
Expand All @@ -154,7 +157,7 @@
mint_address: asset_id.to_string(),
sender: leaf_owner,
recipient: new_leaf_owner.to_string(),
tx_signature: Signature::new(sig.as_slice()).to_string(),

Check warning on line 160 in indexer/src/processor.rs

View workflow job for this annotation

GitHub Actions / Cargo Test

use of deprecated associated function `solana_sdk::signature::Signature::new`: Please use 'Signature::from' or 'Signature::try_from' instead

Check warning on line 160 in indexer/src/processor.rs

View workflow job for this annotation

GitHub Actions / clippy/check/doc

use of deprecated associated function `solana_sdk::signature::Signature::new`: Please use 'Signature::from' or 'Signature::try_from' instead
})),
}),
Some(&SolanaNftEventKey {
Expand Down Expand Up @@ -232,7 +235,7 @@
mint_address: destination_tkn_act.mint.to_string(),
sender: mint.owner.to_string(),
recipient: new_owner,
tx_signature: Signature::new(sig.as_slice()).to_string(),

Check warning on line 238 in indexer/src/processor.rs

View workflow job for this annotation

GitHub Actions / Cargo Test

use of deprecated associated function `solana_sdk::signature::Signature::new`: Please use 'Signature::from' or 'Signature::try_from' instead

Check warning on line 238 in indexer/src/processor.rs

View workflow job for this annotation

GitHub Actions / clippy/check/doc

use of deprecated associated function `solana_sdk::signature::Signature::new`: Please use 'Signature::from' or 'Signature::try_from' instead
})),
}),
Some(&SolanaNftEventKey {
Expand Down
Loading