Skip to content

Commit 4b2c195

Browse files
authored
Merge pull request #4831 from IntersectMBO/lehins/cleanup-pointer-serialization
Cleanup pointer serialization
2 parents 7573580 + fd2fa12 commit 4b2c195

File tree

42 files changed

+200
-253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+200
-253
lines changed

eras/allegra/impl/cddl-files/allegra.cddl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ transaction_body = {0 : set<transaction_input>
237237

238238
transaction_index = uint .size 2
239239

240-
transaction_input = [transaction_id : $hash32, index : uint]
240+
transaction_input = [transaction_id : $hash32, index : uint .size 2]
241241

242242
transaction_metadatum = {* transaction_metadatum => transaction_metadatum}
243243
/ [* transaction_metadatum]

eras/alonzo/impl/cddl-files/alonzo.cddl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ transaction_body = {0 : set<transaction_input>
426426

427427
transaction_index = uint .size 2
428428

429-
transaction_input = [transaction_id : $hash32, index : uint]
429+
transaction_input = [transaction_id : $hash32, index : uint .size 2]
430430

431431
transaction_metadatum = {* transaction_metadatum => transaction_metadatum}
432432
/ [* transaction_metadatum]
-179 KB
Binary file not shown.

eras/babbage/impl/cddl-files/babbage.cddl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ transaction_body = {0 : set<transaction_input>
443443

444444
transaction_index = uint .size 2
445445

446-
transaction_input = [transaction_id : $hash32, index : uint]
446+
transaction_input = [transaction_id : $hash32, index : uint .size 2]
447447

448448
transaction_metadatum = {* transaction_metadatum => transaction_metadatum}
449449
/ [* transaction_metadatum]
-322 KB
Binary file not shown.

eras/babbage/impl/src/Cardano/Ledger/Babbage/Collateral.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import Cardano.Ledger.UTxO (UTxO (..), coinBalance)
2222
import Cardano.Ledger.Val ((<->))
2323
import qualified Data.Map.Strict as Map
2424
import Data.Maybe.Strict (StrictMaybe (..))
25-
import Data.Word (Word16, Word64)
25+
import Data.Word (Word16)
2626
import Lens.Micro
2727

2828
-- ============================================================
@@ -54,4 +54,4 @@ collOuts txBody =
5454
-- In the impossible event that there are more transaction outputs
5555
-- in the transaction than will fit into a Word16 (which backs the TxIx),
5656
-- we give the collateral return output an index of maxBound.
57-
Nothing -> TxIx ((fromIntegral :: Word16 -> Word64) (maxBound :: Word16))
57+
Nothing -> TxIx (maxBound :: Word16)

eras/babbage/impl/src/Cardano/Ledger/Babbage/TxOut.hs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ import Cardano.Ledger.Address (
4646
CompactAddr,
4747
compactAddr,
4848
decompactAddr,
49-
fromCborBackwardsBothAddr,
5049
fromCborBothAddr,
50+
fromCborRigorousBothAddr,
5151
)
5252
import Cardano.Ledger.Alonzo.Core
5353
import Cardano.Ledger.Alonzo.TxBody (
@@ -463,10 +463,7 @@ instance (EraScript era, Val (Value era)) => DecCBOR (BabbageTxOut era) where
463463
instance (EraScript era, Val (Value era)) => DecShareCBOR (BabbageTxOut era) where
464464
type Share (BabbageTxOut era) = Interns (Credential 'Staking)
465465
decShareCBOR credsInterns =
466-
-- Even in Babbage the ledger state still contains garbage pointers that we need to
467-
-- deal with. This will be taken care of upon entry to Conway era. After which this
468-
-- backwards compatibility shim can be removed.
469-
internBabbageTxOut (interns credsInterns) <$!> decodeBabbageTxOut fromCborBackwardsBothAddr
466+
internBabbageTxOut (interns credsInterns) <$!> decodeBabbageTxOut fromCborRigorousBothAddr
470467
{-# INLINEABLE decShareCBOR #-}
471468

472469
internBabbageTxOut ::

eras/babbage/impl/test/GenerateGoldenFileMain.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ import Test.Cardano.Ledger.Babbage.Translation.TranslatableGen ()
88

99
-- | Generates golden translation file for Babbage era
1010
main :: IO ()
11-
main = generateGoldenFile @BabbageEra "eras/babbage/test-suite/golden/translations.cbor"
11+
main = generateGoldenFile @BabbageEra "eras/babbage/impl/golden/translations.cbor"

eras/conway/impl/cardano-ledger-conway.cabal

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ test-suite tests
261261
cardano-ledger-alonzo,
262262
cardano-ledger-alonzo:testlib,
263263
cardano-ledger-babbage,
264-
cardano-ledger-binary,
265264
cardano-ledger-binary:testlib,
266265
cardano-ledger-conway,
267266
cardano-ledger-core,

eras/conway/impl/src/Cardano/Ledger/Conway/TxOut.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
module Cardano.Ledger.Conway.TxOut () where
1313

14-
import Cardano.Ledger.Address (addrPtrNormalize)
1514
import Cardano.Ledger.Babbage.Core
1615
import Cardano.Ledger.Babbage.TxOut (
1716
BabbageTxOut (..),
@@ -37,7 +36,7 @@ instance EraTxOut ConwayEra where
3736
mkBasicTxOut addr vl = BabbageTxOut addr vl NoDatum SNothing
3837

3938
upgradeTxOut (BabbageTxOut addr value d s) =
40-
BabbageTxOut (addrPtrNormalize addr) value (translateDatum d) (upgradeScript <$> s)
39+
BabbageTxOut addr value (translateDatum d) (upgradeScript <$> s)
4140

4241
addrEitherTxOutL = addrEitherBabbageTxOutL
4342
{-# INLINE addrEitherTxOutL #-}

0 commit comments

Comments
 (0)