Skip to content

InstructionUpdate should contain the tree-"path" of that ix in the respective tx #179

@grooviegermanikus

Description

@grooviegermanikus

With "path" I mean this 1.5 show in solscan for example.
See also carbon example.

In handlers I want to use the path to:

  • detect if two ix are in same CPI (i.e. 1.3+1.6 -> true, 1.3+2.3 -> false)
  • log the instruction

Disclaimer: not sure if path is the right term for that thing

API could look like:

    async fn handle(&self, value: &AmmInstruction, input: &InstructionUpdate) -> HandlerResult<()> {

        let ix_path: Vec<u8> = input.ix_path().into();
        assert_eq!(format!("{:?}", ix_path), "1.5");

        assert!(ix_path1.is_sibling(is_path2));
        assert!(ix_path3.is_child_of(is_path2));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions