types

package
v0.0.0-...-ef73a9a Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: LGPL-3.0 Imports: 14 Imported by: 0

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

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

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

Types

type ArrayValue

type ArrayValue struct {
	Data []VmValue
}

func NewArrayValue

func NewArrayValue() *ArrayValue

func (*ArrayValue) Append

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

func (*ArrayValue) Len

func (self *ArrayValue) Len() int64

func (*ArrayValue) RemoveAt

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

type IntValue

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

func IntValFromBigInt

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

func IntValFromInt

func IntValFromInt(val int64) IntValue

func IntValFromNeoBytes

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

func (IntValue) Abs

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

func (IntValue) Add

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

func (IntValue) And

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

func (IntValue) Cmp

func (self IntValue) Cmp(other IntValue) int

func (IntValue) Div

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

todo: check negative value with big.Int

func (*IntValue) IsZero

func (self *IntValue) IsZero() bool

func (IntValue) Lsh

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

func (IntValue) Max

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

func (IntValue) Min

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

func (IntValue) Mod

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

todo: check negative value with big.Int

func (IntValue) Mul

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

func (IntValue) Not

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

func (IntValue) Or

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

func (IntValue) Rsh

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

func (*IntValue) Sign

func (self *IntValue) Sign() int

func (IntValue) Sub

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

func (*IntValue) ToNeoBytes

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

func (IntValue) Xor

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

type InteropValue

type InteropValue struct {
	Data interfaces.Interop
}

func NewInteropValue

func NewInteropValue(value interfaces.Interop) InteropValue

func (*InteropValue) Equals

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

type MapValue

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

func NewMapValue

func NewMapValue() *MapValue

func (*MapValue) Get

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

func (*MapValue) GetMapSortedKey

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

func (*MapValue) GetValues

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

func (*MapValue) Remove

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

func (*MapValue) Reset

func (this *MapValue) Reset()

func (*MapValue) Set

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

type StructValue

type StructValue struct {
	Data []VmValue
}

struct value is value type

func NewStructValue

func NewStructValue() *StructValue

func (*StructValue) Append

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

func (*StructValue) Clone

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

func (*StructValue) Len

func (self *StructValue) Len() int64

type VmValue

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

func NewMapVmValue

func NewMapVmValue() VmValue

func VmValueFromArrayVal

func VmValueFromArrayVal(array *ArrayValue) VmValue

func VmValueFromBigInt

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

func VmValueFromBool

func VmValueFromBool(val bool) VmValue

func VmValueFromBytes

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

func VmValueFromInt64

func VmValueFromInt64(val int64) VmValue

func VmValueFromIntValue

func VmValueFromIntValue(val IntValue) VmValue

func VmValueFromInteropValue

func VmValueFromInteropValue(val InteropValue) VmValue

func VmValueFromMapValue

func VmValueFromMapValue(val *MapValue) VmValue

func VmValueFromStructVal

func VmValueFromStructVal(val *StructValue) VmValue

func VmValueFromUint64

func VmValueFromUint64(val uint64) VmValue

func (*VmValue) AsArrayValue

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

func (*VmValue) AsBigInt

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

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

func (*VmValue) AsBool

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

func (*VmValue) AsBytes

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

func (*VmValue) AsInt64

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

func (*VmValue) AsIntValue

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

func (*VmValue) AsInteropValue

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

func (*VmValue) AsMapValue

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

func (*VmValue) AsStructValue

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

func (*VmValue) BuildParamToNative

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

func (*VmValue) CircularRefAndDepthDetection

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

func (*VmValue) ConvertNeoVmValueHexString

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

func (*VmValue) Deserialize

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

func (*VmValue) Dump

func (self *VmValue) Dump() string

only for debug/testing

func (*VmValue) Equals

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

func (*VmValue) GetMapKey

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

func (*VmValue) GetType

func (self *VmValue) GetType() byte

func (*VmValue) Serialize

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

func (*VmValue) Stringify

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