Type alias EvaluationSample<ProgramState>

EvaluationSample<ProgramState>: {
    evaluationRange: Range;
    instruction?: AuthenticationInstruction;
    internalStates: {
        instruction: AuthenticationInstruction;
        state: ProgramState;
    }[];
    range: Range;
    state: ProgramState;
}

An evaluation sample extracted from a script reduction trace – includes the range of the evaluation from which the sample was extracted, the instruction that was evaluated, the range in the source script over which the instruction was defined, and the resulting program state.

Type Parameters

  • ProgramState

Type declaration

  • evaluationRange: Range

    The range of the evaluation node in which this sample was generated.

    This can be used to identify which other samples were part of the same evaluation that produced this sample.

  • Optional instruction?: AuthenticationInstruction

    The final instruction that was evaluated during this sample.

    Note, the first sample from any evaluation is the initial state before any instructions are executed, so its instruction is undefined. For all other samples, instruction must be defined.

  • internalStates: {
        instruction: AuthenticationInstruction;
        state: ProgramState;
    }[]

    An ordered array of instructions and program states that occurred within the range of a single reduction trace node before the final instruction and state (assigned to instruction and state, respectively).

    This occurs in unusual cases where multiple opcodes are defined in the same reduced node, e.g. a long hex literal of operations as bytecode or an evaluation that is not wrapped in a push.

    Usually, this will be an empty array.

  • range: Range

    The range over which this sample was defined in the source script.

  • state: ProgramState

    The program state after the evaluation of this sample's instruction.

Generated using TypeDoc