evm

package
v0.0.0-...-07fd086 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EVM_REVERT_CODE       = 0
	EVM_INVALID_CODE      = 1
	EVM_RETURN_CODE       = 2
	EVM_STOP_CODE         = 3
	EVM_BAD_SEQUENCE_CODE = 4
)

Variables

This section is empty.

Functions

func BytesToByteArray

func BytesToByteArray(val []byte) (value.Value, error)

func BytesToSizedByteArray

func BytesToSizedByteArray(val []byte) (value.Value, error)

func IntsToBigTuple

func IntsToBigTuple(ints []*big.Int) (value.Value, error)

func SizedByteArrayToHex

func SizedByteArrayToHex(val value.Value) ([]byte, error)

func StackValueToList

func StackValueToList(val value.Value) ([]value.Value, error)

Types

type EthCallData

type EthCallData struct {
	Data        []byte
	ContractId  *big.Int
	SequenceNum *big.Int
}

func NewEthCallDataFromValue

func NewEthCallDataFromValue(val value.Value) (EthCallData, error)

func (EthCallData) Equals

func (data EthCallData) Equals(data2 EthCallData) bool

type EthMsg

type EthMsg struct {
	Data      EthMsgData
	TokenType [21]byte
	Currency  *big.Int
	Caller    [32]byte
}

func NewEthMsgFromValue

func NewEthMsgFromValue(val value.Value) (EthMsg, error)

func (EthMsg) Equals

func (msg EthMsg) Equals(msg2 EthMsg) bool

func (EthMsg) MsgHash

func (msg EthMsg) MsgHash(vmId [32]byte) [32]byte

type EthMsgData

type EthMsgData struct {
	CallData  EthCallData
	Timestamp *big.Int
	Number    *big.Int
	TxHash    [32]byte
	// contains filtered or unexported fields
}

func NewEthMsgDataFromValue

func NewEthMsgDataFromValue(val value.Value) (EthMsgData, error)

func (EthMsgData) Equals

func (data EthMsgData) Equals(data2 EthMsgData) bool

type FuncCall

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

type Log

type Log struct {
	ContractId value.IntValue
	Data       []byte
	Topics     [][32]byte
}

func LogStackToLogs

func LogStackToLogs(val value.Value) ([]Log, error)

func LogValToLog

func LogValToLog(val value.Value) (Log, error)

func (Log) String

func (l Log) String() string

type Result

type Result interface {
	IsResult()

	GetEthMsg() EthMsg
}

func ProcessLog

func ProcessLog(val value.Value) (Result, error)

[logs, contract_num, func_code, return_val, return_code]

type Return

type Return struct {
	Msg       EthMsg
	ReturnVal []byte
	Logs      []Log
}

func (Return) GetEthMsg

func (e Return) GetEthMsg() EthMsg

func (Return) IsResult

func (e Return) IsResult()

func (Return) String

func (e Return) String() string

type Revert

type Revert struct {
	Msg       EthMsg
	ReturnVal []byte
}

func (Revert) GetEthMsg

func (e Revert) GetEthMsg() EthMsg

func (Revert) IsResult

func (e Revert) IsResult()

func (Revert) String

func (e Revert) String() string

type Stop

type Stop struct {
	Msg  EthMsg
	Logs []Log
}

func (Stop) GetEthMsg

func (e Stop) GetEthMsg() EthMsg

func (Stop) IsResult

func (e Stop) IsResult()

func (Stop) String

func (e Stop) String() string

Jump to

Keyboard shortcuts

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