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

[IMPROVEMENT] - Helpful error message when assetname is too long #4619

Closed
cardano-tools-nft opened this issue Nov 5, 2022 · 2 comments · Fixed by #4626
Closed

[IMPROVEMENT] - Helpful error message when assetname is too long #4619

cardano-tools-nft opened this issue Nov 5, 2022 · 2 comments · Fixed by #4626
Assignees
Labels
comp: cardano-cli Stale type: enhancement An improvement on the existing functionality user type: external Created by an external user

Comments

@cardano-tools-nft
Copy link

cardano-tools-nft commented Nov 5, 2022

Hi

calculate-min-required-utxo has an problem with my particular assetname, cant see whats wrong with it:

bash-5.1# cardano-cli --version
cardano-cli 1.35.3 - linux-x86_64 - ghc-8.10
git rev 0000000000000000000000000000000000000000
bash-5.1# cardano-cli transaction calculate-min-required-utxo --protocol-params-file protocol.json --babbage-era --tx-out "addr1q9h2kw7neeh26cmhspye2gyvhca6qaqxakp7qcp3uydzphqu62gur507vnszr24dyt2z6lrmpmrufs6jjdhc2vy04hzqyuuw8z+1 ee659e0a80e8a9815afe8aa3906741c34d234923f4da0543ec1628d4.5468654D616E6472696C6C7A576F726C6443757045646974696F6E2333353023373731"
option --tx-out:
unexpected end of input
expecting hexadecimal digit
AssetName deserisalisation failed: Failed to deserialise "5468654D616E6472696C6C7A576F726C6443757045646974696F6E2333353023373731"
@cardano-tools-nft cardano-tools-nft added the type: bug Something is not working label Nov 5, 2022
@cardano-tools-nft
Copy link
Author

I see assetnames can be maximum 32 bytes, but a helpful error message would be nice.

@cardano-tools-nft cardano-tools-nft changed the title [BUG] - [IMPROVEMENT] - Helpful error message when assetname is too long Nov 5, 2022
@dorin100 dorin100 added type: enhancement An improvement on the existing functionality user type: external Created by an external user comp: cardano-cli and removed type: bug Something is not working labels Nov 7, 2022
@github-actions
Copy link

github-actions bot commented Dec 9, 2022

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.

@github-actions github-actions bot added the Stale label Dec 9, 2022
iohk-bors bot added a commit that referenced this issue Dec 10, 2022
4626: Improved error message for failed asset name decode r=newhoggy a=newhoggy

The new error message can be seen in this output:

```
cardano-cli transaction calculate-min-required-utxo --protocol-params-file ../protocol-params.json --babbage-era --tx-out "addr1q9h2kw7neeh26cmhspye2gyvhca6qaqxakp7qcp3uydzphqu62gur507vnszr24dyt2z6lrmpmrufs6jjdhc2vy04hzqyuuw8z+1 ee659e0a80e8a9815afe8aa3906741c34d234923f4da0543ec1628d4.5468654D616E6472696C6C7A576F726C6443757045646974696F6E233335302337"
option --tx-out:
unexpected end of input
expecting hexadecimal digit
AssetName deserisalisation failed: Failed to deserialise 5468654D616E6472696C6C7A576F726C6443757045646974696F6E233335302337 as AssetName. Unable to deserialise AssetName (the bytestring should be no longer than 32 bytes long which corresponds to a hex representation of 64 characters)

Usage: cardano-cli transaction calculate-min-required-utxo
            [ --byron-era
            | --shelley-era
            | --allegra-era
            | --mary-era
            | --alonzo-era
            | --babbage-era
            ]
            (--genesis FILE | --protocol-params-file FILE)
            --tx-out ADDRESS VALUE
            [ --tx-out-datum-hash HASH
            | --tx-out-datum-hash-cbor-file CBOR FILE
            | --tx-out-datum-hash-file JSON FILE
            | --tx-out-datum-hash-value JSON VALUE
            | --tx-out-datum-embed-cbor-file CBOR FILE
            | --tx-out-datum-embed-file JSON FILE
            | --tx-out-datum-embed-value JSON VALUE
            | --tx-out-inline-datum-cbor-file CBOR FILE
            | --tx-out-inline-datum-file JSON FILE
            | --tx-out-inline-datum-value JSON VALUE
            ]
            [--tx-out-reference-script-file FILE]

  Calculate the minimum required UTxO for a transaction output.
```

Resolves #4619

Co-authored-by: John Ky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: cardano-cli Stale type: enhancement An improvement on the existing functionality user type: external Created by an external user
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants