evm

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 17 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareIncomingRequests added in v0.8.0

func CompareIncomingRequests(req1 IncomingRequest, req2 IncomingRequest) []string

func CompareLogs added in v0.8.0

func CompareLogs(log1 Log, log2 Log) []string

func CompareProvenances added in v0.8.0

func CompareProvenances(prov1 Provenance, prov2 Provenance) []string

func CompareResults added in v0.8.0

func CompareResults(res1 *TxResult, res2 *TxResult) []string

func LogMatchTest

func LogMatchTest(
	t *testing.T,
	checkFunc func(addresses []common.Address, topics [][]common.Hash) bool,
	l Log,
)

Types

type AggregatorInfo added in v0.8.0

type AggregatorInfo struct {
	Aggregator    *big.Int
	CalldataBytes *big.Int
}

func NewAggregatorInfoFromOptionalValue added in v0.8.0

func NewAggregatorInfoFromOptionalValue(val value.Value) (*AggregatorInfo, error)

func (*AggregatorInfo) AsOptionalValue added in v0.8.0

func (a *AggregatorInfo) AsOptionalValue() value.Value

type BlockInfo

type BlockInfo struct {
	BlockNum       *big.Int
	Timestamp      *big.Int
	BlockStats     *OutputStatistics
	ChainStats     *OutputStatistics
	GasSummary     *GasAccountingSummary
	PreviousHeight *big.Int
	L1BlockNum     *big.Int
}

func NewBlockResultFromValue

func NewBlockResultFromValue(val value.Value) (*BlockInfo, error)

func (*BlockInfo) FirstAVMLog

func (b *BlockInfo) FirstAVMLog() *big.Int

func (*BlockInfo) FirstAVMSend

func (b *BlockInfo) FirstAVMSend() *big.Int

func (*BlockInfo) GasLimit

func (b *BlockInfo) GasLimit() *big.Int

func (*BlockInfo) LastAVMLog

func (b *BlockInfo) LastAVMLog() *big.Int

func (*BlockInfo) LastAVMSend

func (b *BlockInfo) LastAVMSend() *big.Int

type FeeSet added in v0.8.0

type FeeSet struct {
	L1Transaction *big.Int
	L1Calldata    *big.Int
	L2Storage     *big.Int
	L2Computation *big.Int
}

func NewFeeSetFromValue added in v0.8.0

func NewFeeSetFromValue(val value.Value) (*FeeSet, error)

type FeeStats added in v0.8.0

type FeeStats struct {
	Price      *FeeSet
	UnitsUsed  *FeeSet
	Paid       *FeeSet
	Aggregator *common.Address
}

func NewFeeStatsFromValue added in v0.8.0

func NewFeeStatsFromValue(val value.Value) (*FeeStats, error)

type GasAccountingSummary added in v0.8.0

type GasAccountingSummary struct {
	PricePerL2Tx             *big.Int
	PricePerL1CalldataByte   *big.Int
	PricePerStorageCell      *big.Int
	PricePerArbGasBase       *big.Int
	PricePerArbGasCongestion *big.Int
	PricePerArbGasTotal      *big.Int
	GasPool                  *big.Int
}

type IncomingRequest

type IncomingRequest struct {
	Kind           inbox.Type
	Sender         common.Address
	MessageID      common.Hash
	Data           []byte
	L1BlockNumber  *big.Int
	L2BlockNumber  *big.Int
	L2Timestamp    *big.Int
	Provenance     Provenance
	AggregatorInfo *AggregatorInfo
	AdminMode      bool
}

func NewIncomingRequestFromValue

func NewIncomingRequestFromValue(val value.Value) (IncomingRequest, error)

func NewRandomIncomingRequest

func NewRandomIncomingRequest() IncomingRequest

func (IncomingRequest) String added in v0.8.0

func (r IncomingRequest) String() string

type L2ToL1TxResult added in v0.8.0

type L2ToL1TxResult struct {
	L2Sender  common.Address
	L1Dest    common.Address
	L2Block   *big.Int
	L1Block   *big.Int
	Timestamp *big.Int
	Value     *big.Int
	Calldata  []byte
}

func NewL2ToL1TxResultFromData added in v0.8.0

func NewL2ToL1TxResultFromData(data []byte) (*L2ToL1TxResult, error)

type Log

type Log struct {
	Address common.Address
	Topics  []common.Hash
	Data    []byte
}

func LogStackToLogs

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

func NewLogFromValue

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

func NewRandomLog

func NewRandomLog(topicCount int32) Log

func (Log) Equals

func (l Log) Equals(o Log) bool

func (Log) MatchesQuery

func (l Log) MatchesQuery(addresses []common.Address, topics [][]common.Hash) bool

func (Log) String

func (l Log) String() string

type MerkleInteriorNode added in v0.8.0

type MerkleInteriorNode struct {
	Left  MerkleNode
	Right MerkleNode
	// contains filtered or unexported fields
}

func NewMerkleInteriorNode added in v0.8.0

func NewMerkleInteriorNode(left, right MerkleNode) *MerkleInteriorNode

func (*MerkleInteriorNode) ContainsIndex added in v0.8.0

func (m *MerkleInteriorNode) ContainsIndex(index uint64) bool

func (*MerkleInteriorNode) Entries added in v0.8.0

func (m *MerkleInteriorNode) Entries() [][]byte

func (*MerkleInteriorNode) Hash added in v0.8.0

func (m *MerkleInteriorNode) Hash() common.Hash

func (*MerkleInteriorNode) Highest added in v0.8.0

func (m *MerkleInteriorNode) Highest() uint64

func (*MerkleInteriorNode) Lowest added in v0.8.0

func (m *MerkleInteriorNode) Lowest() uint64

func (*MerkleInteriorNode) String added in v0.8.0

func (m *MerkleInteriorNode) String() string

type MerkleLeaf added in v0.8.0

type MerkleLeaf struct {
	Data []byte
	// contains filtered or unexported fields
}

func (*MerkleLeaf) ContainsIndex added in v0.8.0

func (m *MerkleLeaf) ContainsIndex(index uint64) bool

func (*MerkleLeaf) Entries added in v0.8.0

func (m *MerkleLeaf) Entries() [][]byte

func (*MerkleLeaf) Hash added in v0.8.0

func (m *MerkleLeaf) Hash() common.Hash

func (*MerkleLeaf) Highest added in v0.8.0

func (m *MerkleLeaf) Highest() uint64

func (*MerkleLeaf) Lowest added in v0.8.0

func (m *MerkleLeaf) Lowest() uint64

func (*MerkleLeaf) String added in v0.8.0

func (m *MerkleLeaf) String() string

type MerkleNode added in v0.8.0

type MerkleNode interface {
	Hash() common.Hash
	Lowest() uint64
	Highest() uint64
	ContainsIndex(index uint64) bool
	Entries() [][]byte
}

type MerkleRootProof added in v0.8.0

type MerkleRootProof struct {
	Nodes []common.Hash
	Path  []bool
	Data  []byte
}

type MerkleRootResult added in v0.8.0

type MerkleRootResult struct {
	BatchNumber *big.Int
	NumInBatch  *big.Int
	Tree        MerkleNode
}

func NewMerkleRootLogResultFromValue added in v0.8.0

func NewMerkleRootLogResultFromValue(tup *value.TupleValue) (*MerkleRootResult, error)

func (*MerkleRootResult) GenerateProof added in v0.8.0

func (m *MerkleRootResult) GenerateProof(index uint64) (*MerkleRootProof, error)

type OutputStatistics

type OutputStatistics struct {
	GasUsed      *big.Int
	TxCount      *big.Int
	EVMLogCount  *big.Int
	AVMLogCount  *big.Int
	AVMSendCount *big.Int
}

type ProcessedTx added in v0.7.3

type ProcessedTx struct {
	Result    *TxResult
	Tx        *types.Transaction
	Kind      inbox.Type
	L2Subtype *message.L2SubType
}

func FilterEthTxResults added in v0.7.3

func FilterEthTxResults(results []*TxResult) []*ProcessedTx

func GetTransaction added in v0.7.3

func GetTransaction(res *TxResult) (*ProcessedTx, error)

type Provenance added in v0.7.3

type Provenance struct {
	L1SeqNum        *big.Int
	ParentRequestId common.Hash
	IndexInParent   *big.Int
}

func NewProvenanceFromValue added in v0.7.3

func NewProvenanceFromValue(val value.Value) (Provenance, error)

type Result

type Result interface {
}

func NewResultFromValue

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

type ResultType

type ResultType int
const (
	ReturnCode               ResultType = 0
	RevertCode               ResultType = 1
	CongestionCode           ResultType = 2
	InsufficientGasFundsCode ResultType = 3
	InsufficientTxFundsCode  ResultType = 4
	BadSequenceCode          ResultType = 5
	InvalidMessageFormatCode ResultType = 6
	ContractAlreadyExists    ResultType = 7
	UnknownErrorCode         ResultType = 255
)

type SendResult added in v0.8.0

type SendResult struct {
	BatchNumber *big.Int
	BatchIndex  *big.Int
	Data        []byte
}

func NewSendResultFromValue added in v0.8.0

func NewSendResultFromValue(tup *value.TupleValue) (*SendResult, error)

type SendResultMessage added in v0.8.0

type SendResultMessage interface {
}

func NewVirtualSendResultFromData added in v0.8.0

func NewVirtualSendResultFromData(data []byte) (SendResultMessage, error)

type SendResultMessageType added in v0.8.0

type SendResultMessageType uint8
const (
	WithdrawEthType SendResultMessageType = 0
	SendTxToL1Type  SendResultMessageType = 3
)

type TxResult

type TxResult struct {
	IncomingRequest IncomingRequest
	ResultCode      ResultType
	ReturnData      []byte
	EVMLogs         []Log
	GasUsed         *big.Int
	GasPrice        *big.Int
	CumulativeGas   *big.Int
	TxIndex         *big.Int
	StartLogIndex   *big.Int
	FeeStats        *FeeStats
}

func NewRandomResult

func NewRandomResult(logCount int32) *TxResult

func NewTxResultFromValue

func NewTxResultFromValue(val value.Value) (*TxResult, error)

func (*TxResult) EthLogs added in v0.7.3

func (r *TxResult) EthLogs(blockHash common.Hash) []*types.Log

func (*TxResult) String

func (r *TxResult) String() string

func (*TxResult) ToEthReceipt

func (r *TxResult) ToEthReceipt(blockHash common.Hash) *types.Receipt

type WithdrawEthResult added in v0.8.0

type WithdrawEthResult struct {
	Destination common.Address
	Amount      *big.Int
}

func NewWithdrawEthResultFromData added in v0.8.0

func NewWithdrawEthResultFromData(data []byte) (*WithdrawEthResult, error)

Jump to

Keyboard shortcuts

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