Repository navigation
Conversation
This branch has not been deployed
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.
Summary
Fixes #518.
authCommitteeHotandresignCommitteeColdstore a Plutus-script committee cold credential's redeemer undercert:{coldCredentialHash}, but the certificate lookup that resolves that key to a certificate index never checkedcommitteeColdCredential, so the redeemer was dropped and the transaction could not be built.The lookup exists in two places, and both had the same gap:
txBuilder.ts(assembly): the cert branch matched onlystakeCredentialanddrepCredential; an unresolved key loggedCould not find cert index for key: cert:…and the redeemer was skipped.Evaluation.ts(script evaluation): the certificate index map was built from the same two fields, so evaluation never associated the redeemer with a purpose either — in practice the build failed there first, withEvaluation returned zero results despite having …once the assembled pre-evaluation transaction came back with no cert redeemer for the evaluator to price.Both now also match
committeeColdCredential(the credential onAuthCommitteeHotCertandResignCommitteeColdCert), in the same shape as the existing branches.Deliberately left out
The issue's second suggestion — failing instead of warning when a cert redeemer cannot be resolved. Warn-and-continue is the shared behaviour of that assembly loop for every redeemer tag (mint, cert, reward, vote), so changing the failure semantics for cert alone is a broader behaviour change than the index fix; I left it for maintainer direction rather than deciding it in this PR. After this fix, a committee cert redeemer resolves, so the warning path is only reachable for a key that names no certificate at all.
Tests
New file
TxBuilder.PlutusCCCert.test.ts(4 tests), all verified red on main first, one at a time:authCommitteeHotwith a redeemer: on main the build failed in evaluation; after the fix it emits onecertredeemer at index 0 with the evaluator's ExUnits, the Plutus V3 script in the witness set, and a script data hash.authCommitteeHotfirst and the Plutus one second — the redeemer is emitted at index 1 (the committee certificate's own index), with the ExUnits the evaluator returned for index 1.resignCommitteeColdwith a redeemer: onecertredeemer at index 0.TxBuilder.NativeScriptCCCertsuite also still passes).Full suite: 1682 passed / 75 skipped / 0 failed (103 test files: 102 passed, 1 skipped) — main's 1678 baseline plus the 4 new tests.
tsc --noEmitand eslint clean; a patch changeset is included.Built and maintained by Kyle Cox — independent Cardano builder.
𝕏 @Kshot9000 (https://x.com/kshot9000) · GitHub https://github.com/Kshot3000
ADA: addr1q8hnl6vl5a6k3rw3n5g3jtte696zcl76kfatzv7gpswa9r0dj7fma6klq55y4ffm7tf0em09udnyhuk4ah92pl5x9jpqjae44v
Not affiliated with the Cardano Foundation, IOG, or Intersect. Tagging @cardano-foundation and @IntersectMBO for visibility.