Reference@proto-kit/protocolClassesRuntimeMethodExecutionContext

@proto-kit/protocol • Docs


Documentation / @proto-kit/protocol / RuntimeMethodExecutionContext

Class: RuntimeMethodExecutionContext

Execution context used to wrap runtime module methods, allowing them to post relevant information (such as execution status) into the context without any unnecessary ‘prop drilling’.

Extends

Constructors

new RuntimeMethodExecutionContext()

new RuntimeMethodExecutionContext(): RuntimeMethodExecutionContext

Returns

RuntimeMethodExecutionContext

Inherited from

ProvableMethodExecutionContext.constructor

Properties

id

id: string

Inherited from

ProvableMethodExecutionContext.id

Defined in

packages/common/dist/zkProgrammable/ProvableMethodExecutionContext.d.ts:16


input

input: undefined | RuntimeMethodExecutionData

Defined in

packages/protocol/src/state/context/RuntimeMethodExecutionContext.ts:57


methods

methods: string[] = []

Overrides

ProvableMethodExecutionContext.methods

Defined in

packages/protocol/src/state/context/RuntimeMethodExecutionContext.ts:55


result

result: RuntimeProvableMethodExecutionResult

Overrides

ProvableMethodExecutionContext.result

Defined in

packages/protocol/src/state/context/RuntimeMethodExecutionContext.ts:69

Accessors

isFinished

Get Signature

get isFinished(): boolean

Returns

boolean

Inherited from

ProvableMethodExecutionContext.isFinished

Defined in

packages/common/dist/zkProgrammable/ProvableMethodExecutionContext.d.ts:41


isTopLevel

Get Signature

get isTopLevel(): boolean

Returns

boolean

Inherited from

ProvableMethodExecutionContext.isTopLevel

Defined in

packages/common/dist/zkProgrammable/ProvableMethodExecutionContext.d.ts:40

Methods

addEvent()

addEvent<T>(eventType, event, eventName, condition): void

Type Parameters

• T

Parameters

• eventType: FlexibleProvablePure<T>

• event: T

• eventName: string

• condition: Bool = ...

Returns

void

Defined in

packages/protocol/src/state/context/RuntimeMethodExecutionContext.ts:88


addStateTransition()

addStateTransition<Value>(stateTransition): void

Adds an in-method generated state transition to the current context

Type Parameters

• Value

Parameters

• stateTransition: StateTransition<Value>

State transition to add to the context

Returns

void

Defined in

packages/protocol/src/state/context/RuntimeMethodExecutionContext.ts:83


afterMethod()

afterMethod(): void

Removes the latest method from the execution context stack, keeping track of the amount of ‘unfinished’ methods. Allowing for the context to distinguish between top-level and nested method calls.

Returns

void

Overrides

ProvableMethodExecutionContext.afterMethod

Defined in

packages/protocol/src/state/context/RuntimeMethodExecutionContext.ts:156


beforeMethod()

beforeMethod(moduleName, methodName, args): void

Adds a method to the method execution stack, reseting the execution context in a case a new top-level (non nested) method call is made.

Parameters

• moduleName: string

• methodName: string

Name of the method being captured in the context

• args: ArgumentTypes

Returns

void

Inherited from

ProvableMethodExecutionContext.beforeMethod

Defined in

packages/common/dist/zkProgrammable/ProvableMethodExecutionContext.d.ts:33


clear()

clear(): void

Manually clears/resets the execution context

Returns

void

Overrides

ProvableMethodExecutionContext.clear

Defined in

packages/protocol/src/state/context/RuntimeMethodExecutionContext.ts:152


current()

current(): object

Had to override current() otherwise it would not infer the type of result correctly (parent type would be reused)

Returns

object

input

input: undefined | RuntimeMethodExecutionData

isFinished

isFinished: boolean

isSimulated

isSimulated: undefined | boolean

result

result: RuntimeProvableMethodExecutionResult

Overrides

ProvableMethodExecutionContext.current

Defined in

packages/protocol/src/state/context/RuntimeMethodExecutionContext.ts:173


setProver()

setProver(prover): void

Adds a method prover to the current execution context, which can be collected and ran asynchronously at a later point in time.

Parameters

• prover

Returns

void

Inherited from

ProvableMethodExecutionContext.setProver

Defined in

packages/common/dist/zkProgrammable/ProvableMethodExecutionContext.d.ts:26


setSimulated()

setSimulated(simulated): void

Parameters

• simulated: boolean

Returns

void

Defined in

packages/protocol/src/state/context/RuntimeMethodExecutionContext.ts:145


setStatus()

setStatus(status): void

Parameters

• status: Bool

Execution status of the current method

Returns

void

Defined in

packages/protocol/src/state/context/RuntimeMethodExecutionContext.ts:118


setStatusMessage()

setStatusMessage(message?, stackTrace?): void

Parameters

• message?: string

Status message to acompany the current status

• stackTrace?: string

Returns

void

Defined in

packages/protocol/src/state/context/RuntimeMethodExecutionContext.ts:106


setup()

setup(input): void

Parameters

• input: RuntimeMethodExecutionData

Input witness data required for a runtime execution

Returns

void

Defined in

packages/protocol/src/state/context/RuntimeMethodExecutionContext.ts:129


witnessInput()

witnessInput(): RuntimeMethodExecutionDataStruct

Returns

RuntimeMethodExecutionDataStruct

Defined in

packages/protocol/src/state/context/RuntimeMethodExecutionContext.ts:133