value

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 9 Imported by: 18

Documentation

Index

Constants

View Source
const (
	TypeCodeInt           uint8 = 0
	TypeCodeCodePoint     uint8 = 1
	TypeCodeHashPreImage  uint8 = 2
	TypeCodeTuple         uint8 = 3
	TypeCodeBuffer        uint8 = 12
	TypeCodeCodePointStub uint8 = 13
)
View Source
const MaxTupleSize = 8

Variables

This section is empty.

Functions

func Eq

func Eq(x, y Value) bool

func IsValidTupleSizeI64

func IsValidTupleSizeI64(size int64) bool

Types

type BasicOperation

type BasicOperation struct {
	Op Opcode
}

func NewBasicOperationFromReader

func NewBasicOperationFromReader(rd io.Reader) (BasicOperation, error)

func (BasicOperation) Equals added in v0.8.0

func (op BasicOperation) Equals(other Operation) bool

func (BasicOperation) GetOp

func (op BasicOperation) GetOp() Opcode

func (BasicOperation) String added in v0.4.0

func (op BasicOperation) String() string

func (BasicOperation) TypeCode

func (op BasicOperation) TypeCode() uint8

type Buffer added in v0.8.0

type Buffer struct {
	// contains filtered or unexported fields
}

func NewBufferFromReader added in v0.8.0

func NewBufferFromReader(rd io.Reader) (*Buffer, error)

func (*Buffer) Data added in v0.8.0

func (b *Buffer) Data() []byte

func (*Buffer) Equal added in v0.8.0

func (b *Buffer) Equal(other Value) bool

func (*Buffer) Size added in v0.8.0

func (b *Buffer) Size() int64

func (*Buffer) String added in v0.8.0

func (b *Buffer) String() string

func (*Buffer) TypeCode added in v0.8.0

func (b *Buffer) TypeCode() uint8

type CodePointStub added in v0.7.0

type CodePointStub struct {
	PC uint64
	// contains filtered or unexported fields
}

func NewCodePointStubFromReader added in v0.7.0

func NewCodePointStubFromReader(rd io.Reader) (CodePointStub, error)

func (CodePointStub) Clone added in v0.7.0

func (cp CodePointStub) Clone() Value

func (CodePointStub) Equal added in v0.7.0

func (cp CodePointStub) Equal(val Value) bool

func (CodePointStub) Hash added in v0.7.0

func (cp CodePointStub) Hash() common.Hash

func (CodePointStub) Marshal added in v0.7.0

func (cp CodePointStub) Marshal(w io.Writer) error

func (CodePointStub) Size added in v0.7.0

func (cp CodePointStub) Size() int64

func (CodePointStub) String added in v0.7.0

func (cp CodePointStub) String() string

func (CodePointStub) TypeCode added in v0.7.0

func (cp CodePointStub) TypeCode() uint8

type CodePointValue

type CodePointValue struct {
	Op       Operation
	NextHash common.Hash
}

func NewCodePointValueFromReader

func NewCodePointValueFromReader(rd io.Reader) (CodePointValue, error)

func (CodePointValue) Equal

func (cv CodePointValue) Equal(val Value) bool

func (CodePointValue) Size

func (cv CodePointValue) Size() int64

func (CodePointValue) String

func (cv CodePointValue) String() string

func (CodePointValue) TypeCode

func (cv CodePointValue) TypeCode() uint8

type HashPreImage added in v0.6.0

type HashPreImage struct {
	// contains filtered or unexported fields
}

func NewHashPreImageFromReader added in v0.7.0

func NewHashPreImageFromReader(rd io.Reader) (HashPreImage, error)

func NewPreImage added in v0.7.0

func NewPreImage(hashImage common.Hash, size int64) HashPreImage

func (HashPreImage) Clone added in v0.7.0

func (hp HashPreImage) Clone() Value

func (HashPreImage) Equal added in v0.7.0

func (hp HashPreImage) Equal(val Value) bool

func (HashPreImage) GetInnerHash added in v0.7.0

func (hp HashPreImage) GetInnerHash() common.Hash

func (HashPreImage) Size added in v0.6.0

func (hp HashPreImage) Size() int64

func (HashPreImage) String added in v0.7.0

func (hp HashPreImage) String() string

func (HashPreImage) TypeCode added in v0.7.0

func (hp HashPreImage) TypeCode() uint8

type ImmediateOperation

type ImmediateOperation struct {
	Op  Opcode
	Val Value
}

func NewImmediateOperationFromReader

func NewImmediateOperationFromReader(rd io.Reader) (ImmediateOperation, error)

func (ImmediateOperation) Equals added in v0.8.0

func (op ImmediateOperation) Equals(other Operation) bool

func (ImmediateOperation) GetOp

func (op ImmediateOperation) GetOp() Opcode

func (ImmediateOperation) String added in v0.4.0

func (op ImmediateOperation) String() string

func (ImmediateOperation) TypeCode

func (op ImmediateOperation) TypeCode() uint8

type IntValue

type IntValue struct {
	// contains filtered or unexported fields
}

func NewInt64Value

func NewInt64Value(x int64) IntValue

func NewIntValue

func NewIntValue(x *big.Int) IntValue

func NewIntValueFromReader

func NewIntValueFromReader(rd io.Reader) (IntValue, error)

func NewValueFromAddress added in v0.6.0

func NewValueFromAddress(addr common.Address) IntValue

func (IntValue) BigInt

func (iv IntValue) BigInt() *big.Int

func (IntValue) Clone

func (iv IntValue) Clone() Value

func (IntValue) Equal

func (iv IntValue) Equal(val Value) bool

func (IntValue) Hash

func (iv IntValue) Hash() common.Hash

func (IntValue) Marshal

func (iv IntValue) Marshal(w io.Writer) error

func (IntValue) Size

func (iv IntValue) Size() int64

func (IntValue) String

func (iv IntValue) String() string

func (IntValue) ToBytes

func (iv IntValue) ToBytes() [32]byte

func (IntValue) TypeCode

func (iv IntValue) TypeCode() uint8

type Opcode

type Opcode uint8

func NewOpcodeFromReader

func NewOpcodeFromReader(rd io.Reader) (Opcode, error)

func (Opcode) Marshal

func (o Opcode) Marshal(wr io.Writer) error

type Operation

type Operation interface {
	GetOp() Opcode
	TypeCode() uint8
	Equals(other Operation) bool
}

func NewOperationFromReader

func NewOperationFromReader(rd io.Reader) (Operation, error)

type TupleValue

type TupleValue struct {
	// contains filtered or unexported fields
}

func NewEmptyTuple

func NewEmptyTuple() *TupleValue

func NewSizedTupleFromReader

func NewSizedTupleFromReader(rd io.Reader, size byte) (*TupleValue, error)

func NewTuple2

func NewTuple2(value1 Value, value2 Value) *TupleValue

func NewTupleFromSlice

func NewTupleFromSlice(slice []Value) (*TupleValue, error)

func NewTupleOfSizeWithContents

func NewTupleOfSizeWithContents(contents [MaxTupleSize]Value, size int8) (*TupleValue, error)

func (*TupleValue) Contents

func (tv *TupleValue) Contents() []Value

func (*TupleValue) Equal

func (tv *TupleValue) Equal(val Value) bool

func (*TupleValue) GetByInt64

func (tv *TupleValue) GetByInt64(idx int64) (Value, error)

func (*TupleValue) Len

func (tv *TupleValue) Len() int64

func (*TupleValue) Size

func (tv *TupleValue) Size() int64

func (*TupleValue) String

func (tv *TupleValue) String() string

func (*TupleValue) TypeCode

func (tv *TupleValue) TypeCode() uint8

type UnmarshalError

type UnmarshalError struct {
	// contains filtered or unexported fields
}

func (UnmarshalError) Error

func (e UnmarshalError) Error() string

type Value

type Value interface {
	TypeCode() uint8
	Equal(Value) bool
	Size() int64
	String() string
}

func UnmarshalValue

func UnmarshalValue(r io.Reader) (Value, error)

func UnmarshalValueWithType

func UnmarshalValueWithType(tipe byte, r io.Reader) (Value, error)

Jump to

Keyboard shortcuts

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