Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mint field translation bugfix #3566

Merged
merged 2 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions eras/alonzo/impl/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
`Plutus` type instead of a `Language` and `ShortByteString`
* Rename `pdSBS` field to `pdPlutusScript` in the `PlutusDebugLang` data type

## 1.3.3.0

* Export `transMintValue`

## 1.3.2.0

* Add implementation for `spendableInputsTxBodyL`
Expand Down
1 change: 1 addition & 0 deletions eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ module Cardano.Ledger.Alonzo.TxInfo (
transPolicyID,
transAssetName,
transMultiAsset,
transMintValue,
transValue,
transWithdrawals,
getWitVKeyHash,
Expand Down
6 changes: 5 additions & 1 deletion eras/babbage/impl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Version history for `cardano-ledger-babbage`

## 1.4.2.0
## 1.4.3.0

* Added `babbagePParamsHKDPairs`

## 1.4.2.0

* Fix `mint` field Plutus translation bug.

## 1.4.1.0

* Add implementation for `spendableInputsTxBodyL`
Expand Down
2 changes: 1 addition & 1 deletion eras/babbage/impl/cardano-ledger-babbage.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.0
name: cardano-ledger-babbage
version: 1.4.2.0
version: 1.4.3.0
license: Apache-2.0
maintainer: operations@iohk.io
author: IOHK
Expand Down
6 changes: 2 additions & 4 deletions eras/babbage/impl/src/Cardano/Ledger/Babbage/TxInfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ babbageTxInfoV1 timeRange tx utxo = do
{ PV1.txInfoInputs = inputs
, PV1.txInfoOutputs = outputs
, PV1.txInfoFee = Alonzo.transValue (inject @(MaryValue (EraCrypto era)) fee)
, PV1.txInfoMint = Alonzo.transMultiAsset multiAsset
, PV1.txInfoMint = Alonzo.transMintValue (txBody ^. mintTxBodyL)
, PV1.txInfoDCert = toList $ fmap (unTxCertV1 . Alonzo.transTxCert) (txBody ^. certsTxBodyL)
, PV1.txInfoWdrl = Map.toList (Alonzo.transWithdrawals (txBody ^. withdrawalsTxBodyL))
, PV1.txInfoValidRange = timeRange
Expand All @@ -247,7 +247,6 @@ babbageTxInfoV1 timeRange tx utxo = do
witnesses = tx ^. witsTxL
outs = txBody ^. outputsTxBodyL
fee = txBody ^. feeTxBodyL
multiAsset = txBody ^. mintTxBodyL
datpairs = Map.toList (unTxDats $ witnesses ^. datsTxWitsL)

babbageTxInfoV2 ::
Expand Down Expand Up @@ -278,7 +277,7 @@ babbageTxInfoV2 timeRange tx utxo = do
, PV2.txInfoOutputs = outputs
, PV2.txInfoReferenceInputs = refInputs
, PV2.txInfoFee = Alonzo.transValue (inject @(MaryValue (EraCrypto era)) fee)
, PV2.txInfoMint = Alonzo.transMultiAsset multiAsset
, PV2.txInfoMint = Alonzo.transMintValue (txBody ^. mintTxBodyL)
, PV2.txInfoDCert = toList $ fmap (unTxCertV2 . Alonzo.transTxCert) (txBody ^. certsTxBodyL)
, PV2.txInfoWdrl = PV2.fromList $ Map.toList (Alonzo.transWithdrawals (txBody ^. withdrawalsTxBodyL))
, PV2.txInfoValidRange = timeRange
Expand All @@ -293,6 +292,5 @@ babbageTxInfoV2 timeRange tx utxo = do
witnesses = tx ^. witsTxL
outs = txBody ^. outputsTxBodyL
fee = txBody ^. feeTxBodyL
multiAsset = txBody ^. mintTxBodyL
datpairs = Map.toList (unTxDats $ witnesses ^. datsTxWitsL)
rdmrs = Map.toList (unRedeemers $ witnesses ^. rdmrsTxWitsL)
5 changes: 3 additions & 2 deletions eras/conway/impl/src/Cardano/Ledger/Conway/TxInfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ conwayTxInfoV3 timeRange tx utxo = do
, PV3.txInfoOutputs = outputs
, PV3.txInfoReferenceInputs = refInputs
, PV3.txInfoFee = Alonzo.transValue (inject @(MaryValue (EraCrypto era)) fee)
, PV3.txInfoMint = Alonzo.transMultiAsset multiAsset
, -- Note that this translation is different from previous Plutus versions, sine we no
-- longer add a zero ADA value to the mint field during translation:
PV3.txInfoMint = Alonzo.transMultiAsset (txBody ^. mintTxBodyL)
, PV3.txInfoDCert = toList $ fmap (unTxCertV3 . Alonzo.transTxCert) (txBody ^. certsTxBodyL)
, PV3.txInfoWdrl = PV3.fromList $ Map.toList (Alonzo.transWithdrawals (txBody ^. withdrawalsTxBodyL))
, PV3.txInfoValidRange = timeRange
Expand All @@ -129,6 +131,5 @@ conwayTxInfoV3 timeRange tx utxo = do
witnesses = tx ^. witsTxL
outs = txBody ^. outputsTxBodyL
fee = txBody ^. feeTxBodyL
multiAsset = txBody ^. mintTxBodyL
datpairs = Map.toList (unTxDats $ witnesses ^. datsTxWitsL)
rdmrs = Map.toList (unRedeemers $ witnesses ^. rdmrsTxWitsL)