feat(e2e): add PlutusV3 txInfoProposalProcedures and txInfoVotingProcedures for ParameterChange #49#3
Open
mwihoti wants to merge 1 commit intoCardanoHubNBO:mainfrom
Conversation
…edures test for ParameterChange - Implement fromLedgerGovernanceAction in TypeConverters covering all six GovernanceAction arms (ParameterChange, HardForkInitiation, TreasuryWithdrawals, NoConfidence, UpdateCommittee, NewConstitution) - Add top-level fromCardanoVoter and fromCardanoGovActionId converters - Fix mkVerifyVotes bug: contextGovActionIds and contextVoteVals were incorrectly read from the redeemer instead of the ScriptContext TxInfo - Add parameterChangeProposalAndVoteV3TxInfoTest: two-transaction test that verifies txInfoProposalProcedures and txInfoVotingProcedures on-chain using PlutusV3 minting policies as proof Closes IntersectMBO#49
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.
Implements the E2E test for PlutusV3's
txInfoProposalProceduresandtxInfoVotingProceduresfields using aParameterChangegovernance action.Implemented
fromLedgerGovernanceActionin TypeConverters covering all sixGovernanceAction arms (ParameterChange, HardForkInitiation, TreasuryWithdrawals,
NoConfidence, UpdateCommittee, NewConstitution)
Added top-level
fromCardanoVoterandfromCardanoGovActionIdconvertersFixed
mkVerifyVotesbug:contextGovActionIdsandcontextVoteValswereincorrectly read from the redeemer instead of the ScriptContext TxInfo
Added
parameterChangeProposalAndVoteV3TxInfoTest: two-transaction test thatverifies
txInfoProposalProceduresandtxInfoVotingProcedureson-chainusing PlutusV3 minting policies as proof
Issue Test PlutusV3's txInfoProposalProcedures and txInfoVotingProcedures for ParameterChange IntersectMBO/antaeus#49 Test PlutusV3's txInfoProposalProcedures and txInfoVotingProcedures for ParameterChange IntersectMBO/antaeus#49
changes made
[Helpers/TypeConverters.hs]
fromLedgerGovernanceAction— previouslyundefined(runtimecrash blocker). Now covers all 6 arms:
ParameterChange,HardForkInitiation,TreasuryWithdrawals,NoConfidence,UpdateCommittee,NewConstitution,InfoActionfromCardanoVoter— converts a ledgerVotertoPlutusV3.VoterfromCardanoGovActionId— convertsTxId+ index toPlutusV3.GovernanceActionIdData.Map.Strict,Data.Set,Data.Text.Encoding,Data.Word[PlutusScripts/Governance/Common.hs]
mkVerifyVotes—contextGovActionIdsandcontextVoteValswere reading from the redeemer instead of the ScriptContext TxInfo (silent
correctness bug allowing tests to pass with wrong on-chain data)
[Spec/ConwayFeatures.hs]
parameterChangeProposalAndVoteV3TxInfoTest:ParameterChange. PlutusV3 minting policy checkstxInfoProposalProceduresfor correctppDeposit,ppReturnAddrandGovernanceAction. Token mint proves on-chain check passed.ParameterChange). PlutusV3 minting policy checks
txInfoVotingProceduresfor correct voter credentials,
GovernanceActionIdand vote values.Token mint proves on-chain check passed.
[Spec.hs]
registerCommitteeTestInfo(required for CC to be registered before voting)parameterChangeProposalAndVoteV3TxInfoTestInfoin governance test suiteTests
txInfoProposalProcedures—ppDeposit| PassedtxInfoProposalProcedures—ppReturnAddr| PassedtxInfoProposalProcedures—ParameterChangeGovernanceAction | PassedtxInfoVotingProcedures— CC voter + VoteYes | PassedtxInfoVotingProcedures— DRep voter + VoteNo | PassedtxInfoVotingProcedures— GovernanceActionId (txId + index) | Passed| On-chain proof via token mint | Passed