def METHOD_NAME(
    self,
    cluster: clusterlib.ClusterLib,
    payment_addr: clusterlib.AddressRecord,
):
    """Test transactions chaining.
    Submit Txs one by one without waiting for them to appear on ledger and use output of one
    Tx as input for the next Tx. As a result, Txs are using inputs that doesn't exist on ledger
    yet. Node needs to lookup the Tx in mempool and correctly chain the dependent transactons.
    """
    temp_template = common.get_test_id(cluster)
    fee = 200_000
    iterations = 1_000
    min_utxo_value = 1_000_000
    init_utxo = cluster.g_query.get_utxo(address=payment_addr.address)[0]
    assert (
        init_utxo.amount - (fee * iterations) >= min_utxo_value
    ), f"Not enough funds to do {iterations} iterations"
    invalid_hereafter = (
        cluster.g_query.get_slot_no() + 4000
        if VERSIONS.transaction_era < VERSIONS.ALLEGRA
        else None
    )
    # generate signed Txs
    generated_txs = []
    tx_raw_outputs = []
    txin = init_utxo
    for idx in range(1, iterations + 1):
        txin, tx_raw_output, tx_file = _gen_signed_tx(
            cluster_obj=cluster,
            payment_addr=payment_addr,
            txin=txin,
            out_addr=payment_addr,
            tx_name=f"{temp_template}_{idx:04d}",
            fee=fee,
            invalid_hereafter=invalid_hereafter,
        )
        generated_txs.append(tx_file)
        tx_raw_outputs.append(tx_raw_output)
    def _repeat_submit(tx_file: pl.Path):
        # we want to submit the Tx and then re-submit it and see the expected error, to make
        # sure the Tx made it to mempool
        for r in range(5):
            try:
                cluster.g_transaction.submit_tx_bare(tx_file=tx_file)
            except clusterlib.CLIError as exc:
                err_str = str(exc)
                if r == 0 and "(BadInputsUTxO" in err_str:
                    raise Exception(  # pylint: disable=broad-exception-raised
                        "Tx input is missing, maybe temporary fork?"
                    ) from exc
                if "(BadInputsUTxO" not in err_str:
                    raise
                break
        else:
            raise AssertionError("Failed to make sure the Tx is in mempool")
    # submit Txs one by one without waiting for them to appear on ledger
    for tx_file in generated_txs:
        _repeat_submit(tx_file)
    if configuration.HAS_DBSYNC:
        # wait a bit for all Txs to appear in db-sync
        time.sleep(5)
        check_tx_outs = [
            dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=t) for t in tx_raw_outputs
        ]
        block_ids = [r.block_id for r in check_tx_outs if r]
        assert block_ids == sorted(block_ids), "Block IDs of Txs are not ordered"
        how_many_blocks = block_ids[-1] - block_ids[0]
        assert how_many_blocks < iterations // 25, "Expected more chained Txs per block"