Repository navigation
feat: add certificate part builders and encode Conway stake (de)registration deposits - #856
Merged
twwu123 merged 2 commits intoOct 30, 2026
Conversation
…alars' into review/pr-856-local
twwu123
approved these changes
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds part builders for every certificate the Conway ledger accepts. Also makes the
TransactionPrototypeencoder keep the deposit of Conway stake (de)registration certificates instead of dropping it.Stacked on #855. Merge it first; this PR can then be retargeted to
main. The part builders stay inpackages/mesh-transaction/src/tx-builder/, not exported from the package root.Contents
packages/mesh-transaction/src/tx-builder/parts/certificates.ts, one builder per CDDL certificate:stakeRegistration,stakeDeregistrationlegacyStakeRegistration,legacyStakeDeregistrationstakeDelegationpoolRegistration,poolRetirementvoteDelegation,stakeAndVoteDelegationstakeRegistrationAndDelegation,voteRegistrationAndDelegation,stakeVoteRegistrationAndDelegationcommitteeHotAuth,committeeColdResigndrepRegistration,drepDeregistration,drepUpdateDRepPrototype,"alwaysAbstain"or"alwaysNoConfidence".poolRegistrationtakes MeshPoolParams. Margin, pledge and cost, VRF and owner hashes, the reward address, relays (IPv4, IPv6 with::, DNS names, ports) and metadata are all checked.witness: { native }or{ plutus, redeemer }, checked against the credential's hash. A script referenced by out ref alone gets its hash from the credential.keyDeposit,drepDeposit), andunresolvedreports it as adepositgap.mesh-core-cst:certificatePrototypeToCardanonow encodesSTAKE_REGISTRATION/STAKE_DEREGISTRATIONwith acoinas certificates 7/8,Registration/Unregistrationwith the deposit. Without acoin, the legacy 0/1 are produced as before. Previously the deposit was silently dropped, so these certificates did not round-trip.docs/design/tx-prototype.mdare updated.Validation
certificates.test.ts:transactionPrototypeToHex/transactionPrototypeFromHex.mesh-core-cst: 180 tests pass.mesh-transaction(NODE_OPTIONS=--experimental-vm-modules npx jest): 224 tests pass.script-tx-fetcherandscript-tx-failfail to load under that flag onmaintoo.