test

package
v0.0.0-...-ee4fe4c Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT, MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStubOracle

func NewStubOracle(t *testing.T) (*StubBlockOracle, *StubStateOracle)

Types

type KvStateOracle

type KvStateOracle struct {
	T      *testing.T
	Source ethdb.KeyValueStore
}

KvStateOracle loads data from a source ethdb.KeyValueStore

func NewKvStateOracle

func NewKvStateOracle(t *testing.T, db ethdb.KeyValueStore) *KvStateOracle

func (*KvStateOracle) CodeByHash

func (o *KvStateOracle) CodeByHash(hash common.Hash, chainID eth.ChainID) []byte

func (*KvStateOracle) NodeByHash

func (o *KvStateOracle) NodeByHash(nodeHash common.Hash, chainID eth.ChainID) []byte

type Miner

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

func NewMiner

func NewMiner(t *testing.T, logger log.Logger, isthmusTime uint64) (*Miner, *core.BlockChain)

func (*Miner) Fork

func (m *Miner) Fork(t *testing.T, blockNumber uint64, attrs *eth.PayloadAttributes)

func (*Miner) Mine

func (m *Miner) Mine(t *testing.T, attrs *eth.PayloadAttributes)

Mine builds a block on top of the current head and adds it to the chain.

func (*Miner) MineAt

func (m *Miner) MineAt(t *testing.T, head *types.Header, attrs *eth.PayloadAttributes)

type PrecompileResult

type PrecompileResult struct {
	Result []byte
	Ok     bool
}

type StubBlockOracle

type StubBlockOracle struct {
	Blocks           map[common.Hash]*gethTypes.Block
	BlockData        map[common.Hash]*gethTypes.Block
	Receipts         map[common.Hash]gethTypes.Receipts
	Outputs          map[common.Hash]eth.Output
	TransitionStates map[common.Hash]*interopTypes.TransitionState
	// contains filtered or unexported fields
}

func NewStubOracleWithBlocks

func NewStubOracleWithBlocks(t *testing.T, chain []*gethTypes.Block, outputs []eth.Output, db ethdb.Database) *StubBlockOracle

func (StubBlockOracle) BlockByHash

func (o StubBlockOracle) BlockByHash(blockHash common.Hash, chainID eth.ChainID) *gethTypes.Block

func (StubBlockOracle) BlockDataByHash

func (o StubBlockOracle) BlockDataByHash(agreedBlockHash, blockHash common.Hash, chainID eth.ChainID) *gethTypes.Block

func (StubBlockOracle) Hinter

func (StubBlockOracle) OutputByRoot

func (o StubBlockOracle) OutputByRoot(root common.Hash, chainID eth.ChainID) eth.Output

func (StubBlockOracle) ReceiptsByBlockHash

func (o StubBlockOracle) ReceiptsByBlockHash(blockHash common.Hash, chainID eth.ChainID) (*gethTypes.Block, gethTypes.Receipts)

func (StubBlockOracle) TransitionStateByRoot

func (o StubBlockOracle) TransitionStateByRoot(root common.Hash) *interopTypes.TransitionState

type StubPrecompileOracle

type StubPrecompileOracle struct {
	Results map[common.Hash]PrecompileResult
	Calls   int
	// contains filtered or unexported fields
}

func NewStubPrecompileOracle

func NewStubPrecompileOracle(t *testing.T) *StubPrecompileOracle

func (*StubPrecompileOracle) Precompile

func (o *StubPrecompileOracle) Precompile(address common.Address, input []byte, requiredGas uint64) ([]byte, bool)

type StubStateOracle

type StubStateOracle struct {
	Data map[common.Hash][]byte
	Code map[common.Hash][]byte
	// contains filtered or unexported fields
}

StubStateOracle is a StateOracle implementation that reads from simple maps

func NewStubStateOracle

func NewStubStateOracle(t *testing.T) *StubStateOracle

func (*StubStateOracle) CodeByHash

func (o *StubStateOracle) CodeByHash(hash common.Hash, chainID eth.ChainID) []byte

func (*StubStateOracle) NodeByHash

func (o *StubStateOracle) NodeByHash(nodeHash common.Hash, chainID eth.ChainID) []byte

Jump to

Keyboard shortcuts

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