diff --git a/client/v2/algod/waitForBlock.go b/client/v2/algod/waitForBlock.go index 70435f39..0c26ec97 100644 --- a/client/v2/algod/waitForBlock.go +++ b/client/v2/algod/waitForBlock.go @@ -9,7 +9,9 @@ import ( ) // StatusAfterBlock waits for a block to appear after round {round} and returns the -// node's status at the time. +// node's status at the time. There is a 1 minute timeout, when reached the current +// status is returned regardless of whether or not it is the round after the given +// round. type StatusAfterBlock struct { c *Client diff --git a/client/v2/common/models/avm_value.go b/client/v2/common/models/avm_value.go new file mode 100644 index 00000000..28e5a47c --- /dev/null +++ b/client/v2/common/models/avm_value.go @@ -0,0 +1,13 @@ +package models + +// AvmValue represents an AVM value. +type AvmValue struct { + // Bytes bytes value. + Bytes []byte `json:"bytes,omitempty"` + + // Type value type. Value `1` refers to **bytes**, value `2` refers to **uint64** + Type uint64 `json:"type"` + + // Uint uint value. + Uint uint64 `json:"uint,omitempty"` +} diff --git a/client/v2/common/models/scratch_change.go b/client/v2/common/models/scratch_change.go new file mode 100644 index 00000000..851f69ee --- /dev/null +++ b/client/v2/common/models/scratch_change.go @@ -0,0 +1,10 @@ +package models + +// ScratchChange a write operation into a scratch slot. +type ScratchChange struct { + // NewValue represents an AVM value. + NewValue AvmValue `json:"new-value"` + + // Slot the scratch slot written. + Slot uint64 `json:"slot"` +} diff --git a/client/v2/common/models/simulate_trace_config.go b/client/v2/common/models/simulate_trace_config.go index 27e4166b..c7552d6d 100644 --- a/client/v2/common/models/simulate_trace_config.go +++ b/client/v2/common/models/simulate_trace_config.go @@ -5,4 +5,12 @@ type SimulateTraceConfig struct { // Enable a boolean option for opting in execution trace features simulation // endpoint. Enable bool `json:"enable,omitempty"` + + // ScratchChange a boolean option enabling returning scratch slot changes together + // with execution trace during simulation. + ScratchChange bool `json:"scratch-change,omitempty"` + + // StackChange a boolean option enabling returning stack changes together with + // execution trace during simulation. + StackChange bool `json:"stack-change,omitempty"` } diff --git a/client/v2/common/models/simulation_opcode_trace_unit.go b/client/v2/common/models/simulation_opcode_trace_unit.go index 1b256458..c6b72144 100644 --- a/client/v2/common/models/simulation_opcode_trace_unit.go +++ b/client/v2/common/models/simulation_opcode_trace_unit.go @@ -6,7 +6,16 @@ type SimulationOpcodeTraceUnit struct { // Pc the program counter of the current opcode being evaluated. Pc uint64 `json:"pc"` + // ScratchChanges the writes into scratch slots. + ScratchChanges []ScratchChange `json:"scratch-changes,omitempty"` + // SpawnedInners the indexes of the traces for inner transactions spawned by this // opcode, if any. SpawnedInners []uint64 `json:"spawned-inners,omitempty"` + + // StackAdditions the values added by this opcode to the stack. + StackAdditions []AvmValue `json:"stack-additions,omitempty"` + + // StackPopCount the number of deleted stack values by this opcode. + StackPopCount uint64 `json:"stack-pop-count,omitempty"` }