Skip to content

Conversation

@CarlosLopezDeLara
Copy link
Contributor

@CarlosLopezDeLara CarlosLopezDeLara commented Dec 11, 2025

query stake-address-info now includes the correct cip129 hex format as well as the Ledger state format. This is still needed, for example, to further queries based on this output.

Changelog

- description: |
    query stake-address-info now includes the correct cip129 hex format as well as the Ledger State format.
# uncomment types applicable to the change:
  type:
  # - feature        # introduces a new feature
  - breaking       # the API has changed in a breaking way
  # - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  # - refactoring    # QoL changes
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

Context

Fixes #1311

How to trust this PR

The output provides the 3 formats used by explorers and tools: CIP129Bech32, CIP129Hex and LedgerStateHex, both for Dreps with keys and for script based ones:

cardano-cli conway query stake-address-info --address stake1u8c4jt34q0hzs6pdzky26da0g03fdqxpzne84s0q40twjpgcsfpz3
[
    {
        "address": "stake1u8c4jt34q0hzs6pdzky26da0g03fdqxpzne84s0q40twjpgcsfpz3",
        "govActionDeposits": {},
        "rewardAccountBalance": 827782,
        "stakeDelegation": {
            "stakePoolBech32": "pool14wk2m2af7y4gk5uzlsmsunn7d9ppldvcxxa5an9r5ywek8330fg",
            "stakePoolHex": "abacadaba9f12a8b5382fc370e4e7e69421fb59831bb4ecca3a11d9b"
        },
        "stakeRegistrationDeposit": 2000000,
        "voteDelegation": {
            "keyHashBech32": "drep1ygne2h7vn5ghnpz06mg0g8zehy0euz8daxhpmsekvc8encsfd5ac9",
            "keyHashHex": "2227955fcc9d1179844fd6d0f41c59b91f9e08ede9ae1dc336660f99e2",
            "keyHashLedger": "27955fcc9d1179844fd6d0f41c59b91f9e08ede9ae1dc336660f99e2"
        }
    }
]
cardano-cli conway query stake-address-info --address stake1u8h3ygf3vc8jz9ju4ea63cy0ugcx03mwfxqlkqhxdnhnavqna2vcj
[
    {
        "address": "stake1u8h3ygf3vc8jz9ju4ea63cy0ugcx03mwfxqlkqhxdnhnavqna2vcj",
        "govActionDeposits": {},
        "rewardAccountBalance": 27665,
        "stakeDelegation": {
            "stakePoolBech32": "pool1gqgyta9sku3crjzfl9kj7kxsgfkt98y98yeu09kx22zscrezuj7",
            "stakePoolHex": "401045f4b0b72381c849f96d2f58d0426cb29c853933c796c652850c"
        },
        "stakeRegistrationDeposit": 2000000,
        "voteDelegation": {
            "scriptHashBech32": "drep1yv4uesaj92wk8ljlsh4p7jzndnzrflchaz5fzug3zxg4naqkpeas3",
            "scriptHashHex": "232bccc3b22a9d63fe5f85ea1f48536cc434ff17e8a8917111119159f4",
            "scriptHashLedger": "2bccc3b22a9d63fe5f85ea1f48536cc434ff17e8a8917111119159f4"
        }
    }
]

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

Copy link
Contributor

@palas palas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be breaking? Because I am guessing cip129SerialiseRaw returns something different than UsingRawBytesHex (the header)

@gitmachtl
Copy link
Contributor

looking good now:

${cardanocli} ${cliEra} query stake-address-info --address stake_test1urqntq4wexjylnrdnp97qq79qkxxvrsa9lcnwr7ckjd6w0cr04y4p | jq
[
  {
    "address": "stake_test1urqntq4wexjylnrdnp97qq79qkxxvrsa9lcnwr7ckjd6w0cr04y4p",
    "govActionDeposits": {},
    "rewardAccountBalance": 200000000000,
    "stakeDelegation": {
      "stakePoolBech32": "pool1rdaxrw3722f0x3nx4uam9u9c6dh9qqd2g83r2uyllf53qmmj5uu",
      "stakePoolHex": "1b7a61ba3e5292f34666af3bb2f0b8d36e5001aa41e235709ffa6910"
    },
    "stakeRegistrationDeposit": 2000000,
    "voteDelegation": {
      "keyHashBech32": "drep1ytwmwvtd0a8lr45ssner2tjxzv5y8q03w3606yeald9mdmgmwecja",
      "keyHashHex": "22ddb7316d7f4ff1d69084f2352e4613284381f17474fd133dfb4bb6ed",
      "keyHashLedger": "ddb7316d7f4ff1d69084f2352e4613284381f17474fd133dfb4bb6ed"
    }
  }
]

${cardanocli} ${cliEra} query stake-address-info --address stake_test1uqjfvelzvn48j39euddwdkd54w973dwe025mdx79h7qms6sm4zrfx | jq
[
  {
    "address": "stake_test1uqjfvelzvn48j39euddwdkd54w973dwe025mdx79h7qms6sm4zrfx",
    "govActionDeposits": {},
    "rewardAccountBalance": 8355636437,
    "stakeDelegation": null,
    "stakeRegistrationDeposit": 2000000,
    "voteDelegation": {
      "scriptHashBech32": "drep1yd6cmmc6qf5fy5g6flrsxh6ydps40rgj5je92puq6fvfxhgk7ydq7",
      "scriptHashHex": "23758def1a026892511a4fc7035f446861578d12a4b2550780d258935d",
      "scriptHashLedger": "758def1a026892511a4fc7035f446861578d12a4b2550780d258935d"
    }
  }
]

Copy link
Contributor

@palas palas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@gitmachtl
Copy link
Contributor

gitmachtl commented Dec 23, 2025

can we settle on the naming and do a bugfix release before the holidays? the current output is broken.

i would like to keep it as shown here already working? #1313 (comment)

Update friendlyDRep to use CIP129 identifiers

Improve query stake-address-info output

now includes the correct cip129 hex format as well as the Ledger state format. This is still needed, for example, to further queries based on this output.
@CarlosLopezDeLara CarlosLopezDeLara added this pull request to the merge queue Dec 23, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 23, 2025
@carbolymer carbolymer merged commit b05f3d9 into master Dec 23, 2025
25 checks passed
@carbolymer carbolymer deleted the clr/st-adr-info branch December 23, 2025 15:30
@gitmachtl
Copy link
Contributor

Thx for the bugfix. New SPO Scripts already released. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG - Output of query stake-address-info for v10.13.1 is returning wrong/missing voteDelegation values

5 participants