From 846e660c8abccc305f5b30af49017dbdf41ef7e2 Mon Sep 17 00:00:00 2001 From: Alexey Kuleshevich Date: Fri, 12 Jan 2024 11:28:45 +0100 Subject: [PATCH] Use the newest plutus packages --- cabal.project | 12 ++++++++++ .../impl/src/Cardano/Ledger/Conway/TxInfo.hs | 24 ++++++++++--------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/cabal.project b/cabal.project index 0206fc2e129..6744ec2b816 100644 --- a/cabal.project +++ b/cabal.project @@ -92,3 +92,15 @@ benchmarks: true -- The only sensible test display option test-show-details: streaming + +-- TO BE removed as soon as https://github.com/IntersectMBO/plutus/pull/5712 is merged and released +source-repository-package + type: git + location: https://github.com/IntersectMBO/plutus + tag: c006bbdddafd100433916def71502415dd9a51cd + --sha256: sha256-JAISXfDQ6DpNLlwxEkZS+t9hwrPawe4K2bMB89IQnIU= + subdir: + plutus-ledger-api + plutus-core + plutus-tx + plutus-tx-plugin diff --git a/eras/conway/impl/src/Cardano/Ledger/Conway/TxInfo.hs b/eras/conway/impl/src/Cardano/Ledger/Conway/TxInfo.hs index 91c13a6ca13..1bd25c5f371 100644 --- a/eras/conway/impl/src/Cardano/Ledger/Conway/TxInfo.hs +++ b/eras/conway/impl/src/Cardano/Ledger/Conway/TxInfo.hs @@ -314,21 +314,21 @@ transTxCert = \case UnRegTxCert stakeCred -> PV3.TxCertUnRegStaking (transCred stakeCred) Nothing RegDepositTxCert stakeCred deposit -> - PV3.TxCertRegStaking (transCred stakeCred) (Just (transCoin deposit)) + PV3.TxCertRegStaking (transCred stakeCred) (Just (coinToLovelace deposit)) UnRegDepositTxCert stakeCred refund -> - PV3.TxCertUnRegStaking (transCred stakeCred) (Just (transCoin refund)) + PV3.TxCertUnRegStaking (transCred stakeCred) (Just (coinToLovelace refund)) DelegTxCert stakeCred delegatee -> PV3.TxCertDelegStaking (transCred stakeCred) (transDelegatee delegatee) RegDepositDelegTxCert stakeCred delegatee deposit -> - PV3.TxCertRegDeleg (transCred stakeCred) (transDelegatee delegatee) (transCoin deposit) + PV3.TxCertRegDeleg (transCred stakeCred) (transDelegatee delegatee) (coinToLovelace deposit) AuthCommitteeHotKeyTxCert coldCred hotCred -> PV3.TxCertAuthHotCommittee (transColdCommitteeCred coldCred) (transHotCommitteeCred hotCred) ResignCommitteeColdTxCert coldCred _anchor -> PV3.TxCertResignColdCommittee (transColdCommitteeCred coldCred) RegDRepTxCert drepCred deposit _anchor -> - PV3.TxCertRegDRep (transDRepCred drepCred) (transCoin deposit) + PV3.TxCertRegDRep (transDRepCred drepCred) (coinToLovelace deposit) UnRegDRepTxCert drepCred refund -> - PV3.TxCertUnRegDRep (transDRepCred drepCred) (transCoin refund) + PV3.TxCertUnRegDRep (transDRepCred drepCred) (coinToLovelace refund) UpdateDRepTxCert drepCred _anchor -> PV3.TxCertUpdateDRep (transDRepCred drepCred) @@ -361,12 +361,14 @@ transScriptPurpose :: transScriptPurpose proxy = \case ConwaySpending (AsItem txIn) -> pure $ PV3.Spending (transTxIn txIn) ConwayMinting (AsItem policyId) -> pure $ PV3.Minting (Alonzo.transPolicyID policyId) - ConwayCertifying (AsItem txCert) -> PV3.Certifying <$> toPlutusTxCert proxy txCert + ConwayCertifying (AsItem txCert) -> + -- TODO: fix the index. Reqiures adding index to AsItem. + PV3.Certifying 0 <$> toPlutusTxCert proxy txCert ConwayRewarding (AsItem rewardAccount) -> pure $ PV3.Rewarding (transRewardAccount rewardAccount) - ConwayVoting (AsItem voter) -> - pure $ PV3.Voting (transVoter voter) undefined - ConwayProposing (AsItem _proposal) -> - pure $ PV3.Proposing $ error "Requires adjustment on the Plutus side and implementation of #3957" + ConwayVoting (AsItem voter) -> pure $ PV3.Voting (transVoter voter) + ConwayProposing (AsItem proposal) -> + -- TODO: fix the index. Reqiures adding index to AsItem. + pure $ PV3.Proposing 0 (transProposal proposal) transVoter :: Voter c -> PV3.Voter transVoter = \case @@ -396,7 +398,7 @@ transGovAction = \case transProposal :: ProposalProcedure era -> PV3.ProposalProcedure transProposal ProposalProcedure {pProcDeposit, pProcReturnAddr, pProcGovAction} = PV3.ProposalProcedure - { PV3.ppDeposit = transCoin pProcDeposit + { PV3.ppDeposit = coinToLovelace pProcDeposit , PV3.ppReturnAddr = transRewardAccount pProcReturnAddr , PV3.ppGovernanceAction = transGovAction pProcGovAction }