Skip to content

Commit

Permalink
Update libs/cardano-ledger-conformance/src/Test/Cardano/Ledger/Confor…
Browse files Browse the repository at this point in the history
…mance/ExecSpecRule/Core.hs

Co-authored-by: Alexey Kuleshevich <[email protected]>
  • Loading branch information
Soupstraw and lehins committed May 3, 2024
1 parent 51acd44 commit 5f10b6b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
34 changes: 17 additions & 17 deletions eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley/ImpTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ instance
Testable (ImpTestM era a)
where
property m = property . fmap ioProperty . runGenT $ do
res <- liftGen $ runImpTestGenM mkImpState m
res <- liftGen $ runImpTestGenM def m
liftIO $ fst <$> res

instance MonadWriter [SomeSTSEvent era] (ImpTestM era) where
Expand Down Expand Up @@ -1117,20 +1117,20 @@ logEntry e = impLogL %= (<> pretty loc <> "\t" <> pretty e <> line)
logToExpr :: (HasCallStack, ToExpr a) => a -> ImpTestM era ()
logToExpr e = logEntry (showExpr e)

mkImpState :: ShelleyEraImp era => ImpTestState era
mkImpState =
ImpTestState
{ impNES = initShelleyImpNES
, impRootTxIn = TxIn (mkTxId 0) minBound
, impKeyPairs = mempty
, impByronKeyPairs = mempty
, impNativeScripts = mempty
, impLastTick = 0
, impGlobals = testGlobals
, impLog = mempty
, impGen = mkQCGen 2024
, impEvents = mempty
}
instance ShelleyEraImp era => Default (ImpTestState era) where
def =
ImpTestState
{ impNES = initShelleyImpNES
, impRootTxIn = TxIn (mkTxId 0) minBound
, impKeyPairs = mempty
, impByronKeyPairs = mempty
, impNativeScripts = mempty
, impLastTick = 0
, impGlobals = testGlobals
, impLog = mempty
, impGen = mkQCGen 2024
, impEvents = mempty
}

withImpState ::
ShelleyEraImp era =>
Expand All @@ -1146,7 +1146,7 @@ withImpStateModified ::
Spec
withImpStateModified f =
beforeAll $
execImpTestM Nothing (f mkImpState) $
execImpTestM Nothing (f def) $
addRootTxOut >> initImpTestState
where
rootCoin = Coin 1_000_000_000
Expand All @@ -1155,7 +1155,7 @@ withImpStateModified f =
let rootAddr = Addr Testnet (KeyHashObj rootKeyHash) StakeRefNull
rootTxOut = mkBasicTxOut rootAddr $ inject rootCoin
impNESL . nesEsL . esLStateL . lsUTxOStateL . utxosUtxoL
%= (<> UTxO (Map.singleton (impRootTxIn @era mkImpState) rootTxOut))
%= (<> UTxO (Map.singleton (impRootTxIn @era def) rootTxOut))

-- | Creates a fresh @SafeHash@
freshSafeHash :: Era era => ImpTestM era (SafeHash (EraCrypto era) a)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ generatesWithin gen timeout =
. forAllShow gen showExpr
$ \x -> within timeout $ ioProperty (evaluateDeep x $> ())
where
aName = showsTypeRep (typeRep $ Proxy @a) ""
aName = show (typeRep $ Proxy @a)

computationResultToEither :: Agda.ComputationResult e a -> Either e a
computationResultToEither (Agda.Success x) = Right x
Expand Down

0 comments on commit 5f10b6b

Please sign in to comment.