sim

package
v0.0.0-...-9b912b9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppRunConfig

type AppRunConfig struct {
	Debug bool

	Args     [][]byte
	Accounts []string
	Apps     []uint64
	Assets   []uint64
	Schema   AppRunConfigSchema
}

type AppRunConfigSchema

type AppRunConfigSchema struct {
	Local  AppRunConfigSchemaValues
	Global AppRunConfigSchemaValues
}

type AppRunConfigSchemaValues

type AppRunConfigSchemaValues struct {
	Bytes   uint8
	Uint64s uint8
}

type ProgramExecution

type ProgramExecution struct {
	Approval []ProgramExecutionTrace
	Clear    []ProgramExecutionTrace

	Inner []ProgramExecution
}

type ProgramExecutionTrace

type ProgramExecutionTrace struct {
	models.SimulationOpcodeTraceUnit
	Line int
	Text string
}

type ReplayConfig

type ReplayConfig struct {
	Ac *algod.Client
}

type Result

type Result struct {
	Error      error
	Executions []ProgramExecution
}

func Replay

func Replay(approval []byte, sr models.SimulateResponse, config ReplayConfig) (Result, error)

func Run

func Run(approval []byte, clear []byte, config RunConfig) (Result, error)

type RunConfig

type RunConfig struct {
	Ac     *algod.Client
	Sender string
	Create AppRunConfig
	Call   AppRunConfig
}

type Vm

type Vm struct {
	Error     error
	Triggered map[int][]int
	Branch    *VmBranch
	Branches  []*VmBranch
	Pause     bool
}

func NewVm

func NewVm(r Result) (*Vm, error)

func (*Vm) Run

func (v *Vm) Run()

func (*Vm) SetBreakpoints

func (v *Vm) SetBreakpoints(lines []int) map[int]bool

func (*Vm) Step

func (v *Vm) Step() bool

func (*Vm) Switch

func (v *Vm) Switch(id int)

type VmBox

type VmBox struct {
	Key   []byte
	Value []byte
}

type VmBoxes

type VmBoxes struct {
	Items []VmBox
}

type VmBranch

type VmBranch struct {
	Id        int
	Budget    int
	Stack     VmStack
	Local     map[string]VmState
	Global    VmState
	Boxes     VmBoxes
	Scratch   VmScratch
	PrevTrace *ProgramExecutionTrace
	Line      int
	Name      string
	Frames    []VmFrame
	Trace     []ProgramExecutionTrace
	// contains filtered or unexported fields
}

type VmConfig

type VmConfig struct {
	Ac *algod.Client

	Args     [][]byte
	Accounts []string
	Apps     []uint64
	Assets   []uint64
}

type VmFrame

type VmFrame struct {
	Return int
	Name   string
}

type VmScratch

type VmScratch struct {
	Items []VmValue
}

type VmStack

type VmStack struct {
	Items []VmValue
}

type VmState

type VmState struct {
	Items []VmStateItem
}

type VmStateItem

type VmStateItem struct {
	Key   []byte
	Type  VmStateItemType
	Bytes []byte
	Uint  uint64
}

type VmStateItemType

type VmStateItemType int
const (
	VmStateItemTypeBytes VmStateItemType = iota
	VmStateItemTypeUint
)

type VmValue

type VmValue struct {
	models.AvmValue
}

func (VmValue) IsNone

func (i VmValue) IsNone() bool

func (VmValue) String

func (i VmValue) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL