Skip to content

[BUG] - query utxo --output-text renders dangling "+ " after value for pre-Babbage outputs #1398

Closed

Description

@mkoura

Summary

cardano-cli latest query utxo --output-text renders a dangling + separator after the lovelace amount for pre-Babbage era outputs - trailing + and space with nothing after it. This is an unannounced change to the text output format in cardano-cli-11.1.0.0 that breaks scripts parsing this output.

Steps to reproduce

On a local testnet that is still in Shelley era (e.g. during a staged hard-fork bootstrap):

$ cardano-cli latest query utxo --testnet-magic 42 --output-text --address <addr>
                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
8de6d2076c030674c828d4958f4a33d8368579afe8b077d75dfa324fdb6745a1     0        36000000000000000 lovelace +

Note the line ends with lovelace + .

Expected behavior

If there is no datum to show, no separator at all (... lovelace), or a placeholder after the + as in previous versions. No dangling + .

Actual behavior

Pre-Babbage era outputs (Shelley/Allegra/Mary/Alonzo) render as ... lovelace + — the datum placeholder is empty, but the separator is still emitted.

Scripts that match on lovelace$ or lovelace \+ TxOutDatumNone$ silently select zero UTxOs.

Version

cardano-cli 11.1.0.0 - linux-x86_64 - ghc-9.6 (git rev f098c09d233b021395b123ac77787b9dc4c2595d)

Previous versions (≤ 11.0.x) printed ... lovelace + TxOutDatumNone.

Root cause

Commit f2f7d4d ("Remove non-Byron TxOut CtxTx/CtxUTxO usage from cardano-cli", merged in #1379) rewrote utxoToText in cardano-cli/src/Cardano/CLI/EraBased/Query/Run.hs to render from ledger types. The datum is now read via datumTxOutL, which only exists for Babbage+ eras, so pre-Babbage outputs render an empty placeholder - but the " + " separator is still emitted unconditionally:

      , "        " <> printableValue <> " + " <> printableDatum

Suggested fix

  • Suppress the " + " separator when the datum placeholder is empty.
  • Add a golden test for query utxo --output-text so future format changes are caught.

Activity

  1. added theissue type on Jul 23, 2026
  2. self-assigned this
    on Jul 24, 2026
  3. added 6 commits that reference this issue on Jul 24, 2026
    0a273cb
    0b805e8
    0a03c05
    d3cf07a
    145ded3
    d5fab0f
  4. linked a pull request that will close this issueFix query UTxO rendering #1399on Jul 25, 2026
  5. added 2 commits that reference this issue on Jul 27, 2026
    c963a7f
    c3f4243
  6. added 2 commits that reference this issue on Nov 10, 2026
    b88a73e
    a8208dc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions