simulator

package
v0.0.0-...-a20f792 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitIdealState

func InitIdealState(originState *state.StateDB, record *runtime.RecordToInitiateState) (*state.StateDB, error)

Types

type Simulation

type Simulation struct {
	From        common.Address
	To          common.Address
	BlockNumber *big.Int
	GasLimit    uint64
	GasPrice    *big.Int
	Value       *big.Int
	Input       []byte
	Code        []byte
}

type SimulationResult

type SimulationResult struct {
	ReturnedData []byte
	GasUsed      uint64
	GasLimit     uint64
	Record       *runtime.RecordToInitiateState
}

type Simulator

type Simulator struct {
	RPCClt *rpc.Client
}

func NewSimulator

func NewSimulator(rpcClt *rpc.Client) (*Simulator, error)

func (*Simulator) ConfigFromSimulation

func (s *Simulator) ConfigFromSimulation(simulation Simulation) *runtime.Config

func (*Simulator) Simulate

func (s *Simulator) Simulate(simulation Simulation, stateDB *state.StateDB, recordInitializer *runtime.RecordToInitiateState) (*SimulationResult, error)

Simulate perform the simulation of a transaction does not return a propper gas computation, for that use EstimateGas

func (*Simulator) SimulateBundle

func (s *Simulator) SimulateBundle(simulations []Simulation, stateDB *state.StateDB, recordInitializer *runtime.RecordToInitiateState) ([]*SimulationResult, error)

SimulateBundle simulate a bundle of transactions using always the same state

Jump to

Keyboard shortcuts

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