Documentation
¶
Index ¶
- type Agent
- type CreateTx
- type THash
- 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 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 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.