Documentation
¶
Index ¶
- Constants
- Variables
- func Equal(x, y *Machine) (bool, string)
- type BlockedError
- type Context
- type DivideByZeroError
- type EmptyStackError
- type ErrorInstructionError
- type Instruction
- type Machine
- func (m *Machine) AuxStack() stack.Stack
- func (m *Machine) Checkpoint(storage machine.CheckpointStorage) bool
- func (m *Machine) Clone() machine.Machine
- func (m *Machine) CurrentStatus() machine.Status
- func (m *Machine) ErrorStop()
- func (m *Machine) ExecuteAssertion(maxSteps uint64, timeBounds *protocol.TimeBounds, inbox value.TupleValue, ...) (*protocol.ExecutionAssertion, uint64)
- func (m *Machine) GetAllOperations() []value.Operation
- func (m *Machine) GetErrHandler() value.CodePointValue
- func (m *Machine) GetInbox() value.TupleValue
- func (m *Machine) GetLowerBoundBlock() value.IntValue
- func (m *Machine) GetLowerBoundTimestamp() value.IntValue
- func (m *Machine) GetOperation() value.Operation
- func (m *Machine) GetPC() value.CodePointValue
- func (m *Machine) GetSizeLimit() int64
- func (m *Machine) GetUpperBoundBlock() value.IntValue
- func (m *Machine) GetUpperBoundTimestamp() value.IntValue
- func (m *Machine) Halt()
- func (m *Machine) Hash() common.Hash
- func (m *Machine) HaveSizeException() bool
- func (m *Machine) IncrPC()
- func (m *Machine) IsBlocked(currentTime *common.TimeBlocks, newMessages bool) machine.BlockReason
- func (m *Machine) IsErrored() bool
- func (m *Machine) IsHalted() bool
- func (m *Machine) Log(val value.Value)
- func (m *Machine) MarshalForProof() ([]byte, error)
- func (m *Machine) PrintState()
- func (m *Machine) Register() *MachineValue
- func (m *Machine) Send(message value.Value)
- func (m *Machine) SetContext(mc Context)
- func (m *Machine) SetPC(iv value.Value) error
- func (m *Machine) Stack() stack.Stack
- func (m *Machine) Static() *MachineValue
- func (m *Machine) Warn(str string)
- type MachineAssertionContext
- func (ac *MachineAssertionContext) EndContext()
- func (ac *MachineAssertionContext) Finalize(m *Machine) (*protocol.ExecutionAssertion, uint64)
- func (ac *MachineAssertionContext) GasCount() uint64
- func (m *MachineAssertionContext) GetInbox() value.TupleValue
- func (m *MachineAssertionContext) GetLowerBoundBlock() value.IntValue
- func (m *MachineAssertionContext) GetLowerBoundTimestamp() value.IntValue
- func (m *MachineAssertionContext) GetUpperBoundBlock() value.IntValue
- func (m *MachineAssertionContext) GetUpperBoundTimestamp() value.IntValue
- func (ac *MachineAssertionContext) LoggedValue(data value.Value)
- func (ac *MachineAssertionContext) NotifyStep(numGas uint64)
- func (ac *MachineAssertionContext) OutMessageCount() int
- func (m *MachineAssertionContext) ReadInbox()
- func (ac *MachineAssertionContext) Send(message value.Value)
- func (ac *MachineAssertionContext) StepCount() uint64
- type MachinePC
- func (m *MachinePC) Equal(y *MachinePC) (bool, string)
- func (m MachinePC) GetCurrentCodePointHash() common.Hash
- func (m MachinePC) GetCurrentInsn() value.Operation
- func (m MachinePC) GetCurrentInsnName() string
- func (m MachinePC) GetPC() value.CodePointValue
- func (m *MachinePC) IncrPC() error
- func (m *MachinePC) SetPCForced(iv value.Value) error
- type MachineValue
- func (r *MachineValue) Clone() *MachineValue
- func (r *MachineValue) Equal(comp *MachineValue) (bool, string)
- func (r *MachineValue) Get() value.Value
- func (r *MachineValue) ProofValue() value.HashOnlyValue
- func (r *MachineValue) Set(value value.Value)
- func (r *MachineValue) Size() int64
- func (r *MachineValue) StateValue() value.Value
- type NoContext
- func (m *NoContext) GetInbox() value.TupleValue
- func (m *NoContext) GetLowerBoundBlock() value.IntValue
- func (m *NoContext) GetLowerBoundTimestamp() value.IntValue
- func (m *NoContext) GetUpperBoundBlock() value.IntValue
- func (m *NoContext) GetUpperBoundTimestamp() value.IntValue
- func (m *NoContext) LoggedValue(data value.Value)
- func (m *NoContext) NotifyStep(uint64)
- func (m *NoContext) OutMessageCount() int
- func (m *NoContext) ReadInbox()
- func (m *NoContext) Send(message value.Value)
- type PopTypeWarning
- type SilentWarningHandler
- type StackMods
- func NewStackMods(pops, pushes int) StackMods
- func PopAuxStack(m *Machine, mods StackMods) (value.Value, StackMods, error)
- func PopStackBox(m *Machine, mods StackMods) (value.Value, StackMods, error)
- func PopStackCodePoint(m *Machine, mods StackMods) (value.CodePointValue, StackMods, error)
- func PopStackInt(m *Machine, mods StackMods) (value.IntValue, StackMods, error)
- func PopStackTuple(m *Machine, mods StackMods) (value.TupleValue, StackMods, error)
- func PopStackValue(m *Machine, mods StackMods) (value.Value, StackMods, error)
- func PushStackBox(m *Machine, mods StackMods, b value.Value) StackMods
- func PushStackCodePoint(m *Machine, mods StackMods, v value.CodePointValue) StackMods
- func PushStackInt(m *Machine, mods StackMods, v value.IntValue) StackMods
- func PushStackTuple(m *Machine, mods StackMods, v value.TupleValue) StackMods
- func RunInstruction(m *Machine, op value.Operation) (StackMods, machine.BlockReason)
- type VerboseWarningHandler
- type WarningHandler
Constants ¶
View Source
const CodeSaveFrequency = 2
View Source
const MaxAuxStackPops = 1
View Source
const MaxStackPops = 3
Variables ¶
View Source
var HashOfLastInstruction common.Hash
View Source
var Instructions = []Instruction(nil)
Functions ¶
Types ¶
type BlockedError ¶
type BlockedError struct {
// contains filtered or unexported fields
}
func (BlockedError) Error ¶
func (w BlockedError) Error() string
type Context ¶ added in v0.4.0
type Context interface { Send(message value.Value) GetLowerBoundBlock() value.IntValue GetUpperBoundBlock() value.IntValue GetLowerBoundTimestamp() value.IntValue GetUpperBoundTimestamp() value.IntValue NotifyStep(uint64) LoggedValue(value.Value) GetInbox() value.TupleValue ReadInbox() OutMessageCount() int }
type DivideByZeroError ¶
type DivideByZeroError struct { }
func (DivideByZeroError) Error ¶
func (w DivideByZeroError) Error() string
type EmptyStackError ¶
type EmptyStackError struct {
// contains filtered or unexported fields
}
func (EmptyStackError) Error ¶
func (w EmptyStackError) Error() string
type ErrorInstructionError ¶
type ErrorInstructionError struct { }
func (ErrorInstructionError) Error ¶
func (w ErrorInstructionError) Error() string
type Instruction ¶
type Instruction struct {
// contains filtered or unexported fields
}
func (Instruction) GetCode ¶
func (insn Instruction) GetCode() value.Opcode
func (Instruction) GetName ¶
func (insn Instruction) GetName() string
type Machine ¶
type Machine struct {
// contains filtered or unexported fields
}
func NewMachine ¶
func (*Machine) Checkpoint ¶ added in v0.4.0
func (m *Machine) Checkpoint(storage machine.CheckpointStorage) bool
func (*Machine) CurrentStatus ¶
func (*Machine) ExecuteAssertion ¶
func (m *Machine) ExecuteAssertion( maxSteps uint64, timeBounds *protocol.TimeBounds, inbox value.TupleValue, maxWallTime time.Duration, ) (*protocol.ExecutionAssertion, uint64)
ExecuteAssertion runs the machine up to maxSteps steps, stoping earlier if halted, errored or blocked
func (*Machine) GetAllOperations ¶
func (*Machine) GetErrHandler ¶
func (m *Machine) GetErrHandler() value.CodePointValue
func (*Machine) GetInbox ¶ added in v0.4.0
func (m *Machine) GetInbox() value.TupleValue
func (*Machine) GetLowerBoundBlock ¶ added in v0.5.0
func (*Machine) GetLowerBoundTimestamp ¶ added in v0.5.0
func (*Machine) GetOperation ¶
func (*Machine) GetPC ¶
func (m *Machine) GetPC() value.CodePointValue
func (*Machine) GetSizeLimit ¶
func (*Machine) GetUpperBoundBlock ¶ added in v0.5.0
func (*Machine) GetUpperBoundTimestamp ¶ added in v0.5.0
func (*Machine) HaveSizeException ¶
func (*Machine) IsBlocked ¶ added in v0.4.0
func (m *Machine) IsBlocked(currentTime *common.TimeBlocks, newMessages bool) machine.BlockReason
func (*Machine) MarshalForProof ¶
func (*Machine) PrintState ¶
func (m *Machine) PrintState()
func (*Machine) Register ¶
func (m *Machine) Register() *MachineValue
func (*Machine) SetContext ¶
func (*Machine) Static ¶
func (m *Machine) Static() *MachineValue
type MachineAssertionContext ¶
type MachineAssertionContext struct {
// contains filtered or unexported fields
}
func NewMachineAssertionContext ¶
func NewMachineAssertionContext(m *Machine, timeBounds *protocol.TimeBounds, inbox value.TupleValue) *MachineAssertionContext
func (*MachineAssertionContext) EndContext ¶
func (ac *MachineAssertionContext) EndContext()
func (*MachineAssertionContext) Finalize ¶
func (ac *MachineAssertionContext) Finalize(m *Machine) (*protocol.ExecutionAssertion, uint64)
func (*MachineAssertionContext) GasCount ¶ added in v0.4.0
func (ac *MachineAssertionContext) GasCount() uint64
func (*MachineAssertionContext) GetInbox ¶ added in v0.4.0
func (m *MachineAssertionContext) GetInbox() value.TupleValue
func (*MachineAssertionContext) GetLowerBoundBlock ¶ added in v0.5.0
func (m *MachineAssertionContext) GetLowerBoundBlock() value.IntValue
func (*MachineAssertionContext) GetLowerBoundTimestamp ¶ added in v0.5.0
func (m *MachineAssertionContext) GetLowerBoundTimestamp() value.IntValue
func (*MachineAssertionContext) GetUpperBoundBlock ¶ added in v0.5.0
func (m *MachineAssertionContext) GetUpperBoundBlock() value.IntValue
func (*MachineAssertionContext) GetUpperBoundTimestamp ¶ added in v0.5.0
func (m *MachineAssertionContext) GetUpperBoundTimestamp() value.IntValue
func (*MachineAssertionContext) LoggedValue ¶
func (ac *MachineAssertionContext) LoggedValue(data value.Value)
func (*MachineAssertionContext) NotifyStep ¶
func (ac *MachineAssertionContext) NotifyStep(numGas uint64)
func (*MachineAssertionContext) OutMessageCount ¶
func (ac *MachineAssertionContext) OutMessageCount() int
func (*MachineAssertionContext) ReadInbox ¶ added in v0.4.0
func (m *MachineAssertionContext) ReadInbox()
func (*MachineAssertionContext) Send ¶
func (ac *MachineAssertionContext) Send(message value.Value)
func (*MachineAssertionContext) StepCount ¶
func (ac *MachineAssertionContext) StepCount() uint64
type MachinePC ¶
type MachinePC struct {
// contains filtered or unexported fields
}
func NewMachinePC ¶
func NewMachinePC(insns []value.Operation, handler WarningHandler) *MachinePC
func (MachinePC) GetCurrentCodePointHash ¶
func (MachinePC) GetCurrentInsn ¶
func (MachinePC) GetCurrentInsnName ¶
func (MachinePC) GetPC ¶
func (m MachinePC) GetPC() value.CodePointValue
type MachineValue ¶
type MachineValue struct {
// contains filtered or unexported fields
}
func NewMachineValue ¶
func NewMachineValue(val value.Value) *MachineValue
func (*MachineValue) Clone ¶
func (r *MachineValue) Clone() *MachineValue
func (*MachineValue) Equal ¶
func (r *MachineValue) Equal(comp *MachineValue) (bool, string)
func (*MachineValue) Get ¶
func (r *MachineValue) Get() value.Value
func (*MachineValue) ProofValue ¶
func (r *MachineValue) ProofValue() value.HashOnlyValue
func (*MachineValue) Set ¶
func (r *MachineValue) Set(value value.Value)
func (*MachineValue) Size ¶
func (r *MachineValue) Size() int64
func (*MachineValue) StateValue ¶
func (r *MachineValue) StateValue() value.Value
type NoContext ¶ added in v0.4.0
type NoContext struct{}
func (*NoContext) GetInbox ¶ added in v0.4.0
func (m *NoContext) GetInbox() value.TupleValue
func (*NoContext) GetLowerBoundBlock ¶ added in v0.5.0
func (*NoContext) GetLowerBoundTimestamp ¶ added in v0.5.0
func (*NoContext) GetUpperBoundBlock ¶ added in v0.5.0
func (*NoContext) GetUpperBoundTimestamp ¶ added in v0.5.0
func (*NoContext) LoggedValue ¶ added in v0.4.0
func (*NoContext) NotifyStep ¶ added in v0.4.0
func (*NoContext) OutMessageCount ¶ added in v0.4.0
type PopTypeWarning ¶
type PopTypeWarning struct {
// contains filtered or unexported fields
}
func (PopTypeWarning) Error ¶
func (w PopTypeWarning) Error() string
type SilentWarningHandler ¶
type SilentWarningHandler struct {
// contains filtered or unexported fields
}
func NewSilentWarningHandler ¶
func NewSilentWarningHandler() *SilentWarningHandler
func (*SilentWarningHandler) AnyWarnings ¶
func (hand *SilentWarningHandler) AnyWarnings() bool
func (*SilentWarningHandler) Clone ¶
func (hand *SilentWarningHandler) Clone() WarningHandler
func (*SilentWarningHandler) SwitchMachinePC ¶
func (hand *SilentWarningHandler) SwitchMachinePC(m *MachinePC)
func (*SilentWarningHandler) Warn ¶
func (hand *SilentWarningHandler) Warn(wstr string)
type StackMods ¶
type StackMods struct {
// contains filtered or unexported fields
}
func NewStackMods ¶
func PopStackCodePoint ¶
func PopStackTuple ¶
func PushStackCodePoint ¶
func PushStackCodePoint(m *Machine, mods StackMods, v value.CodePointValue) StackMods
func PushStackTuple ¶
func PushStackTuple(m *Machine, mods StackMods, v value.TupleValue) StackMods
func RunInstruction ¶
type VerboseWarningHandler ¶
type VerboseWarningHandler struct {
// contains filtered or unexported fields
}
func NewVerboseWarningHandler ¶
func NewVerboseWarningHandler(m *MachinePC) *VerboseWarningHandler
func (*VerboseWarningHandler) AnyWarnings ¶
func (hand *VerboseWarningHandler) AnyWarnings() bool
func (*VerboseWarningHandler) Clone ¶
func (hand *VerboseWarningHandler) Clone() WarningHandler
func (*VerboseWarningHandler) SwitchMachinePC ¶
func (hand *VerboseWarningHandler) SwitchMachinePC(m *MachinePC)
func (*VerboseWarningHandler) Warn ¶
func (hand *VerboseWarningHandler) Warn(wstr string)
type WarningHandler ¶
type WarningHandler interface { AnyWarnings() bool Warn(string) Clone() WarningHandler SwitchMachinePC(stack *MachinePC) }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.