kevinheavey / solders

A high-performance Python toolkit for Solana, written in Rust
https://kevinheavey.github.io/solders/
Apache License 2.0
232 stars 26 forks source link

`stack_height` not exposed on `UiCompiledInstruction` #102

Closed rafales closed 3 months ago

rafales commented 3 months ago
In [25]: type(x)
Out[25]: <class 'solders.transaction_status.UiCompiledInstruction'>

In [26]: x
Out[26]: 

UiCompiledInstruction(
    UiCompiledInstruction {
        program_id_index: 35,
        accounts: [
            32,
            30,
            34,
            30,
            31,
            29,
            30,
            30,
            30,
            30,
            30,
            30,
            30,
            30,
            12,
            6,
            0,
        ],
        data: "5wpeKZvwEEyyaDKViUUybtT",
        stack_height: Some(
            2,
        ),
    },
)

In [27]: x.stack_height
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in <module>:1                                                                                    │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'solders.transaction_status.UiCompiledInstruction' object has no attribute 'stack_height'

Seems that stack_height is not exposed even though the data is there. The only way to access it at the moment is to serialize to JSON using to_json() and then parse it from python.