Repository navigation
feat: add vote and proposal part builders - #857
Merged
Merged
Conversation
This was referenced Oct 24, 2026
Merged
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 votes and governance proposals. With these, every part of a Conway transaction has a builder.
Stacked on #856. Merge it first; this PR can then be retargeted to
main. Still inpackages/mesh-transaction/src/tx-builder/, not exported from the package root.Contents
packages/mesh-transaction/src/tx-builder/parts/governance.ts:vote({ voter, votes, witness? }): all of one voter's votes in one part, since the ledger runs a voter's script, and takes its redeemer, once for all of them.{ drep }(CIP-105/129 id or credential),{ committee }(hot credential, or a reward address carrying it) or{ pool }(bech32 id or key hash).{ action: { txHash, index }, vote: "yes" | "no" | "abstain", anchor? }. An action may be voted on once per part.proposal.*for the seven governance actions:parameterChange,hardForkInitiation,treasuryWithdrawals,noConfidence,updateCommittee,newConstitution,info.rewardAccount(where the deposit is returned),anchoranddeposit. Whendepositis omitted it is left to thegovActionDepositprotocol parameter and reported byunresolved.previouslinks an action to the last enacted one of the same purpose.parameterChangeandtreasuryWithdrawalstake an optionalguardrailscript, native or Plutus V3. Its hash becomes the action's policy hash and it witnesses the proposal. A guardrail referenced by out ref alone needspolicyHash, and a policy hash without its guardrail is rejected.updateCommitteechecks term limits and that the quorum is at most 1.certificates.tstocredentials.ts, shared by certificates and governance parts.DepositParameternow also coversgovActionDeposit.Validation
transactionPrototypeToHexand decoded withtransactionPrototypeFromHex. The exception is the parameter change, which the decoder deliberately does not decode, so it is checked for encoding only.mesh-transactionsuite (NODE_OPTIONS=--experimental-vm-modules npx jest): 237 tests pass.script-tx-fetcherandscript-tx-failfail to load under that flag onmaintoo.