types

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: LGPL-3.0 Imports: 14 Imported by: 40

Documentation

Index

Constants

View Source
const (
	MAX_COUNT         = 1024
	MAX_NOTIFY_LENGTH = 64 * 1024 //64Kb
)
View Source
const (
	ByteArrayType byte = 0x00
	BooleanType   byte = 0x01
	IntegerType   byte = 0x02
	InterfaceType byte = 0x40
	ArrayType     byte = 0x80
	StructType    byte = 0x81
	MapType       byte = 0x82
)
View Source
const (
	MAX_STRUCT_DEPTH = 10
	MAX_CLONE_LENGTH = 1024
)

Variables

This section is empty.

Functions

func BuildResultFromNeo added in v1.8.0

func BuildResultFromNeo(item VmValue, bf *common.ZeroCopySink) error

encode the neovm return vmval transform neovm contract result to encoded byte array

Types

type ArrayValue added in v1.8.0

type ArrayValue struct {
	Data []VmValue
}

func NewArrayValue added in v1.8.0

func NewArrayValue() *ArrayValue

func (*ArrayValue) Append added in v1.8.0

func (self *ArrayValue) Append(item VmValue) error

func (*ArrayValue) Len added in v1.8.0

func (self *ArrayValue) Len() int64

func (*ArrayValue) RemoveAt added in v1.8.0

func (self *ArrayValue) RemoveAt(index int64) error

type IntValue added in v1.8.0

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

func IntValFromBigInt added in v1.8.0

func IntValFromBigInt(val *big.Int) (result IntValue, err error)

func IntValFromInt added in v1.8.0

func IntValFromInt(val int64) IntValue

func IntValFromNeoBytes added in v1.8.0

func IntValFromNeoBytes(val []byte) (IntValue, error)

func (IntValue) Abs added in v1.8.0

func (self IntValue) Abs() (val IntValue)

func (IntValue) Add added in v1.8.0

func (self IntValue) Add(other IntValue) (IntValue, error)

func (IntValue) And added in v1.8.0

func (self IntValue) And(other IntValue) (IntValue, error)

func (IntValue) Cmp added in v1.8.0

func (self IntValue) Cmp(other IntValue) int

func (IntValue) Div added in v1.8.0

func (self IntValue) Div(other IntValue) (IntValue, error)

todo: check negative value with big.Int

func (*IntValue) IsZero added in v1.8.0

func (self *IntValue) IsZero() bool

func (IntValue) Lsh added in v1.8.0

func (self IntValue) Lsh(other IntValue) (result IntValue, err error)

func (IntValue) Max added in v1.8.0

func (self IntValue) Max(other IntValue) (IntValue, error)

func (IntValue) Min added in v1.8.0

func (self IntValue) Min(other IntValue) (IntValue, error)

func (IntValue) Mod added in v1.8.0

func (self IntValue) Mod(other IntValue) (IntValue, error)

todo: check negative value with big.Int

func (IntValue) Mul added in v1.8.0

func (self IntValue) Mul(other IntValue) (IntValue, error)

func (IntValue) Not added in v1.8.0

func (self IntValue) Not() (val IntValue)

func (IntValue) Or added in v1.8.0

func (self IntValue) Or(other IntValue) (IntValue, error)

func (IntValue) Rsh added in v1.8.0

func (self IntValue) Rsh(other IntValue) (result IntValue, err error)

func (*IntValue) Sign added in v1.8.0

func (self *IntValue) Sign() int

func (IntValue) Sub added in v1.8.0

func (self IntValue) Sub(other IntValue) (IntValue, error)

func (*IntValue) ToNeoBytes added in v1.8.0

func (self *IntValue) ToNeoBytes() []byte

func (IntValue) Xor added in v1.8.0

func (self IntValue) Xor(other IntValue) (IntValue, error)

type InteropValue added in v1.8.0

type InteropValue struct {
	Data interfaces.Interop
}

func NewInteropValue added in v1.8.0

func NewInteropValue(value interfaces.Interop) InteropValue

func (*InteropValue) Equals added in v1.8.0

func (this *InteropValue) Equals(other InteropValue) bool

type MapValue added in v1.8.0

type MapValue struct {
	Data map[string][2]VmValue
}

func NewMapValue added in v1.8.0

func NewMapValue() *MapValue

func (*MapValue) Get added in v1.8.0

func (this *MapValue) Get(key VmValue) (value VmValue, ok bool, err error)

func (*MapValue) GetMapSortedKey added in v1.8.0

func (this *MapValue) GetMapSortedKey() []VmValue

func (*MapValue) GetValues added in v1.8.0

func (this *MapValue) GetValues() ([]VmValue, error)

func (*MapValue) Remove added in v1.8.0

func (this *MapValue) Remove(key VmValue) error

func (*MapValue) Reset added in v1.8.0

func (this *MapValue) Reset()

func (*MapValue) Set added in v1.8.0

func (this *MapValue) Set(key, value VmValue) error

type StructValue added in v1.8.0

type StructValue struct {
	Data []VmValue
}

struct value is value type

func NewStructValue added in v1.8.0

func NewStructValue() *StructValue

func (*StructValue) Append added in v1.8.0

func (self *StructValue) Append(item VmValue) error

func (*StructValue) Clone added in v1.8.0

func (self *StructValue) Clone() (*StructValue, error)

func (*StructValue) Len added in v1.8.0

func (self *StructValue) Len() int64

type VmValue added in v1.8.0

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

func NewMapVmValue added in v1.8.0

func NewMapVmValue() VmValue

func VmValueFromArrayVal added in v1.8.0

func VmValueFromArrayVal(array *ArrayValue) VmValue

func VmValueFromBigInt added in v1.8.0

func VmValueFromBigInt(val *big.Int) (result VmValue, err error)

func VmValueFromBool added in v1.8.0

func VmValueFromBool(val bool) VmValue

func VmValueFromBytes added in v1.8.0

func VmValueFromBytes(val []byte) (result VmValue, err error)

func VmValueFromInt64 added in v1.8.0

func VmValueFromInt64(val int64) VmValue

func VmValueFromIntValue added in v1.8.0

func VmValueFromIntValue(val IntValue) VmValue

func VmValueFromInteropValue added in v1.8.0

func VmValueFromInteropValue(val InteropValue) VmValue

func VmValueFromMapValue added in v1.8.0

func VmValueFromMapValue(val *MapValue) VmValue

func VmValueFromStructVal added in v1.8.0

func VmValueFromStructVal(val *StructValue) VmValue

func VmValueFromUint64 added in v1.8.0

func VmValueFromUint64(val uint64) VmValue

func (*VmValue) AsArrayValue added in v1.8.0

func (self *VmValue) AsArrayValue() (*ArrayValue, error)

func (*VmValue) AsBigInt added in v1.8.0

func (self *VmValue) AsBigInt() (*big.Int, error)

urgly hack: only used in cmp opcode to lift the 32byte limit of integer

func (*VmValue) AsBool added in v1.8.0

func (self *VmValue) AsBool() (bool, error)

func (*VmValue) AsBytes added in v1.8.0

func (self *VmValue) AsBytes() ([]byte, error)

func (*VmValue) AsInt64 added in v1.8.0

func (self *VmValue) AsInt64() (int64, error)

func (*VmValue) AsIntValue added in v1.8.0

func (self *VmValue) AsIntValue() (IntValue, error)

func (*VmValue) AsInteropValue added in v1.8.0

func (self *VmValue) AsInteropValue() (InteropValue, error)

func (*VmValue) AsMapValue added in v1.8.0

func (self *VmValue) AsMapValue() (*MapValue, error)

func (*VmValue) AsStructValue added in v1.8.0

func (self *VmValue) AsStructValue() (*StructValue, error)

func (*VmValue) BuildParamToNative added in v1.8.0

func (self *VmValue) BuildParamToNative(sink *common.ZeroCopySink) error

func (*VmValue) CircularRefAndDepthDetection added in v1.8.0

func (self *VmValue) CircularRefAndDepthDetection() (bool, error)

func (*VmValue) ConvertNeoVmValueHexString added in v1.8.0

func (self *VmValue) ConvertNeoVmValueHexString() (interface{}, error)

func (*VmValue) Deserialize added in v1.8.0

func (self *VmValue) Deserialize(source *common.ZeroCopySource) error

func (*VmValue) Dump added in v1.8.0

func (self *VmValue) Dump() string

only for debug/testing

func (*VmValue) Equals added in v1.8.0

func (self *VmValue) Equals(other VmValue) bool

func (*VmValue) GetMapKey added in v1.8.0

func (self *VmValue) GetMapKey() (string, error)

func (*VmValue) GetType added in v1.8.0

func (self *VmValue) GetType() byte

func (*VmValue) Serialize added in v1.8.0

func (self *VmValue) Serialize(sink *common.ZeroCopySink) error

func (*VmValue) Stringify added in v1.8.0

func (self *VmValue) Stringify() (string, error)

only for debug/testing

Jump to

Keyboard shortcuts

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