Skip to content

Commit 870822c

Browse files
committed
source references for TxIns and PolicyIds ordering
1 parent 9d4da96 commit 870822c

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/BotPlutusInterface/Estimate.hs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,23 @@ mkBudgetMaps exUnitsMap txBody = do
136136
mkInputsIndex =
137137
Map.fromList
138138
. zip [0 ..]
139-
-- This relies on the TxId Ord instance being consistent with the
140-
-- Ledger.TxId Ord instance via the toShelleyTxId conversion
141-
-- This is checked by prop_ord_distributive_TxId
139+
{- This relies on the TxId Ord instance being consistent with the
140+
Ledger.TxId Ord instance via the toShelleyTxId conversion
141+
This is checked by prop_ord_distributive_TxId
142+
reference:
143+
https://github.com/input-output-hk/cardano-node/blob/e31455eaeca98530ce561b79687a8e465ebb3fdd/cardano-api/src/Cardano/Api/TxBody.hs#L2887
144+
-}
142145
. sort
143-
. map fst
146+
. map fst -- get only `TxIn`'s from `TxIns` (which is list of tuples)
144147
. CAPI.txIns
145148

146149
mkPoliciesIndex txbc =
147150
case CAPI.txMintValue txbc of
148151
CAPI.TxMintValue _ value _ ->
149-
-- The minting policies are indexed in policy id order in the value -- TODO: link to source
152+
{- The minting policies are indexed in policy id order in the value
153+
reference:
154+
https://github.com/input-output-hk/cardano-node/blob/e31455eaeca98530ce561b79687a8e465ebb3fdd/cardano-api/src/Cardano/Api/TxBody.hs#L2851
155+
-}
150156
let CAPI.ValueNestedRep bundle = CAPI.valueToNestedRep value
151157
in Map.fromList
152158
[ (ix, policyId)

0 commit comments

Comments
 (0)