utils

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EIP-7825: Maximum gas limit per transaction (2^24)
	MaxGasLimitPerTx = 16777216
)

Variables

View Source
var BuildRelease string
View Source
var BuildTime string
View Source
var BuildVersion string

Functions

func EtherToWei

func EtherToWei(val *uint256.Int) *uint256.Int

func GetBuildVersion

func GetBuildVersion() string

func ParseHexSeed added in v1.2.4

func ParseHexSeed(seed string) ([]byte, error)

ParseHexSeed decodes a hex seed, tolerating a 0x prefix and an odd digit count.

func ReadFileLinesTrimmed

func ReadFileLinesTrimmed(fname string) ([]string, error)

func ReadableAmount added in v1.1.4

func ReadableAmount(amount *uint256.Int) string

func RecoverPanic added in v1.1.3

func RecoverPanic(logger *logrus.Entry, routineName string, restartFn func()) bool

func WeiToEther

func WeiToEther(val *uint256.Int) *uint256.Int

Types

type ABICallDataBuilder added in v1.1.4

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

func NewABICallDataBuilder added in v1.1.4

func NewABICallDataBuilder(callABI, callFnName, callFnSig, callArgs string) (*ABICallDataBuilder, error)

func (*ABICallDataBuilder) BuildCallData added in v1.1.4

func (b *ABICallDataBuilder) BuildCallData(txIdx uint64) ([]byte, error)

type DeterministicRNG added in v1.2.4

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

DeterministicRNG is a seeded pseudo-random source for fuzzing scenarios.

Fuzzers need their output to be reproducible from a short command line: a run is identified by a seed, and every transaction index draws from its own stream derived from that seed, so a single failing transaction can be regenerated on its own without replaying the ones before it.

func NewDeterministicRNGWithSeed added in v1.2.4

func NewDeterministicRNGWithSeed(txID uint64, baseSeed string) *DeterministicRNG

NewDeterministicRNGWithSeed creates a generator for one transaction index.

The seed is hashed together with the index so that neighbouring indices produce unrelated streams; a seed that is not valid hex is used as raw bytes rather than rejected, so an operator can pass a memorable string.

func (*DeterministicRNG) Bytes added in v1.2.4

func (r *DeterministicRNG) Bytes(n int) []byte

Bytes returns n pseudo-random bytes.

func (*DeterministicRNG) Draws added in v1.2.4

func (r *DeterministicRNG) Draws() uint64

Draws returns how many values have been taken from the stream, which lets a caller assert that a generation pass consumed a stable number of draws.

func (*DeterministicRNG) Float64 added in v1.2.4

func (r *DeterministicRNG) Float64() float64

Float64 returns a value in [0, 1].

func (*DeterministicRNG) Intn added in v1.2.4

func (r *DeterministicRNG) Intn(n int) int

Intn returns a value in [0, n), or 0 when n is not positive.

func (*DeterministicRNG) Uint64 added in v1.2.4

func (r *DeterministicRNG) Uint64() uint64

Uint64 returns the next value from the stream, using xorshift64*.

func (*DeterministicRNG) Uint64n added in v1.2.4

func (r *DeterministicRNG) Uint64n(n uint64) uint64

Uint64n returns a value in [0, n), or 0 when n is zero.

type FlexibleJsonUInt64 added in v1.1.2

type FlexibleJsonUInt64 uint64

func (*FlexibleJsonUInt64) UnmarshalJSON added in v1.1.2

func (f *FlexibleJsonUInt64) UnmarshalJSON(b []byte) error

func (*FlexibleJsonUInt64) UnmarshalYAML added in v1.1.2

func (f *FlexibleJsonUInt64) UnmarshalYAML(unmarshal func(interface{}) error) error

type TxFees added in v1.1.5

type TxFees struct {
	FeeAmount     big.Int
	BlobFeeAmount big.Int
	TxBaseFee     big.Int
	BlobBaseFee   big.Int
}

TxFees represents the fees associated with a transaction including the fee amount and blob fee amount.

func GetTransactionFees added in v1.1.5

func GetTransactionFees(tx *txtypes.Transaction, receipt *txtypes.Receipt) *TxFees

func (*TxFees) BlobBaseFeeGwei added in v1.1.5

func (txFees *TxFees) BlobBaseFeeGwei() (res big.Int)

func (*TxFees) BlobBaseFeeGweiString added in v1.1.6

func (txFees *TxFees) BlobBaseFeeGweiString() string

func (*TxFees) BlobFeeGwei added in v1.1.5

func (txFees *TxFees) BlobFeeGwei() (res big.Int)

func (*TxFees) BlobFeeGweiString added in v1.1.6

func (txFees *TxFees) BlobFeeGweiString() string

func (*TxFees) TotalFeeGwei added in v1.1.5

func (txFees *TxFees) TotalFeeGwei() (res big.Int)

func (*TxFees) TotalFeeGweiString added in v1.1.6

func (txFees *TxFees) TotalFeeGweiString() string

func (*TxFees) TxBaseFeeGwei added in v1.1.5

func (txFees *TxFees) TxBaseFeeGwei() (res big.Int)

func (*TxFees) TxBaseFeeGweiString added in v1.1.6

func (txFees *TxFees) TxBaseFeeGweiString() string

func (*TxFees) TxFeeGwei added in v1.1.5

func (txFees *TxFees) TxFeeGwei() (res big.Int)

func (*TxFees) TxFeeGweiString added in v1.1.6

func (txFees *TxFees) TxFeeGweiString() string

Jump to

Keyboard shortcuts

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