Versions in this module Expand all Collapse all v1 v1.4.1 May 23, 2019 Changes in this version + const Add + const Address + const ArrAppend + const ArrAt + const ArrInsert + const ArrLen + const ArrRemove + const Balance + const BitwiseAnd + const BitwiseNot + const BitwiseOr + const BitwiseXor + const Call + const CallData + const CallExt + const CallTrue + const CallVal + const Caller + const CheckSig + const Div + const Dup + const Eq + const ErrHalt + const Exp + const Gt + const GtEq + const Halt + const Issuer + const Jmp + const JmpFalse + const JmpTrue + const LoadFld + const LoadLoc + const LoadSt + const Lt + const LtEq + const MapGetVal + const MapHasKey + const MapRemove + const MapSetVal + const Mod + const Mul + const Neg + const NewArr + const NewStr + const NoOp + const NotEq + const Pop + const Push + const PushBool + const PushChar + const PushInt + const PushStr + const Ret + const Roll + const ShiftL + const ShiftR + const Size + const StoreFld + const StoreLoc + const StoreSt + const Sub + const Swap + func BigIntToByteArray(value big.Int) []byte + func BigIntToUInt(value big.Int) (uint, error) + func BigIntToUInt16(value big.Int) (uint16, error) + func UInt16ToBigInt(value uint16) big.Int type Array + func (a *Array) GetSize() (uint16, error) type Map + func CreateMap() Map + type Struct Array type VM + func (vm *VM) PeekEvalStack() [][]byte v1.0.1 Apr 15, 2019 v1.0.0 Mar 21, 2019 Changes in this version + const ADD + const ADDR + const ADDRESS + const ARRAPPEND + const ARRAT + const ARRINSERT + const ARRREMOVE + const BALANCE + const BYTE + const BYTES + const CALL + const CALLDATA + const CALLER + const CALLEXT + const CALLIF + const CALLVAL + const CHECKSIG + const DIV + const DUP + const EQ + const ERRHALT + const GT + const GTE + const HALT + const ISSUER + const JMP + const JMPIF + const LABEL + const LOAD + const LT + const LTE + const MAPGETVAL + const MAPHASKEY + const MAPPUSH + const MAPREMOVE + const MAPSETVAL + const MOD + const MULT + const NEG + const NEQ + const NEWARR + const NEWMAP + const NOP + const POP + const PUSH + const RET + const ROLL + const SHA3 + const SHIFTL + const SHIFTR + const SIZE + const SLOAD + const SSTORE + const STORE + const SUB + const UINT16_MAX + var OpCodes = []OpCode + func BigIntToPushableBytes(element big.Int) []byte + func BigIntToString(element big.Int) string + func BoolToByteArray(value bool) []byte + func ByteArrayToBool(ba []byte) bool + func ByteArrayToInt(element []byte) int + func ByteArrayToUI16(element []byte) (uint16, error) + func SignedBigIntConversion(ba []byte, err error) (big.Int, error) + func SignedByteArrayConversion(bi big.Int) []byte + func StrToBigInt(element string) big.Int + func UInt16ToByteArray(element uint16) []byte + func UInt64ToByteArray(element uint64) []byte + func UnsignedBigIntConversion(ba []byte, err error) (big.Int, error) + type Array []byte + func ArrayFromByteArray(arr []byte) (Array, error) + func NewArray() Array + func (a *Array) Append(ba []byte) error + func (a *Array) At(index uint16) ([]byte, error) + func (a *Array) DecrementSize() error + func (a *Array) IncrementSize() error + func (a *Array) Insert(index uint16, element []byte) error + func (a *Array) Remove(index uint16) error + type CallStack struct + func NewCallStack() *CallStack + func (cs *CallStack) Peek() (frame *Frame, err error) + func (cs *CallStack) Pop() (frame *Frame, err error) + func (cs *CallStack) Push(element *Frame) + func (cs CallStack) GetLength() int + type Context interface + GetAddress func() [64]byte + GetAmount func() uint64 + GetBalance func() uint64 + GetContract func() []byte + GetContractVariable func(index int) ([]byte, error) + GetFee func() uint64 + GetIssuer func() [32]byte + GetSender func() [32]byte + GetSig1 func() [64]byte + GetTransactionData func() []byte + SetContractVariable func(index int, value []byte) error + type Frame struct + type Map []byte + func MapFromByteArray(m []byte) (Map, error) + func NewMap() Map + func (m *Map) Append(key []byte, value []byte) error + func (m *Map) DecrementSize() error + func (m *Map) GetVal(key []byte) ([]byte, error) + func (m *Map) IncrementSize() + func (m *Map) MapContainsKey(key []byte) (bool, error) + func (m *Map) Remove(key []byte) error + func (m *Map) SetVal(key []byte, value []byte) error + type MockContext struct + func NewMockContext(byteCode []byte) *MockContext + func (mc *MockContext) SetContract(contract []byte) + type OpCode struct + ArgTypes []int + Name string + Nargs int + type Stack struct + Stack []protocol.ByteArray + func NewStack() *Stack + func (s *Stack) PeekBytes() (element []byte, err error) + func (s *Stack) Pop() (element []byte, err error) + func (s *Stack) PopIndexAt(index int) ([]byte, error) + func (s *Stack) Push(element []byte) error + func (s Stack) GetLength() int + type VM struct + func NewTestVM(byteCode []byte) VM + func NewVM(context Context) VM + func (vm *VM) Exec(trace bool) bool + func (vm *VM) GetErrorMsg() string + func (vm *VM) PeekResult() (element []byte, err error) + func (vm *VM) PopBytes(opCode OpCode) (elements []byte, err error) + func (vm *VM) PopSignedBigInt(opCode OpCode) (bigInt big.Int, err error) + func (vm *VM) PopUnsignedBigInt(opCode OpCode) (bigInt big.Int, err error)