Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(utxorpc): correctly handle empty datum fields in ReadUtxos response #286

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

verbotenj
Copy link
Contributor

Fixes #251

// Hash tx
base64: eRMJtrD6zICz+olugwmZ577zIepSefa+2+EnnuHp1K4=
// Hex value of base64 Hash tx
hex: 791309b6b0facc80b3fa896e830999e7bef321ea5279f6bedbe1279ee1e9d4ae

Returns expected

grpcurl -plaintext -d '{"keys": [{"hash": "eRMJtrD6zICz+olugwmZ577zIepSefa+2+EnnuHp1K4="}]}' localhost:9090 utxorpc.v1alpha.query.QueryService.ReadUtxos
{
  "items": [
    {
      "nativeBytes": "glg5AJ1hk0QlxWy+JWCbQgZaNWvZunvonoqgIo6R7aam1QLMzKKDJ/IuoQPXLLQ9gK4z7mgkNrZADfm0GgCYloA=",
      "txoRef": {
        "hash": "eRMJtrD6zICz+olugwmZ577zIepSefa+2+EnnuHp1K4="
      },
      "cardano": {
        "address": "AJ1hk0QlxWy+JWCbQgZaNWvZunvonoqgIo6R7aam1QLMzKKDJ/IuoQPXLLQ9gK4z7mgkNrZADfm0",
        "coin": "10000000"
      }
    }
  ],
  "ledgerTip": {
    "slot": "75089835",
    "hash": "dv2WlIwT2BtpUL6HcSgUK4z32wtJ7m3LJnPjWv/YOuk="
  }
}
cardano-cli conway query utxo \
--tx-in 791309b6b0facc80b3fa896e830999e7bef321ea5279f6bedbe1279ee1e9d4ae#0 \
--testnet-magic 1 \
--output-text
                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
791309b6b0facc80b3fa896e830999e7bef321ea5279f6bedbe1279ee1e9d4ae     0        10000000 lovelace + TxOutDatumNone

@verbotenj verbotenj requested a review from a team as a code owner November 5, 2024 02:42
@verbotenj verbotenj merged commit 8ac9e73 into main Nov 5, 2024
7 checks passed
@verbotenj verbotenj deleted the fix/readutxos branch November 5, 2024 12:15
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.

[UTXORPC] ReadUtxos response for a utxo without a datum is showing some data
2 participants