Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
The UTxO is large and is kept in-memory. It is important to use as small a representation as possible to keep overall memory use reasonable.
This module provides a special compact representation for data types contained within the UTxO.
The idea here is that the compact representation is optimised only for storage size and does not have to be the same as the representation used when operating on the data. Conversion functions are to be used when inserting and retrieving values from the UTxO.
Synopsis
- data CompactTxIn = CompactTxInUtxo !CompactTxId !Word16
- toCompactTxIn ∷ TxIn → CompactTxIn
- fromCompactTxIn ∷ CompactTxIn → TxIn
- data CompactTxId
- toCompactTxId ∷ TxId → CompactTxId
- fromCompactTxId ∷ CompactTxId → TxId
- data CompactTxOut = CompactTxOut !CompactAddress !Lovelace
- toCompactTxOut ∷ TxOut → CompactTxOut
- fromCompactTxOut ∷ CompactTxOut → TxOut
Documentation
data CompactTxIn Source #
A compact in-memory representation for a TxIn
.
Convert using toCompactTxIn
and fromCompactTxIn
.
Instances
data CompactTxId Source #
A compact in-memory representation for a TxId
.
Convert using toCompactTxId
and fromCompactTxId
.
Compared to a normal TxId
, this takes 5 heap words rather than 12.
Instances
data CompactTxOut Source #
A compact in-memory representation for a TxOut
.
Convert using toCompactTxOut
and fromCompactTxOut
.