Skip to content

Commit 3df7fe5

Browse files
committed
Reapply review suggestions
1 parent b68ef5c commit 3df7fe5

File tree

6 files changed

+10
-11
lines changed

6 files changed

+10
-11
lines changed

eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/ImpTest.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ fixupDatums tx = impAnn "fixupDatums" $ do
287287
getData txOut =
288288
let sh = txOutScriptHash txOut
289289
in case txOut ^. datumTxOutF of
290-
DatumHash _dh -> case Map.lookup sh (scriptTestContexts @era) of
291-
Just x -> pure . Just $ spendDatum x
292-
Nothing -> do
290+
DatumHash dh -> case Map.lookup sh (scriptTestContexts @era) of
291+
Just x | hashData @era (spendDatum x) == dh -> pure . Just $ spendDatum x
292+
_ -> do
293293
logText $
294294
"Script not found in `scriptTestContexts`:\n"
295295
<> T.pack (show sh)

eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxo.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,9 @@ disjointRefInputs ::
232232
Test (BabbageUtxoPredFailure era)
233233
disjointRefInputs pp inputs refInputs =
234234
when
235-
(pvMajor (pp ^. ppProtocolVersionL) == natVersion @10)
235+
( pvMajor (pp ^. ppProtocolVersionL) > eraProtVerHigh @BabbageEra
236+
&& pvMajor (pp ^. ppProtocolVersionL) < natVersion @11
237+
)
236238
(failureOnNonEmpty common BabbageNonDisjointRefInputs)
237239
where
238240
common = inputs `Set.intersection` refInputs

eras/babbage/impl/testlib/Test/Cardano/Ledger/Babbage/Imp/UtxoSpec.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ spec = describe "UTXO" $ do
4949
txOut =
5050
mkBasicTxOut
5151
( mkAddr
52-
(ScriptHashObj @'Payment $ hashPlutusScript (inputsOverlapsWithRefInputs SPlutusV2))
52+
(hashPlutusScript (inputsOverlapsWithRefInputs SPlutusV2))
5353
StakeRefNull
5454
)
5555
(inject $ Coin 1_000_000)
56-
& datumTxOutL .~ (Datum . dataToBinaryData . Data . PV1.I $ 0)
56+
& datumTxOutL .~ Datum (dataToBinaryData . Data $ PV1.I 0)
5757
tx <-
5858
submitTx $
5959
mkBasicTx mkBasicTxBody

eras/conway/impl/src/Cardano/Ledger/Conway/TxInfo.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ data ConwayContextError era
166166
| VotingProceduresFieldNotSupported !(VotingProcedures era)
167167
| ProposalProceduresFieldNotSupported !(OSet.OSet (ProposalProcedure era))
168168
| TreasuryDonationFieldNotSupported !Coin
169-
| ReferenceInputsNotDisjointFromInputs !(Set.Set TxIn)
169+
| ReferenceInputsNotDisjointFromInputs !(NonEmpty TxIn)
170170
deriving (Generic)
171171

172172
deriving instance

eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ spec ::
9090
, ToExpr (Event (EraRule "ENACT" era))
9191
, Eq (Event (EraRule "ENACT" era))
9292
, Typeable (Event (EraRule "ENACT" era))
93-
, ContextError era ~ ConwayContextError era
9493
) =>
9594
Spec
9695
spec = do
@@ -126,7 +125,6 @@ conwaySpec ::
126125
, ToExpr (Event (EraRule "ENACT" era))
127126
, Eq (Event (EraRule "ENACT" era))
128127
, Typeable (Event (EraRule "ENACT" era))
129-
, ContextError era ~ ConwayContextError era
130128
) =>
131129
SpecWith (ImpInit (LedgerSpec era))
132130
conwaySpec = do

eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/UtxoSpec.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ spec ::
5858
( ConwayEraImp era
5959
, InjectRuleFailure "LEDGER" BabbageUtxoPredFailure era
6060
, InjectRuleFailure "LEDGER" AlonzoUtxosPredFailure era
61-
, ContextError era ~ ConwayContextError era
6261
) =>
6362
SpecWith (ImpInit (LedgerSpec era))
6463
spec =
@@ -110,7 +109,7 @@ spec =
110109
(tx txIn)
111110
[ injectFailure $
112111
CollectErrors
113-
[ BadTranslation
112+
[ inject
114113
( ReferenceInputsNotDisjointFromInputs
115114
(Set.singleton txIn)
116115
)

0 commit comments

Comments
 (0)