@@ -80,6 +80,7 @@ import Control.State.Transition.Extended (
8080 STS (.. ),
8181 TRC (.. ),
8282 TransitionRule ,
83+ failureOnNonEmpty ,
8384 judgmentContext ,
8485 liftSTS ,
8586 trans ,
@@ -115,7 +116,7 @@ data BabbageUtxoPredFailure era
115116 ! [(TxOut era , Coin )]
116117 | -- | TxIns that appear in both inputs and reference inputs
117118 BabbageNonDisjointRefInputs
118- ! (Set (TxIn (EraCrypto era )))
119+ ! (NonEmpty (TxIn (EraCrypto era )))
119120 deriving (Generic )
120121
121122deriving instance
@@ -202,6 +203,7 @@ feesOK pp tx (UTxO utxo) =
202203 validateTotalCollateral pp txBody utxoCollateral
203204 ]
204205
206+ -- | Test that inputs and refInpts are disjoint, in Conway and later Eras.
205207disjointRefInputs ::
206208 forall era .
207209 EraPParams era =>
@@ -212,7 +214,7 @@ disjointRefInputs ::
212214disjointRefInputs pp inputs refInputs =
213215 when
214216 (pvMajor (pp ^. ppProtocolVersionL) > eraProtVerHigh @ (BabbageEra (EraCrypto era )))
215- (failureIf ( null common) ( BabbageNonDisjointRefInputs common) )
217+ (failureOnNonEmpty common BabbageNonDisjointRefInputs )
216218 where
217219 common = inputs `Set.intersection` refInputs
218220
@@ -348,7 +350,7 @@ utxoTransition = do
348350 inputs = txBody ^. inputsTxBodyL
349351
350352 {- inputs ∩ refInputs = ∅ -}
351- runTest $ disjointRefInputs @ era pp inputs refInputs
353+ runTest $ disjointRefInputs pp inputs refInputs
352354
353355 {- ininterval slot (txvld txb) -}
354356 runTest $ Allegra. validateOutsideValidityIntervalUTxO slot txBody
0 commit comments