types

package
v0.15.11 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 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

Variables

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

	// 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
)

Functions

Functions

func FullAccountRLP

func FullAccountRLP(data []byte) ([]byte, error)

FullAccountRLP converts data on the 'slim RLP' format into the full RLP-format.

func SlimAccountRLP

func SlimAccountRLP(account StateAccount) []byte

SlimAccountRLP encodes the state account in 'slim RLP' format.

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

type BlockNonce

type BlockNonce = ethtypes.BlockNonce

Core types - direct aliases to ethereum types

type Bloom

type Bloom = ethtypes.Bloom

Core types - direct aliases to ethereum types

type Body

type Body = ethtypes.Body

Core types - direct aliases to ethereum types

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 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

type LegacyTx

type LegacyTx = ethtypes.LegacyTx

Transaction implementations

type Log

type Log = ethtypes.Log

Core types - direct aliases to ethereum types

type Receipt

type Receipt = ethtypes.Receipt

Receipt types

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 struct {
	Nonce       uint64
	Balance     *uint256.Int
	Root        []byte // Nil if root equals to types.EmptyRootHash
	CodeHash    []byte // Nil if hash equals to types.EmptyCodeHash
	IsMultiCoin bool
}

SlimAccount is a modified version of an Account, where the root is replaced with a byte slice. This format can be used to represent full-consensus format or slim format which replaces the empty root and code hash as nil byte slice.

type StateAccount

type StateAccount struct {
	Nonce       uint64
	Balance     *uint256.Int
	Root        common.Hash // merkle root of the storage trie
	CodeHash    []byte
	IsMultiCoin bool
}

StateAccount is the Ethereum consensus representation of accounts. These objects are stored in the main account trie.

func FullAccount

func FullAccount(data []byte) (*StateAccount, error)

FullAccount decodes the data on the 'slim RLP' format and returns the consensus format account.

func NewEmptyStateAccount

func NewEmptyStateAccount() *StateAccount

NewEmptyStateAccount constructs an empty state account.

func (*StateAccount) Copy

func (acct *StateAccount) Copy() *StateAccount

Copy returns a deep-copied state account object.

type Transaction

type Transaction = ethtypes.Transaction

Transaction types

type Transactions

type Transactions = ethtypes.Transactions

Core types - direct aliases to ethereum types

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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