Skip to content

Commit

Permalink
refactor: address cr and reference published crates for plerkle_seria…
Browse files Browse the repository at this point in the history
…lization and blockbuster
  • Loading branch information
kespinola committed Mar 8, 2024
1 parent ab6dbb3 commit 81c4058
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
8 changes: 5 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ anyhow = "1.0.75"
async-std = "1.0.0"
async-trait = "0.1.60"
backon = "0.4.1"
blockbuster = "1.1.0"
blockbuster = "2.0.0"
borsh = "~0.10.3"
borsh-derive = "~0.10.3"
bs58 = "0.4.0"
Expand Down Expand Up @@ -118,10 +118,6 @@ clone_on_ref_ptr = "deny"
missing_const_for_fn = "deny"
trivially_copy_pass_by_ref = "deny"

[patch.crates-io]
blockbuster = { git = "https://github.com/rpcpool/blockbuster.git", branch = "rm-plerkle-101" }
plerkle_serialization = { git = "https://github.com/rpcpool/digital-asset-validator-plugin.git", branch = "espi/plerkle-solana-parsers" }

[profile.release]
codegen-units = 1
lto = true
11 changes: 6 additions & 5 deletions nft_ingester/src/plerkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ impl<'a> TryFrom<PlerkleTransactionInfo<'a>> for TransactionInfo {
.try_into()?;
let compiled = tx_info.compiled_inner_instructions();
let inner = tx_info.inner_instructions();
let meta_inner_instructions = compiled
.map(|c| PlerkleCompiledInnerInstructionVector(c).try_into())
.or_else(|| inner.map(|i| PlerkleInnerInstructionsVector(i).try_into()))
.transpose()?
.unwrap_or_default();
let meta_inner_instructions = if let Some(c) = compiled {
PlerkleCompiledInnerInstructionVector(c).try_into()
} else {
PlerkleInnerInstructionsVector(inner.ok_or(PlerkleDeserializerError::NotFound)?)
.try_into()
}?;

Ok(Self {
slot,
Expand Down

0 comments on commit 81c4058

Please sign in to comment.