# README
generate_transaction
Task
Description
The generate_transaction
task creates and sends a single transaction to the network and optionally checks the transaction receipt. This task is useful for testing specific transaction behaviors, including contract deployments, and verifying receipt properties like triggered events.
Configuration Parameters
-
privateKey
:
The private key used for generating the transaction. -
legacyTxType
:
Iftrue
, generates a legacy (type 0) transaction. Iffalse
, a dynamic fee (type 2) transaction is created. -
blobTxType
:
Iftrue
, generates a blob (type 3) transaction. Otherwise, a dynamic fee (type 2) transaction is used. -
setCodeTxType
:
Iftrue
, generates a set code (type 4) transaction. Otherwise, a dynamic fee (type 2) transaction is used. -
blobFeeCap
:
The fee cap for blob transactions. Used only ifblobTxType
istrue
. -
feeCap
:
The maximum fee cap for the transaction. -
tipCap
:
The tip cap for the transaction. -
gasLimit
:
The gas limit for the transaction. -
targetAddress
:
The target address for the transaction. -
randomTarget
:
Iftrue
, the transaction is sent to a random address. -
contractDeployment
:
Iftrue
, the transaction is for deploying a contract. -
callData
:
Call data included in the transaction. -
blobData
:
Data for the blob component of the transaction. Used only ifblobTxType
istrue
. -
authorizations
:
EOA code authorizations. Used only ifsetCodeTxType
istrue
.- { "chainId": 0, "nonce": null, "codeAddress": "0x000...", "signerPrivkey": "000..." }
-
randomAmount
:
Iftrue
, the transaction amount is randomized. -
amount
:
The amount of cryptocurrency to be sent in the transaction. -
nonce
:
The nonce for the transaction. If not set, the nonce is incremented by 1. -
clientPattern
:
A regex pattern to select specific client endpoints for sending the transaction. -
excludeClientPattern
:
A regex pattern to exclude certain clients from being used for sending the transaction. -
awaitReceipt
:
Iffalse
, the task succeeds immediately after sending the transaction without waiting for the receipt. Iftrue
, it waits for the receipt. -
failOnReject
:
Iftrue
, the task fails if the transaction is rejected. -
failOnSuccess
:
Iftrue
, the task fails if the transaction is successful and not rejected. -
expectEvents
:
A list of events that the transaction is expected to trigger, specified in a structured object format. Each event object can have the following properties:topic0
,topic1
,topic2
,topic3
, anddata
. All these properties are optional and expressed as hexadecimal strings (e.g., "0x000..."). The task checks all triggered events against these objects and looks for a match that satisfies all specified properties in any single event. An example event object might look like this:- { "topic0": "0x000...", "topic1": "0x000...", "topic2": "0x000...", "topic3": "0x000...", "data": "0x000..." }
-
transactionHashResultVar
:
The variable name to store the transaction hash, available for use by subsequent tasks. -
transactionReceiptResultVar
:
The variable name to store the full transaction receipt, available for use by subsequent tasks. -
contractAddressResultVar
:
The variable name to store the deployed contract address if the transaction was a contract deployment, available for use by subsequent tasks.
Defaults
Default settings for the generate_transaction
task:
- name: generate_transaction
config:
privateKey: ""
legacyTxType: false
blobTxType: false
setCodeTxType: false
blobFeeCap: null
feeCap: "100000000000"
tipCap: "1000000000"
gasLimit: 50000
targetAddress: ""
randomTarget: false
contractDeployment: false
callData: ""
blobData: ""
authorizations: []
randomAmount: false
amount: "0"
nonce: null
clientPattern: ""
excludeClientPattern: ""
awaitReceipt: true
failOnReject: false
failOnSuccess: false
expectEvents: []
transactionHashResultVar: ""
transactionReceiptResultVar: ""
contractAddressResultVar: ""