Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion client/v2/algod/waitForBlock.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 13 additions & 0 deletions client/v2/common/models/avm_value.go
Original file line number Diff line number Diff line change
@@ -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"`
}
10 changes: 10 additions & 0 deletions client/v2/common/models/scratch_change.go
Original file line number Diff line number Diff line change
@@ -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"`
}
8 changes: 8 additions & 0 deletions client/v2/common/models/simulate_trace_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
9 changes: 9 additions & 0 deletions client/v2/common/models/simulation_opcode_trace_unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}