IntersectMBO / cardano-cli

This repository contains sources for the command-line interface (CLI) tool for interacting with the Cardano blockchain.
Apache License 2.0
39 stars 14 forks source link

[FEATURE] - allow update drep cert via CLI for scripts #880

Closed perturbing closed 1 week ago

perturbing commented 1 week ago

What

The end user can update their script based drep via the cli

Why

Currently for

cardano-cli --version 
cardano-cli 9.2.1.0 - linux-x86_64 - ghc-8.10
git rev 176f99e51155cb3eaa0711db1c3c969d67438958

we have that

cardano-cli conway governance drep update-certificate  -
--drep-key-hash               --drep-metadata-hash          --drep-metadata-url           --drep-verification-key       --drep-verification-key-file  -h                            --help                        --out-file

does not allow for scripts. Whereas

cardano-cli conway governance drep registration-certificate -
--drep-key-hash               --drep-metadata-url           --drep-verification-key       -h                            --key-reg-deposit-amt         
--drep-metadata-hash          --drep-script-hash            --drep-verification-key-file  --help                        --out-file                    

Does allow for a --drep-script-hash flag.

Personas

Dreps

Definition of Done (DoD)

NOTE: Ideally, we should merge only fully implemented and tested features into the master branch. So all the above steps are required for the PR to be merged.
In order to avoid the PRs becoming stale and requiring to be rebased on master, these can be merged after a reasonable time (current agreement is 3 days) if the System Test Engineer Owner's sign-off was not provided (last step in the DoD).

IMPORTANT: Any deviation from the plan should be discussed and agreed as a comment in the Feature file.

Sign-off

Related PRs

  1. PR # here

Acceptance Criteria

Acceptance Criteria & User Stories define here (or in a separate file (linked here) for a big feature)

Example - https://github.com/input-output-hk/cardano-node/issues/4453

perturbing commented 1 week ago

Workaround, given a script hash file dutchDrepCredential.hash and the incorrect command (for a keyed credential)

cardano-cli conway governance drep update-certificate \
 --drep-key-hash $(cat dutchDrepCredential.hash) \
 --drep-metadata-url https://raw.githubusercontent.com/perturbing/DutchRep/main/data/drep.jsonld \
 --drep-metadata-hash 7d67f3f455290b0ea2a7fa54144f3891a03697424945ee3621395a56663bdc67 \
 --out-file update-dutchDutchCredential.cert 

One can manipulate the output

cat update-dutchDutchCredential.cert 
{
    "type": "CertificateConway",
    "description": "DRep Update Certificate",
    "cborHex": "83128200581ce5ab37261b3d63600d566564879370aea031ea3108b0a6bd8cef58aa82784b68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f70657274757262696e672f44757463685265702f6d61696e2f646174612f647265702e6a736f6e6c6458207d67f3f455290b0ea2a7fa54144f3891a03697424945ee3621395a56663bdc67"
}

that matched to this with a pubkey credential to this

cat update-dutchDutchCredential.cert 
{
    "type": "CertificateConway",
    "description": "DRep Update Certificate",
    "cborHex": "83128201581ce5ab37261b3d63600d566564879370aea031ea3108b0a6bd8cef58aa82784b68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f70657274757262696e672f44757463685265702f6d61696e2f646174612f647265702e6a736f6e6c6458207d67f3f455290b0ea2a7fa54144f3891a03697424945ee3621395a56663bdc67"
}

Notice that the 8th character changed from 0 to 1 (as per this cddl)

smelc commented 1 week ago

cc @CarlosLopezDeLara

CarlosLopezDeLara commented 1 week ago

@perturbing Definitely an omission on our side. Thank you very much for bringing this up.

This is something we can work on @smelc.