test

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT, MIT Imports: 8 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 {
	Source ethdb.KeyValueStore
	// contains filtered or unexported fields
}

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) []byte

func (*KvStateOracle) NodeByHash

func (o *KvStateOracle) NodeByHash(nodeHash common.Hash) []byte

type PrecompileResult added in v1.7.2

type PrecompileResult struct {
	Result []byte
	Ok     bool
}

type StubBlockOracle

type StubBlockOracle struct {
	Blocks  map[common.Hash]*types.Block
	Outputs map[common.Hash]eth.Output
	// contains filtered or unexported fields
}

func NewStubOracleWithBlocks

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

func (StubBlockOracle) BlockByHash

func (o StubBlockOracle) BlockByHash(blockHash common.Hash) *types.Block

func (StubBlockOracle) OutputByRoot added in v1.1.4

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

type StubPrecompileOracle added in v1.7.2

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

func NewStubPrecompileOracle added in v1.9.1

func NewStubPrecompileOracle(t *testing.T) *StubPrecompileOracle

func (*StubPrecompileOracle) Precompile added in v1.7.2

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) []byte

func (*StubStateOracle) NodeByHash

func (o *StubStateOracle) NodeByHash(nodeHash common.Hash) []byte

Jump to

Keyboard shortcuts

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