Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Soupstraw committed Feb 18, 2025
1 parent a6f276a commit c01f9e8
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions eras/conway/impl/src/Cardano/Ledger/Conway/TxInfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ import Cardano.Ledger.Plutus.TxInfo (
)
import qualified Cardano.Ledger.Plutus.TxInfo as TxInfo
import Cardano.Ledger.PoolParams
import qualified Cardano.Ledger.Shelley.HardForks as HF (bootstrapPhase)
import Cardano.Ledger.State (UTxO)
import Cardano.Ledger.TxIn (TxId (..), TxIn (..))
import Control.Arrow (ArrowChoice (..))
Expand Down Expand Up @@ -444,7 +443,7 @@ instance EraPlutusTxInfo 'PlutusV2 ConwayEra where
toPlutusArgs = Babbage.toPlutusV2Args

instance EraPlutusTxInfo 'PlutusV3 ConwayEra where
toPlutusTxCert _ pv = pure . transTxCert pv
toPlutusTxCert _ _ = pure . transTxCert

toPlutusScriptPurpose = transScriptPurpose

Expand Down Expand Up @@ -510,8 +509,8 @@ transTxBodyWithdrawals txBody =
-- was causing the deposit in `RegDepositTxCert` and `UnRegDepositTxCert` to be omitted.
-- We need to keep this behavior for version 9, so, now that the bug in the patterns has been fixed,
-- we are explicitly omitting the deposit in these cases.
transTxCert :: ConwayEraTxCert era => ProtVer -> TxCert era -> PV3.TxCert
transTxCert pv = \case
transTxCert :: ConwayEraTxCert era => TxCert era -> PV3.TxCert
transTxCert = \case
RegPoolTxCert PoolParams {ppId, ppVrf} ->
PV3.TxCertPoolRegister
(transKeyHash ppId)
Expand All @@ -523,15 +522,9 @@ transTxCert pv = \case
UnRegTxCert stakeCred ->
PV3.TxCertUnRegStaking (transCred stakeCred) Nothing
RegDepositTxCert stakeCred deposit ->
let transDeposit
| HF.bootstrapPhase pv = Nothing
| otherwise = Just (transCoinToLovelace deposit)
in PV3.TxCertRegStaking (transCred stakeCred) transDeposit
PV3.TxCertRegStaking (transCred stakeCred) (Just (transCoinToLovelace deposit))
UnRegDepositTxCert stakeCred refund ->
let transRefund
| HF.bootstrapPhase pv = Nothing
| otherwise = Just (transCoinToLovelace refund)
in PV3.TxCertUnRegStaking (transCred stakeCred) transRefund
PV3.TxCertUnRegStaking (transCred stakeCred) (Just (transCoinToLovelace refund))
DelegTxCert stakeCred delegatee ->
PV3.TxCertDelegStaking (transCred stakeCred) (transDelegatee delegatee)
RegDepositDelegTxCert stakeCred delegatee deposit ->
Expand Down

0 comments on commit c01f9e8

Please sign in to comment.