Skip to content

Switch TxBody to a data family #4999

@lehins

Description

@lehins

One of the most important causes for a new era is any change to the body of a transaction. For this reason, it would make more sense for TxBody type family to be converted to a data family. It will give us injectivity out of the box and will allow us for creating general type class instances.

For example:

Instead of having a separate type:

newtype AlonzoTxBody era = MkAlonzoTxBody (MemoBytes (AlonzoTxBodyRaw era))

and instance definition:

type TxBody AlonzoEra = AlonzoTxBody AlonzoEra

We would get:

  newtype TxBody AlonzoEra = MkAlonzoTxBody (MemoBytes (AlonzoTxBodyRaw era))
    deriving (ToCBOR, Generic)
    deriving newtype (SafeToHash)

Metadata

Metadata

Assignees

Labels

💳 technical-debtIssues related to technical debt we introduced

Type

Projects

Status

Done

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions