fix(txbuilder): allow native-script DRep certificates without a redeemer#447
Open
emmanuel-musau wants to merge 1 commit into
Open
fix(txbuilder): allow native-script DRep certificates without a redeemer#447emmanuel-musau wants to merge 1 commit into
emmanuel-musau wants to merge 1 commit into
Conversation
Contributor
Author
|
Related: #448 — the same eager-redeemer defect exists for CC cold credentials (authCommitteeHot / resignCommitteeCold). |
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.
Why this PR is more than the requested test
Follow-up to #432. The review asked for a devnet test with mixed Plutus and
native-script voters in one transaction (using
governance_voting.ak).Writing that test surfaced a blocker: before a native-script DRep can vote on
devnet, it has to be registered, and
TxBuilderrejected the registrationwith "Redeemer required for script-controlled DRep credential registration".
The fix
Mirrors the approach from #432, deferring the native-vs-Plutus decision to
build time:
createRegisterDRepProgram,createUpdateDRepProgram, andcreateDeregisterDRepProgram.validateCertRedeemersbuild-time pass,run alongside
validateVoterRedeemers. It classifiesthe DRep credential's script via
.attachScript()or reference inputs:Plutus credentials still require a redeemer (with guidance in the error for
both cases); native-script credentials need none, and a mistakenly supplied
redeemer is pruned with a debug log.
makeIsNativeScriptrather than duplicating it.Tests
TxBuilder.NativeScriptDRepCert.test.tsunit coverage of the cert paths(fail without the fix, pass with it).
TxBuilder.MixedVoters.test.tsthe requested devnet test: one transactionwith a Plutus DRep voter (keeps its redeemer) and a native-script DRep voter
(redeemer pruned), registered end-to-end and accepted by the ledger.