Skip to main content

VmStack

@midnight-ntwrk/compact-runtime v0.9.0


@midnight-ntwrk/compact-runtime / VmStack

Class: VmStack

Represents the state of the VM's stack at a specific point. The stack is an array of StateValues, each of which is also annotated with whether it is "strong" or "weak"; that is, whether it is permitted to be stored on-chain or not.

Constructors​

Constructor​

new VmStack(): VmStack;

Returns​

VmStack

Methods​

get()​

get(idx): undefined | StateValue;

Parameters​

idx​

number

Returns​

undefined | StateValue


isStrong()​

isStrong(idx): undefined | boolean;

Parameters​

idx​

number

Returns​

undefined | boolean


length()​

length(): number;

Returns​

number


push()​

push(value, is_strong): void;

Parameters​

value​

StateValue

is_strong​

boolean

Returns​

void


removeLast()​

removeLast(): void;

Returns​

void


toString()​

toString(compact?): string;

Parameters​

compact?​

boolean

Returns​

string