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

Cl/stakereganddeleg #919

Merged
merged 10 commits into from
Oct 2, 2024
Merged

Cl/stakereganddeleg #919

merged 10 commits into from
Oct 2, 2024

Conversation

CarlosLopezDeLara
Copy link
Contributor

@CarlosLopezDeLara CarlosLopezDeLara commented Sep 30, 2024

Changelog

- description: |
    Implement cddl's `stake_reg_deleg_cert` and `vote_reg_deleg_cert` and `stake_vote_reg_deleg_cert` as: 
    - cardano-cli conway stake-address registration-and-delegation-certificate 
    - cardano-cli conway stake-address registration-and-vote-delegation-certificate 
    - cardano-cli conway stake-address registration-stake-and-vote-delegation-certificate
    
# 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

Resolves #909

The Conway CDDL includes this certificate. It was not a priority during the initial Conway implementation because one can achieve the same result with a combination of the other certificates.

How to trust this PR

  • Tests are included on the PR
  • Parsing the resulting CBOR through diagnostics in cbor.me shows
[11, [0, h'EF1785CF18928F8353C90E76B7A8FC60855472D31A0EA1C1C774AB01'], h'C27CF021914A2B3BCB286D3D741979083422378C577FE757702B6988', 2000000]

which matches the expected certificate from the cddl:

stake_reg_deleg_cert = (11, stake_credential, pool_keyhash, coin)

The same with:

[12, [0, h'EF1785CF18928F8353C90E76B7A8FC60855472D31A0EA1C1C774AB01'], [0, h'E68F9EE70599CB93D9F60678F9C6463C01938C27D9820C7BF93887A5'], 2000000]
vote_reg_deleg_cert = (12, stake_credential, drep, coin)

and for

[13, [0, h'EF1785CF18928F8353C90E76B7A8FC60855472D31A0EA1C1C774AB01'], h'E22C026479D8CEB9CDA4FC344F550F3ACC19955AFE4670EE9F0EE0B8', [3], 2000000]
stake_vote_reg_deleg_cert = (13, stake_credential, pool_keyhash, drep, coin)

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

@CarlosLopezDeLara CarlosLopezDeLara marked this pull request as draft September 30, 2024 18:51
@CarlosLopezDeLara CarlosLopezDeLara force-pushed the cl/stakereganddeleg branch 2 times, most recently from fbf6e03 to 465a054 Compare September 30, 2024 19:14
This certificate registers a stake address and delegates to a pool simultaneously:
From CDDL: stake_reg_deleg_cert = (11, stake_credential, pool_keyhash, coin)

add golden test for `stake_reg_deleg_cert`

add golden test for `stake_reg_deleg_cert`
update golden files

Update StakeAddress.hs

pretiffy

register and delegate to a pool
Copy link
Contributor

@smelc smelc left a comment

Choose a reason for hiding this comment

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

Great job 👏

CarlosLopezDeLara and others added 3 commits October 1, 2024 08:00
Co-authored-by: Clément Hurlin <smelc@users.noreply.github.com>
…keAddress.hs

Co-authored-by: Clément Hurlin <smelc@users.noreply.github.com>
…keAddress.hs

Co-authored-by: Clément Hurlin <smelc@users.noreply.github.com>
@CarlosLopezDeLara CarlosLopezDeLara marked this pull request as ready for review October 1, 2024 16:14
@CarlosLopezDeLara CarlosLopezDeLara added this pull request to the merge queue Oct 1, 2024
@CarlosLopezDeLara CarlosLopezDeLara removed this pull request from the merge queue due to a manual request Oct 1, 2024
@CarlosLopezDeLara CarlosLopezDeLara added this pull request to the merge queue Oct 2, 2024
Merged via the queue into main with commit 89a8819 Oct 2, 2024
26 checks passed
@CarlosLopezDeLara CarlosLopezDeLara deleted the cl/stakereganddeleg branch October 2, 2024 07:23
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.

[FEATURE] - Add vote_reg_deleg_cert and stake_vote_reg_deleg_cert certificate type
2 participants