types

package
v0.15.45 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: GPL-3.0, LGPL-3.0 Imports: 11 Imported by: 134

Documentation

Overview

Package types provides type aliases to ethereum types This ensures compatibility with ethereum interfaces while allowing our own extensions

Index

Constants

View Source
const (
	// Transaction types
	LegacyTxType     = ethtypes.LegacyTxType
	AccessListTxType = ethtypes.AccessListTxType
	DynamicFeeTxType = ethtypes.DynamicFeeTxType
	BlobTxType       = ethtypes.BlobTxType

	// Receipt status
	ReceiptStatusFailed     = ethtypes.ReceiptStatusFailed
	ReceiptStatusSuccessful = ethtypes.ReceiptStatusSuccessful
)

Constants

View Source
const (
	BloomBitLength  = ethtypes.BloomBitLength
	BloomByteLength = ethtypes.BloomByteLength
)

Constants for bloom filters

Variables

View Source
var (
	// Hashes
	EmptyRootHash        = ethtypes.EmptyRootHash
	EmptyCodeHash        = ethtypes.EmptyCodeHash
	EmptyTxsHash         = ethtypes.EmptyTxsHash
	EmptyReceiptsHash    = ethtypes.EmptyReceiptsHash
	EmptyWithdrawalsHash = ethtypes.EmptyWithdrawalsHash
	EmptyVerkleHash      = ethtypes.EmptyVerkleHash
	EmptyUncleHash       = ethtypes.EmptyUncleHash

	// Errors
	ErrInvalidSig           = ethtypes.ErrInvalidSig
	ErrUnexpectedProtection = ethtypes.ErrUnexpectedProtection
	ErrInvalidTxType        = ethtypes.ErrInvalidTxType
	ErrTxTypeNotSupported   = ethtypes.ErrTxTypeNotSupported
	ErrGasFeeCapTooLow      = ethtypes.ErrGasFeeCapTooLow
	ErrInvalidChainId       = ethtypes.ErrInvalidChainId
)

Variables

View Source
var (
	// Transaction creation
	NewTx               = ethtypes.NewTx
	NewTransaction      = ethtypes.NewTransaction
	NewContractCreation = ethtypes.NewContractCreation

	// Signing
	SignTx                 = ethtypes.SignTx
	SignNewTx              = ethtypes.SignNewTx
	MustSignNewTx          = ethtypes.MustSignNewTx
	Sender                 = ethtypes.Sender
	LatestSigner           = ethtypes.LatestSigner
	LatestSignerForChainID = ethtypes.LatestSignerForChainID
	NewEIP155Signer        = ethtypes.NewEIP155Signer
	NewLondonSigner        = ethtypes.NewLondonSigner
	NewCancunSigner        = ethtypes.NewCancunSigner
	MakeSigner             = ethtypes.MakeSigner

	// Block functions
	CalcUncleHash      = ethtypes.CalcUncleHash
	DeriveSha          = ethtypes.DeriveSha
	NewBlockWithHeader = ethtypes.NewBlockWithHeader
	NewBlock           = ethtypes.NewBlock
	EncodeNonce        = ethtypes.EncodeNonce
)

Functions

View Source
var (
	// NewEmptyStateAccount is defined in lux_types.go to return our extended type
	FullAccountRLP = ethtypes.FullAccountRLP
)

Functions for accounts

Functions

func BlockGasCost added in v0.15.40

func BlockGasCost(b *Block) *big.Int

BlockGasCost retrieves the gas cost of a block

func BlockTimestamp added in v0.15.40

func BlockTimestamp(b *Block) uint64

BlockTimestamp returns the timestamp of a block

func BloomLookup

func BloomLookup(bin Bloom, topic interface{}) bool

BloomLookup checks if a bloom filter contains a particular pattern

func CalcExtDataHash added in v0.15.4

func CalcExtDataHash(extData []byte) common.Hash

CalcExtDataHash calculates the hash of extended data

func ExtData added in v0.15.40

func ExtData(b *Block) []byte

ExtData returns the extra data field of a block (for compatibility)

func OrBloom added in v0.15.40

func OrBloom(a, b ethtypes.Bloom) ethtypes.Bloom

OrBloom combines two bloom filters

func SlimAccountRLP

func SlimAccountRLP(acc StateAccount) []byte

SlimAccountRLP converts an account to its RLP representation for snapshot storage

Types

type AccessList

type AccessList = ethtypes.AccessList

Other types

type AccessListTx

type AccessListTx = ethtypes.AccessListTx

Core types - direct aliases to ethereum types

type AccessTuple

type AccessTuple = ethtypes.AccessTuple

Core types - direct aliases to ethereum types

type Account

type Account struct {
	Code    []byte                      `json:"code,omitempty"`
	Storage map[common.Hash]common.Hash `json:"storage,omitempty"`
	Balance *big.Int                    `json:"balance" gencodec:"required"`
	Nonce   uint64                      `json:"nonce,omitempty"`

	// used in tests
	PrivateKey []byte `json:"secretKey,omitempty"`
}

Account represents an Ethereum account and its attached data. This type is used to specify accounts in the genesis block state, and is also useful for JSON encoding/decoding of accounts.

type BlobTx

type BlobTx = ethtypes.BlobTx

Core types - direct aliases to ethereum types

type BlobTxSidecar

type BlobTxSidecar = ethtypes.BlobTxSidecar

Core types - direct aliases to ethereum types

type Block

type Block = ethtypes.Block

Block types

func BlockWithExtData added in v0.15.20

func BlockWithExtData(b *Block, version uint32, extData []byte) *Block

BlockWithExtData adds extended data to a block This is a helper function since we can't add methods to the aliased Block type

func NewBlockWithExtData added in v0.15.4

func NewBlockWithExtData(header *Header, txs []*Transaction, uncles []*Header,
	receipts []*Receipt, version uint32, extData []byte, commit bool) *Block

NewBlockWithExtData creates a new block with extended data This is a Lux-specific function that maintains compatibility

type BlockConfigContext added in v0.15.40

type BlockConfigContext struct {
	*Block
}

BlockConfigContext wraps a block to implement ConfigurationBlockContext

func NewBlockConfigContext added in v0.15.40

func NewBlockConfigContext(block *Block) BlockConfigContext

NewBlockConfigContext creates a new BlockConfigContext

func (BlockConfigContext) Timestamp added in v0.15.40

func (b BlockConfigContext) Timestamp() uint64

Timestamp implements ConfigurationBlockContext

type BlockNonce

type BlockNonce = ethtypes.BlockNonce

Body is defined in lux_types.go

type Blocks

type Blocks = []*Block

Core types - direct aliases to ethereum types

type Bloom

type Bloom = ethtypes.Bloom

Core types - direct aliases to ethereum types

func CreateBloom

func CreateBloom(receipts Receipts) Bloom

CreateBloom creates a bloom filter from receipts

func MergeBloom

func MergeBloom(receipts Receipts) Bloom

MergeBloom merges multiple blooms into one

type Body

type Body struct {
	Transactions []*Transaction
	Uncles       []*Header
	Version      uint32
	ExtData      []byte
}

Body represents a block body with Lux extensions

type DerivableList

type DerivableList = ethtypes.DerivableList

Interfaces

type DynamicFeeTx

type DynamicFeeTx = ethtypes.DynamicFeeTx

Core types - direct aliases to ethereum types

type EIP155Signer

type EIP155Signer = ethtypes.EIP155Signer

Core types - direct aliases to ethereum types

type ExtendedSlimAccount added in v0.15.29

type ExtendedSlimAccount struct {
	Nonce       uint64
	Balance     *uint256.Int
	Root        []byte
	CodeHash    []byte
	IsMultiCoin bool
}

ExtendedSlimAccount is a Lux-specific extension of SlimAccount

type ExtendedStateAccount added in v0.15.29

type ExtendedStateAccount struct {
	Nonce       uint64
	Balance     *uint256.Int
	Root        common.Hash
	CodeHash    []byte
	IsMultiCoin bool
}

ExtendedStateAccount is a Lux-specific extension of StateAccount

func (ExtendedStateAccount) Copy added in v0.15.40

Copy creates a deep copy of StateAccount.

type FrontierSigner

type FrontierSigner = ethtypes.FrontierSigner

Additional aliases for missing types

type FullAccount

type FullAccount = StateAccount

FullAccount is StateAccount in newer versions

type GenesisAccount added in v0.15.4

type GenesisAccount struct {
	Code       []byte                      `json:"code,omitempty"`
	Storage    map[common.Hash]common.Hash `json:"storage,omitempty"`
	Balance    *big.Int                    `json:"balance" gencodec:"required"`
	MCBalance  GenesisMultiCoinBalance     `json:"mcbalance,omitempty"`
	Nonce      uint64                      `json:"nonce,omitempty"`
	PrivateKey []byte                      `json:"secretKey,omitempty"` // for tests
}

GenesisAccount is an account in the state of the genesis block.

type GenesisAlloc

type GenesisAlloc map[common.Address]GenesisAccount

GenesisAlloc specifies the initial state of a genesis block.

func (*GenesisAlloc) UnmarshalJSON

func (ga *GenesisAlloc) UnmarshalJSON(data []byte) error

type GenesisMultiCoinBalance added in v0.15.4

type GenesisMultiCoinBalance map[common.Hash]*big.Int
type Header = ethtypes.Header

Core types - direct aliases to ethereum types

func CopyHeader

func CopyHeader(h *Header) *Header

CopyHeader creates a deep copy of a block header

type HomesteadSigner

type HomesteadSigner = ethtypes.HomesteadSigner

Additional aliases for missing types

type LegacyTx

type LegacyTx = ethtypes.LegacyTx

Transaction implementations

type Log

type Log = ethtypes.Log

Core types - direct aliases to ethereum types

func FlattenLogs added in v0.15.4

func FlattenLogs(logs [][]*Log) []*Log

FlattenLogs flattens a slice of logs

type Receipt

type Receipt = ethtypes.Receipt

Receipt types

type ReceiptForStorage

type ReceiptForStorage = ethtypes.ReceiptForStorage

StateAccount is defined in lux_types.go as ExtendedStateAccount

type Receipts

type Receipts = ethtypes.Receipts

Core types - direct aliases to ethereum types

type Signer

type Signer = ethtypes.Signer

Signer types

type SlimAccount

type SlimAccount = ExtendedSlimAccount

SlimAccount is our extended slim account type

type StateAccount

type StateAccount = ExtendedStateAccount

StateAccount is our extended state account type

func NewEmptyStateAccount

func NewEmptyStateAccount() *StateAccount

NewEmptyStateAccount creates an empty state account

type Transaction

type Transaction = ethtypes.Transaction

Transaction types

type Transactions

type Transactions = ethtypes.Transactions

Core types - direct aliases to ethereum types

func TxDifference

func TxDifference(a, b Transactions) Transactions

TxDifference returns the difference between two transaction slices

type TrieHasher

type TrieHasher = ethtypes.TrieHasher

TrieHasher is the interface for trie hashing

type TrieRootHash added in v0.15.4

type TrieRootHash = common.Hash

TrieRootHash is the hash of a trie root

type TxByNonce

type TxByNonce = ethtypes.TxByNonce

Core types - direct aliases to ethereum types

type TxData

type TxData = ethtypes.TxData

Core types - direct aliases to ethereum types

type Withdrawal

type Withdrawal = ethtypes.Withdrawal

Core types - direct aliases to ethereum types

type Withdrawals

type Withdrawals = ethtypes.Withdrawals

Core types - direct aliases to ethereum types

Jump to

Keyboard shortcuts

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