Documentation ¶
Index ¶
- type Agent
- type CreateTx
- type TxSequence
- func ConvertTxSliceToSequence(txs []*types.Transaction) TxSequence[*types.Transaction]
- func GenerateTxSequence(ctx context.Context, generator CreateTx, client ethclient.Client, ...) (TxSequence[*types.Transaction], error)
- func GenerateTxSequences(ctx context.Context, generator CreateTx, client ethclient.Client, ...) ([]TxSequence[*types.Transaction], error)
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
Execute the work of the given agent.
func NewIssueNAgent ¶
func NewIssueNAgent[T any](sequence TxSequence[T], worker Worker[T], n uint64) Agent[T]
NewIssueNAgent creates a new issueNAgent
type CreateTx ¶
type CreateTx func(key *ecdsa.PrivateKey, nonce uint64) (*types.Transaction, error)
type TxSequence ¶
type TxSequence[T any] 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) (TxSequence[*types.Transaction], error)
GenerateTxSequence fetches the current nonce of key and calls [generator] [numTxs] times sequentially to generate a sequence of transactions.
func GenerateTxSequences ¶
func GenerateTxSequences(ctx context.Context, generator CreateTx, client ethclient.Client, keys []*ecdsa.PrivateKey, txsPerKey uint64) ([]TxSequence[*types.Transaction], error)
type Worker ¶
type Worker[T any] interface { IssueTx(ctx context.Context, tx T) error ConfirmTx(ctx context.Context, tx T) error Close(ctx context.Context) 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.
Click to show internal directories.
Click to hide internal directories.