txs

package
v1.25.5 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: GPL-3.0, LGPL-3.0, LGPL-3.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent[T THash] interface {
	Execute(ctx context.Context) error
}

Execute the work of the given agent.

func NewIssueNAgent

func NewIssueNAgent[T THash](sequence TxSequence[T], worker Worker[T], n uint64, metrics *metrics.Metrics) Agent[T]

NewIssueNAgent creates a new issueNAgent

type CreateTx

type CreateTx func(key *ecdsa.PrivateKey, nonce uint64) (*types.Transaction, error)

type THash

type THash interface {
	Hash() common.Hash
}

type TxSequence

type TxSequence[T THash] interface {
	Chan() <-chan T
}

TxSequence provides an interface to return a channel of transactions. The sequence is responsible for closing the channel when there are no further transactions.

func ConvertTxSliceToSequence

func ConvertTxSliceToSequence(txs []*types.Transaction) TxSequence[*types.Transaction]

func GenerateTxSequence

func GenerateTxSequence(ctx context.Context, generator CreateTx, client *ethclient.Client, key *ecdsa.PrivateKey, numTxs uint64, async bool) (TxSequence[*types.Transaction], error)

func GenerateTxSequences

func GenerateTxSequences(ctx context.Context, generator CreateTx, client *ethclient.Client, keys []*ecdsa.PrivateKey, txsPerKey uint64, async bool) ([]TxSequence[*types.Transaction], error)

type Worker

type Worker[T THash] interface {
	IssueTx(ctx context.Context, tx T) error
	ConfirmTx(ctx context.Context, tx T) error
	LatestHeight(ctx context.Context) (uint64, error)
}

Worker defines the interface for issuance and confirmation of transactions. The caller is responsible for calling Close to cleanup resources used by the worker at the end of the simulation.

Jump to

Keyboard shortcuts

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