testutil

package
v1.13.5 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: MIT, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockELFFile

func MockELFFile(progs []*elf.Prog) *elf.File

MockELFFile create a mock ELF file with custom program segments

func MockProg

func MockProg(progType elf.ProgType, filesz, memsz, vaddr uint64) *elf.Prog

MockProg sets up a elf.Prog structure for testing

Types

type MockFPVMState

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

func MockCreateInitState

func MockCreateInitState(pc, heapStart arch.Word) *MockFPVMState

MockCreateInitState returns a mock FPVMState for testing

func (MockFPVMState) CreateVM

func (MockFPVMState) EncodeWitness

func (m MockFPVMState) EncodeWitness() (witness []byte, hash common.Hash)

func (MockFPVMState) GetCpu

func (m MockFPVMState) GetCpu() mipsevm.CpuScalars

func (MockFPVMState) GetExitCode

func (m MockFPVMState) GetExitCode() uint8

func (MockFPVMState) GetExited

func (m MockFPVMState) GetExited() bool

func (MockFPVMState) GetHeap

func (m MockFPVMState) GetHeap() arch.Word

func (MockFPVMState) GetLastHint

func (m MockFPVMState) GetLastHint() hexutil.Bytes

func (MockFPVMState) GetMemory

func (m MockFPVMState) GetMemory() *memory.Memory

func (MockFPVMState) GetPC

func (m MockFPVMState) GetPC() arch.Word

func (MockFPVMState) GetPreimageKey

func (m MockFPVMState) GetPreimageKey() common.Hash

func (MockFPVMState) GetPreimageOffset

func (m MockFPVMState) GetPreimageOffset() arch.Word

func (MockFPVMState) GetRegistersRef

func (m MockFPVMState) GetRegistersRef() *[32]arch.Word

func (MockFPVMState) GetStep

func (m MockFPVMState) GetStep() uint64

func (MockFPVMState) Serialize

func (m MockFPVMState) Serialize(out io.Writer) error

type TrackableReaderAt

type TrackableReaderAt struct {
	BytesRead int
	// contains filtered or unexported fields
}

TrackableReaderAt tracks the number of bytes read

func MockProgWithReader

func MockProgWithReader(progType elf.ProgType, filesz, memsz, vaddr uint64, data []byte) (*elf.Prog, *TrackableReaderAt)

MockProgWithReader creates an elf.Prog with a TrackableReaderAt to track reads

func (*TrackableReaderAt) ReadAt

func (r *TrackableReaderAt) ReadAt(p []byte, offset int64) (int, error)

Jump to

Keyboard shortcuts

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