object

package
v0.0.0-...-9e713b4 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INSTANCE_OBJ     = "INSTANCE"
	CONTRACT_OBJ     = "CONTRACT"
	ACCOUNT_OBJ      = "ACCOUNT"
	MULTIPLE_OBJ     = "MULTIPLE"
	INTEGER_OBJ      = "INTEGER"
	BOOLEAN_OBJ      = "BOOLEAN"
	BYTES_OBJ        = "BYTES_OBJ"
	ADDRESS_OBJ      = "ADDRESS_OBJ"
	NULL_OBJ         = "NULL"
	RETURN_VALUE_OBJ = "RETURN_VALUE"
	ERROR_OBJ        = "ERROR"
	FUNCTION_OBJ     = "FUNCTION"
	EVENT_OBJ        = "EVENT"
	STRING_OBJ       = "STRING"
	BUILTIN_OBJ      = "BUILTIN"
	ARRAY_OBJ        = "ARRAY"
	HASH_OBJ         = "HASH"
)
View Source
const ADDRESS_SIZE = 20

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Addr web3.Address
}

func NewAccount

func NewAccount(obj Object) (*Account, error)

func (*Account) Inspect

func (a *Account) Inspect() string

func (*Account) Type

func (a *Account) Type() ObjectType

type Address

type Address struct {
	Value string
}

func (*Address) Inspect

func (a *Address) Inspect() string

func (*Address) ToAddress

func (a *Address) ToAddress() web3.Address

func (*Address) Type

func (a *Address) Type() ObjectType

type Array

type Array struct {
	Elements []Object
}

func (*Array) Inspect

func (ao *Array) Inspect() string

func (*Array) Type

func (ao *Array) Type() ObjectType

type Boolean

type Boolean struct {
	Value bool
}

func (*Boolean) HashKey

func (b *Boolean) HashKey() HashKey

func (*Boolean) Inspect

func (b *Boolean) Inspect() string

func (*Boolean) Type

func (b *Boolean) Type() ObjectType

type Builtin

type Builtin struct {
	Fn BuiltinFunction
}

func (*Builtin) Inspect

func (b *Builtin) Inspect() string

func (*Builtin) Type

func (b *Builtin) Type() ObjectType

type BuiltinFunction

type BuiltinFunction func(args ...Object) Object

type Bytes

type Bytes struct {
	Value string
}

func (*Bytes) Inspect

func (b *Bytes) Inspect() string

func (*Bytes) ToAddress

func (b *Bytes) ToAddress() (*Address, error)

func (*Bytes) Type

func (b *Bytes) Type() ObjectType

type Contract

type Contract struct {
	Name string
	ABI  *abi.ABI
}

func (*Contract) Inspect

func (c *Contract) Inspect() string

func (*Contract) Type

func (c *Contract) Type() ObjectType

type Environment

type Environment struct {
	Builtins map[string]*Builtin
	// contains filtered or unexported fields
}

func NewEnclosedEnvironment

func NewEnclosedEnvironment(outer *Environment) *Environment

func NewEnvironment

func NewEnvironment() *Environment

func (*Environment) AddBuiltin

func (e *Environment) AddBuiltin(name string, b *Builtin)

func (*Environment) AddBuiltins

func (e *Environment) AddBuiltins(builtins map[string]*Builtin)

func (*Environment) BuildArgs

func (e *Environment) BuildArgs(envs []string)

func (*Environment) BuildEnvs

func (e *Environment) BuildEnvs(envs []string)

func (*Environment) Get

func (e *Environment) Get(name string) (Object, bool)

func (*Environment) GetContract

func (e *Environment) GetContract(name string) *Contract

func (*Environment) GetContracts

func (e *Environment) GetContracts() map[string]*Contract

func (*Environment) GetOnStatements

func (e *Environment) GetOnStatements() []*Event

func (*Environment) GetRPCEndpoint

func (e *Environment) GetRPCEndpoint() (string, error)

func (*Environment) Set

func (e *Environment) Set(name string, val Object) Object

type Error

type Error struct {
	Message string
}

func (*Error) Inspect

func (e *Error) Inspect() string

func (*Error) Type

func (e *Error) Type() ObjectType

type Event

type Event struct {
	Contract   string
	Method     string
	Address    *web3.Address
	ABI        *abi.ABI
	Parameters []*ast.OnIdentifier
	Body       *ast.BlockStatement
	Env        *Environment
}

func (*Event) Inspect

func (e *Event) Inspect() string

func (*Event) Type

func (e *Event) Type() ObjectType

type Function

type Function struct {
	Parameters []*ast.Identifier
	Body       *ast.BlockStatement
	Env        *Environment
}

func (*Function) Inspect

func (f *Function) Inspect() string

func (*Function) Type

func (f *Function) Type() ObjectType

type Hash

type Hash struct {
	Pairs map[HashKey]HashPair
}

func (*Hash) GetString

func (h *Hash) GetString(str string) (Object, bool)

func (*Hash) Inspect

func (h *Hash) Inspect() string

func (*Hash) SetString

func (h *Hash) SetString(str string, obj Object)

func (*Hash) Type

func (h *Hash) Type() ObjectType

type HashKey

type HashKey struct {
	Type  ObjectType
	Value uint64
}

type HashPair

type HashPair struct {
	Key   Object
	Value Object
}

type Hashable

type Hashable interface {
	HashKey() HashKey
}

type Instance

type Instance struct {
	Name    string
	Address web3.Address
	ABI     *abi.ABI
}

func (*Instance) Inspect

func (i *Instance) Inspect() string

func (*Instance) Type

func (i *Instance) Type() ObjectType

type Integer

type Integer struct {
	Value *big.Int
}

func (*Integer) HashKey

func (i *Integer) HashKey() HashKey

func (*Integer) Inspect

func (i *Integer) Inspect() string

func (*Integer) Type

func (i *Integer) Type() ObjectType

type Multiple

type Multiple struct {
	Values []Object
}

func (*Multiple) Inspect

func (m *Multiple) Inspect() string

func (*Multiple) Type

func (m *Multiple) Type() ObjectType

type Null

type Null struct{}

func (*Null) Inspect

func (n *Null) Inspect() string

func (*Null) Type

func (n *Null) Type() ObjectType

type Object

type Object interface {
	Type() ObjectType
	Inspect() string
}

type ObjectType

type ObjectType string

type ReturnValue

type ReturnValue struct {
	Value Object
}

func (*ReturnValue) Inspect

func (rv *ReturnValue) Inspect() string

func (*ReturnValue) Type

func (rv *ReturnValue) Type() ObjectType

type String

type String struct {
	Value string
}

func (*String) HashKey

func (s *String) HashKey() HashKey

func (*String) Inspect

func (s *String) Inspect() string

func (*String) Type

func (s *String) Type() ObjectType

Jump to

Keyboard shortcuts

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