Closed bladyjoker closed 2 months ago
Will add these
lookupUTxO' :: TxOutRef -> LedgerSim ctx st e (Maybe TxInInfo)
mustLookupUTxO :: TxOutRef -> LedgerSim ctx st e TxOut
mustLookupUTxO' :: TxOutRef -> LedgerSim ctx st e TxInInfo
mkLedgerState :: [TxInInfo] -> LedgerState
I understand the need to not duplicate information as currently the
Map TxOutRef TxOut
has the necessary information to reconstruct a[TxInInfo]
.However, the use sites suffer for it as much revolves around
[TxInInfo]
and then theindexUTxOs :: [TxInInfo] -> Map TxOutRef TxInInfo
is a convenient and natural function to use throughout.Rule of thumb when considering various maps that are but one possible index into some collection is the following
index :: (a -> k) -> [a] -> Map k a
.I understand it's sometimes (not generally) redundant to keep the entire
a
in the map, but keeping it makes further data analysis/pivoting pipelines work much easier as it doesn't require the user to understand how to reconstructa
values.