File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
cardano-api/src/Cardano/Api Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,10 @@ singleton i o = UTxO $ Map.singleton i o
6767lookup :: TxIn -> UTxO era -> Maybe (TxOut CtxUTxO era )
6868lookup k = Map. lookup k . unUTxO
6969
70+ -- | Synonym for `lookup`.
71+ resolveTxIn :: TxIn -> UTxO era -> Maybe (TxOut CtxUTxO era )
72+ resolveTxIn = Cardano.Api.Internal.Tx.UTxO. lookup
73+
7074-- | Filter all `TxOut` that satisfy the predicate.
7175filter :: (TxOut CtxUTxO era -> Bool ) -> UTxO era -> UTxO era
7276filter fn = UTxO . Map. filter fn . unUTxO
@@ -95,6 +99,10 @@ fromList = UTxO . Map.fromList
9599toList :: UTxO era -> [(TxIn , TxOut CtxUTxO era )]
96100toList (UTxO xs) = Map. toList xs
97101
102+ -- | Convert to a Map of TxIn/TxOut.
103+ toMap :: UTxO era -> Map TxIn (TxOut CtxUTxO era )
104+ toMap = unUTxO
105+
98106-- | Convert from a `cardano-api` `UTxO` to a `cardano-ledger` UTxO.
99107toShelleyUTxO :: ShelleyBasedEra era -> UTxO era -> Ledger. UTxO (ShelleyLedgerEra era )
100108toShelleyUTxO sbe =
Original file line number Diff line number Diff line change @@ -3,13 +3,15 @@ module Cardano.Api.Tx.UTxO
33 , UTxO. empty
44 , UTxO. singleton
55 , UTxO. lookup
6+ , UTxO. resolveTxIn
67 , UTxO. filter
78 , UTxO. filterWithKey
89 , UTxO. inputSet
910 , UTxO. txOutputs
1011 , UTxO. difference
1112 , UTxO. fromList
1213 , UTxO. toList
14+ , UTxO. toMap
1315 , UTxO. fromShelleyUTxO
1416 , UTxO. toShelleyUTxO
1517 )
You can’t perform that action at this time.
0 commit comments