pub struct IxUtils;Implementations§
Source§impl IxUtils
impl IxUtils
pub fn build_account_keys_hashmap( account_keys: &[Pubkey], ) -> HashMap<Pubkey, u8>
pub fn get_account_key_if_present( ix: &Instruction, index: usize, ) -> Option<Pubkey>
pub fn get_account_key_required( account_keys: &[Pubkey], index: usize, ) -> Result<Pubkey, KoraError>
pub fn build_default_compiled_instruction( program_id_index: u8, ) -> CompiledInstruction
pub fn uncompile_instructions( instructions: &[CompiledInstruction], account_keys: &[Pubkey], ) -> Result<Vec<Instruction>, KoraError>
Sourcepub fn reconstruct_instruction_from_ui(
ui_instruction: &UiInstruction,
all_account_keys: &mut Vec<Pubkey>,
) -> Result<CompiledInstruction, KoraError>
pub fn reconstruct_instruction_from_ui( ui_instruction: &UiInstruction, all_account_keys: &mut Vec<Pubkey>, ) -> Result<CompiledInstruction, KoraError>
Reconstruct a CompiledInstruction from various UiInstruction formats
This is required because when you simulate a transaction with inner instructions flag, the RPC pre-parses some of the instructions (like for SPL program and System Program), however this is an issue for Kora, as we expected “Compiled” instructions rather than “Parsed” instructions, because we have our own parsing logic on our Kora’s side.
So we need to reconstruct the “Compiled” instructions from the “Parsed” instructions, by “unparsing” the “Parsed” instructions.
There’s no known way to force the RPC to not parsed the instructions, so we need this “hack” to reverse the process.
Example: https://github.com/anza-xyz/agave/blob/68032b576dc4c14b31c15974c6734ae1513980a3/transaction-status/src/parse_system.rs#L11
pub fn reconstruct_instruction_from_ui_with_account_key_cache( ui_instruction: &UiInstruction, all_account_keys: &mut Vec<Pubkey>, account_keys_hashmap: &mut HashMap<Pubkey, u8>, ) -> Result<CompiledInstruction, KoraError>
pub fn parse_system_instructions( transaction: &VersionedTransactionResolved, ) -> Result<HashMap<ParsedSystemInstructionType, Vec<ParsedSystemInstructionData>>, KoraError>
pub fn parse_token_instructions( transaction: &VersionedTransactionResolved, ) -> Result<HashMap<ParsedSPLInstructionType, Vec<ParsedSPLInstructionData>>, KoraError>
Auto Trait Implementations§
impl Freeze for IxUtils
impl RefUnwindSafe for IxUtils
impl Send for IxUtils
impl Sync for IxUtils
impl Unpin for IxUtils
impl UnsafeUnpin for IxUtils
impl UnwindSafe for IxUtils
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more