Skip to content

Commit 78f8d9b

Browse files
author
Daniel Firth
committed
Cardano.Api.Tx.UTxO: add txOutputs function
1 parent 457b7eb commit 78f8d9b

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

cardano-api/src/Cardano/Api/Internal/Tx/UTxO.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ filterWithKey fn = UTxO . Map.filterWithKey fn . unUTxO
7474
inputSet :: UTxO era -> Set TxIn
7575
inputSet = Map.keysSet . unUTxO
7676

77+
-- | Get the UTxO output set.
78+
txOutputs :: UTxO era -> [TxOut CtxUTxO era]
79+
txOutputs = Map.elems . unUTxO
80+
7781
-- | Remove the right hand side from the left hand side.
7882
difference :: UTxO era -> UTxO era -> UTxO era
7983
difference a b = UTxO $ Map.difference (unUTxO a) (unUTxO b)

cardano-api/src/Cardano/Api/Tx/UTxO.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module Cardano.Api.Tx.UTxO
66
, UTxO.filter
77
, UTxO.filterWithKey
88
, UTxO.inputSet
9+
, UTxO.txOutputs
910
, UTxO.difference
1011
, UTxO.fromList
1112
, UTxO.toList

0 commit comments

Comments
 (0)