cardanoapi / gov-cli

Command line utility to work with Cardano governance
https://pypi.org/project/gov-cli/
2 stars 1 forks source link

[BUG] Incorrect Error Message for Unregistered Stake Key During DRep Delegation #4

Open kneerose opened 3 months ago

kneerose commented 3 months ago

Context

Steps to Reproduce:

  1. Generate a wallet, dRep, and stake key.
  2. Load the wallet with funds.
  3. Register the dRep.
  4. Attempt to delegate to the registered dRep using the following command:
    gov-cli delegate drep1qq7nfxslmcrql4umyyp2p2sgsjadjv8ql5zfukex5ez7uk9n3x5

CLI Logs:

> cardano-cli conway stake-address vote-delegation-certificate --stake-verification-key-file /home/niraj/.cardano/keys/stake.vkey --drep-key-hash drep1qq7nfxslmcrql4umyyp2p2sgsjadjv8ql5zfukex5ez7uk9n3x5 --out-file /home/niraj/.cardano/keys/vote_deleg.cert
> cardano-cli query utxo --address addr_test1qz8nlm2v2q7qmqs5uax7qa0cnvw0rgl9eajls0utsfwpr2q25xgq2sayyu0n0hyu25dmqz49rzwrpa95rmkz4hr0vclsddwxmz --out-file /home/niraj/.cardano/keys/utxo.json --socket-path /home/niraj/.cardano/sancho/node.socket --testnet-magic=4
> cardano-cli conway transaction build --witness-override 2 --certificate-file /home/niraj/.cardano/keys/vote_deleg.cert --tx-in eb45eaeeb34e29ec82652cfaa3864e98accec55ba1ac711c551db7f11d65df5b#0 --out-file /home/niraj/.cardano/keys/vote_deleg_tx.raw --change-address addr_test1qz8nlm2v2q7qmqs5uax7qa0cnvw0rgl9eajls0utsfwpr2q25xgq2sayyu0n0hyu25dmqz49rzwrpa95rmkz4hr0vclsddwxmz --socket-path /home/niraj/.cardano/sancho/node.socket --testnet-magic=4
> cardano-cli conway transaction sign --tx-body-file /home/niraj/.cardano/keys/vote_deleg_tx.raw --signing-key-file /home/niraj/.cardano/keys/payment.skey --out-file /home/niraj/.cardano/keys/vote_deleg_signed_tx.json --signing-key-file=/home/niraj/.cardano/keys/stake.skey
> cardano-cli conway transaction submit --tx-file /home/niraj/.cardano/keys/vote_deleg_signed_tx.json --socket-path /home/niraj/.cardano/sancho/node.socket --testnet-magic=4
> cardano-cli transaction txid --tx-file /home/niraj/.cardano/keys/vote_deleg_tx.raw
ERROR: Drep is not registered: drep1qq7nfxslmcrql4umyyp2p2sgsjadjv8ql5zfukex5ez7uk9n3x5

Issue:

There appears to be an incorrect condition in the code at this line, which causes the gov-cli to display an incorrect error message when the stake key is not registered. Instead of reporting that the Your stake key is not registered, the CLI incorrectly reports that the DRep is not registered.

mesudip commented 3 months ago

this is fixed