diff --git a/Cargo.lock b/Cargo.lock index 3b736a7a6..217d2dd55 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3993,7 +3993,7 @@ dependencies = [ [[package]] name = "plerkle_serialization" version = "1.7.0" -source = "git+https://github.com/rpcpool/digital-asset-validator-plugin.git?branch=espi/plerkle-solana-parsers#43c14870252b9e8264b8b1c57f9e0fc379f1621c" +source = "git+https://github.com/rpcpool/digital-asset-validator-plugin.git?branch=espi/plerkle-solana-parsers#ddbfedeaab646c9c4c2f2de5003e25122cd5a203" dependencies = [ "bs58 0.4.0", "chrono", diff --git a/integration_tests/tests/integration_tests/common.rs b/integration_tests/tests/integration_tests/common.rs index 7709fd040..91fbe1184 100644 --- a/integration_tests/tests/integration_tests/common.rs +++ b/integration_tests/tests/integration_tests/common.rs @@ -16,8 +16,8 @@ use nft_ingester::config; use once_cell::sync::Lazy; use plerkle_serialization::{ deserializer::{ - parse_account_keys, parse_message_instructions, parse_meta_inner_instructions, - parse_pubkey, parse_signature, parse_slice, + parse_account_keys, parse_compiled_inner_instructions, parse_compiled_instructions, + parse_inner_instructions, parse_pubkey, parse_signature, parse_slice, }, root_as_account_info, root_as_transaction_info, serializer::{seralize_encoded_transaction_with_status, serialize_account}, @@ -427,6 +427,14 @@ async fn cached_fetch_transaction(setup: &TestSetup, sig: Signature) -> Vec pub async fn index_transaction(setup: &TestSetup, sig: Signature) { let txn_bytes: Vec = cached_fetch_transaction(setup, sig).await; let txn = root_as_transaction_info(&txn_bytes).unwrap(); + let meta_inner_instructions = + parse_compiled_inner_instructions(txn.compiled_inner_instructions()) + .and_then(|compiled| { + parse_inner_instructions(txn.inner_instructions()) + .map(|inner| [compiled, inner].concat()) + }) + .expect("meta inner instructions failed to parse"); + setup .transformer .handle_transaction(&TransactionInfo { @@ -434,12 +442,9 @@ pub async fn index_transaction(setup: &TestSetup, sig: Signature) { signature: &parse_signature(txn.signature()).expect("failed to parse transaction"), account_keys: &parse_account_keys(txn.account_keys()) .expect("failed to parse transaction"), - message_instructions: &parse_message_instructions(txn.outer_instructions()) + message_instructions: &parse_compiled_instructions(txn.outer_instructions()) .expect("failed to parse transaction"), - meta_inner_instructions: &parse_meta_inner_instructions( - txn.compiled_inner_instructions(), - ) - .expect("failed to parse transaction"), + meta_inner_instructions: &meta_inner_instructions, }) .await .unwrap(); diff --git a/nft_ingester/src/transaction_notifications.rs b/nft_ingester/src/transaction_notifications.rs index 95f6eac04..ed1c072fb 100644 --- a/nft_ingester/src/transaction_notifications.rs +++ b/nft_ingester/src/transaction_notifications.rs @@ -11,8 +11,8 @@ use { plerkle_messenger::{ConsumptionType, Messenger, MessengerConfig, RecvData}, plerkle_serialization::{ deserializer::{ - parse_account_keys, parse_message_instructions, parse_meta_inner_instructions, - parse_signature, + parse_account_keys, parse_compiled_inner_instructions, parse_compiled_instructions, + parse_inner_instructions, parse_signature, }, root_as_transaction_info, }, @@ -130,18 +130,23 @@ async fn handle_transaction_update<'a>( manager: Arc, tx: plerkle_serialization::TransactionInfo<'_>, ) -> ProgramTransformerResult<()> { + let meta_inner_instructions = + parse_compiled_inner_instructions(tx.compiled_inner_instructions()) + .and_then(|compiled| { + parse_inner_instructions(tx.inner_instructions()) + .map(|inner| [compiled, inner].concat()) + }) + .map_err(into_program_transformer_err)?; + manager .handle_transaction(&TransactionInfo { slot: tx.slot(), signature: &parse_signature(tx.signature()).map_err(into_program_transformer_err)?, account_keys: &parse_account_keys(tx.account_keys()) .map_err(into_program_transformer_err)?, - message_instructions: &parse_message_instructions(tx.outer_instructions()) + message_instructions: &parse_compiled_instructions(tx.outer_instructions()) .map_err(into_program_transformer_err)?, - meta_inner_instructions: &parse_meta_inner_instructions( - tx.compiled_inner_instructions(), - ) - .map_err(into_program_transformer_err)?, + meta_inner_instructions: &meta_inner_instructions, }) .await }