Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Tx era = Tx {}
- addrPtrNormalize ∷ Addr → Addr
- translateDatum ∷ Datum era1 → Datum era2
Documentation
Instances
TranslateEra ConwayEra Tx Source # | |
Defined in Cardano.Ledger.Conway.Translation type TranslationError ConwayEra Tx Source # | |
type TranslationError ConwayEra Tx Source # | |
Defined in Cardano.Ledger.Conway.Translation |
addrPtrNormalize ∷ Addr → Addr Source #
This function is implemented solely for the purpose of translating garbage pointers
into knowingly invalid ones. Any pointer that contains a SlotNo, TxIx or CertIx that
is too large to fit into Word32, Word16 and Word16 respectively, will have all of its
values set to 0 using normalizePtr
.
There are two reasons why we can safely do that at the Babbage/Conway era boundary:
- Invalid pointers are no longer allowed in transactions starting with Babbage era
- There are only a handful of
Ptr
s on mainnet that are invalid.
Once the transition is complete and we are officially in Conway era, this translation logic can be removed in favor of a fixed deserializer that does the same thing for all eras prior to Babbage.
translateDatum ∷ Datum era1 → Datum era2 Source #