Versions in this module Expand all Collapse all v1 v1.0.1 Nov 24, 2021 Changes in this version + var BadHashes = map[common.Hash]bool + var DefaultTxPoolConfig = TxPoolConfig + var ErrAlreadyKnown = errors.New("already known") + var ErrGasLimit = errors.New("exceeds block gas limit") + var ErrGasLimitReached = errors.New("gas limit reached") + var ErrGasUintOverflow = errors.New("gas uint64 overflow") + var ErrInsufficientFunds = errors.New("insufficient funds for gas * price + value") + var ErrInsufficientFundsForTransfer = errors.New("insufficient funds for transfer") + var ErrIntrinsicGas = errors.New("intrinsic gas too low") + var ErrInvalidSender = errors.New("invalid sender") + var ErrNegativeValue = errors.New("negative value") + var ErrNoGenesis = errors.New("genesis not found in chain") + var ErrNonceTooHigh = errors.New("nonce too high") + var ErrNonceTooLow = errors.New("nonce too low") + var ErrOversizedData = errors.New("oversized data") + var ErrReplaceUnderpriced = errors.New("replacement transaction underpriced") + var ErrTxPoolOverflow = errors.New("txpool is full") + var ErrTxTypeNotSupported = types.ErrTxTypeNotSupported + var ErrUnderpriced = errors.New("transaction underpriced") + func CanTransfer(db vm.StateDB, addr common.Address, amount *big.Int) bool + func GenerateChain(config *params.ChainConfig, parent *EvmBlock, db ethdb.Database, n int, ...) ([]*EvmBlock, []types.Receipts, DummyChain) + func GetHashFn(ref *EvmHeader, chain DummyChain) func(n uint64) common.Hash + func IntrinsicGas(data []byte, accessList types.AccessList, isContractCreation bool) (uint64, error) + func NewEVMBlockContext(header *EvmHeader, chain DummyChain, author *common.Address) vm.BlockContext + func NewEVMTxContext(msg Message) vm.TxContext + func Transfer(db vm.StateDB, sender, recipient common.Address, amount *big.Int) + type BlockGen struct + func (b *BlockGen) AddTx(tx *types.Transaction) + func (b *BlockGen) AddTxWithChain(bc DummyChain, tx *types.Transaction) + func (b *BlockGen) AddUncheckedReceipt(receipt *types.Receipt) + func (b *BlockGen) AddUncheckedTx(tx *types.Transaction) + func (b *BlockGen) GetBalance(addr common.Address) *big.Int + func (b *BlockGen) Number() *big.Int + func (b *BlockGen) OffsetTime(seconds int64) + func (b *BlockGen) PrevBlock(index int) *EvmBlock + func (b *BlockGen) SetCoinbase(addr common.Address) + func (b *BlockGen) TxNonce(addr common.Address) uint64 + type ChainHeadNotify struct + Block *EvmBlock + type ChainNotify struct + Block *EvmBlock + Hash common.Hash + Logs []*types.Log + type ChainSideNotify struct + Block *EvmBlock + type DummyChain interface + GetHeader func(common.Hash, uint64) *EvmHeader + type EvmBlock struct + Transactions types.Transactions + func ApplyGenesis(statedb *state.StateDB, g mugambo.Genesis, maxMemoryUsage int) (*EvmBlock, error) + func MustApplyGenesis(g mugambo.Genesis, statedb *state.StateDB, maxMemoryUsage int) *EvmBlock + func NewEvmBlock(h *EvmHeader, txs types.Transactions) *EvmBlock + func (b *EvmBlock) EstimateSize() int + func (b *EvmBlock) EthBlock() *types.Block + func (b *EvmBlock) Header() *EvmHeader + func (b *EvmBlock) NumberU64() uint64 + type EvmHeader struct + Coinbase common.Address + GasLimit uint64 + GasUsed uint64 + Hash common.Hash + Number *big.Int + ParentHash common.Hash + Root common.Hash + Time inter.Timestamp + TxHash common.Hash + func ConvertFromEthHeader(h *types.Header) *EvmHeader + func ToEvmHeader(block *inter.Block, index idx.Block, prevHash hash.Event) *EvmHeader + func (h *EvmHeader) EthHeader() *types.Header + type ExecutionResult struct + Err error + ReturnData []byte + UsedGas uint64 + func ApplyMessage(evm *vm.EVM, msg Message, gp *GasPool) (*ExecutionResult, error) + func (result *ExecutionResult) Failed() bool + func (result *ExecutionResult) Return() []byte + func (result *ExecutionResult) Revert() []byte + func (result *ExecutionResult) Unwrap() error + type GasPool uint64 + func (gp *GasPool) AddGas(amount uint64) *GasPool + func (gp *GasPool) Gas() uint64 + func (gp *GasPool) String() string + func (gp *GasPool) SubGas(amount uint64) error + type Message interface + AccessList func() types.AccessList + CheckNonce func() bool + Data func() []byte + From func() common.Address + Gas func() uint64 + GasPrice func() *big.Int + Nonce func() uint64 + To func() *common.Address + Value func() *big.Int + type NewMinedBlockNotify struct + Block *EvmBlock + type NewTxsNotify struct + Txs []*types.Transaction + type PendingLogsNotify struct + Logs []*types.Log + type Prefetcher interface + Prefetch func(block *EvmBlock, statedb *state.StateDB, cfg vm.Config, interrupt *uint32) + type Processor interface + Process func(block *EvmBlock, statedb *state.StateDB, cfg vm.Config) (types.Receipts, []*types.Log, uint64, error) + type RemovedLogsNotify struct + Logs []*types.Log + type StateProcessor struct + func NewStateProcessor(config *params.ChainConfig, bc DummyChain) *StateProcessor + func (p *StateProcessor) Process(block *EvmBlock, statedb *state.StateDB, cfg vm.Config, usedGas *uint64, ...) (receipts types.Receipts, allLogs []*types.Log, skipped []uint32, err error) + type StateTransition struct + func NewStateTransition(evm *vm.EVM, msg Message, gp *GasPool) *StateTransition + func (st *StateTransition) TransitionDb() (*ExecutionResult, error) + type TestChain struct + func (tc *TestChain) GetHeader(hash common.Hash, number uint64) *EvmHeader + type TxPool struct + func NewTxPool(config TxPoolConfig, chainconfig *params.ChainConfig, chain stateReader) *TxPool + func (pool *TxPool) AddLocal(tx *types.Transaction) error + func (pool *TxPool) AddLocals(txs []*types.Transaction) []error + func (pool *TxPool) AddRemote(tx *types.Transaction) error + func (pool *TxPool) AddRemotes(txs []*types.Transaction) []error + func (pool *TxPool) AddRemotesSync(txs []*types.Transaction) []error + func (pool *TxPool) Content() (map[common.Address]types.Transactions, map[common.Address]types.Transactions) + func (pool *TxPool) Count() int + func (pool *TxPool) GasPrice() *big.Int + func (pool *TxPool) Get(hash common.Hash) *types.Transaction + func (pool *TxPool) Has(hash common.Hash) bool + func (pool *TxPool) Locals() []common.Address + func (pool *TxPool) Nonce(addr common.Address) uint64 + func (pool *TxPool) OnlyNotExisting(hashes []common.Hash) []common.Hash + func (pool *TxPool) Pending() (map[common.Address]types.Transactions, error) + func (pool *TxPool) SampleHashes(max int) []common.Hash + func (pool *TxPool) SetGasPrice(price *big.Int) + func (pool *TxPool) SetGasPriceWithCap(price, cap *big.Int) + func (pool *TxPool) Stats() (int, int) + func (pool *TxPool) Status(hashes []common.Hash) []TxStatus + func (pool *TxPool) Stop() + func (pool *TxPool) SubscribeNewTxsNotify(ch chan<- NewTxsNotify) notify.Subscription + type TxPoolConfig struct + AccountQueue uint64 + AccountSlots uint64 + GlobalQueue uint64 + GlobalSlots uint64 + Journal string + Lifetime time.Duration + Locals []common.Address + NoLocals bool + PriceBump uint64 + PriceLimit uint64 + Rejournal time.Duration + type TxStatus uint + const TxStatusIncluded + const TxStatusPending + const TxStatusQueued + const TxStatusUnknown + type Validator interface + ValidateBody func(block *EvmBlock) error + ValidateState func(block *EvmBlock, state *state.StateDB, receipts types.Receipts, usedGas uint64) error