Skip to content

Commit

Permalink
Added module Test.Cardano.Ledger.Constrained.Trace.TraceMonad. (#3709)
Browse files Browse the repository at this point in the history
Includes an example of making a simple Tx's with 1 input and output.
Added 'actions' that update the Env in the TraceM monad for inputs, outputs and fees.
Added Tests that such Tx's pass the applySTS and that the 'actions' compute the same state.
Added Tests that traces of length 100, are real traces and lead to valid states.
Added Stage.hs, to break up large constraint lists into reusable pieces
Added RootTarget, extends Target to make some Targets invertable. RootTargets for NewEpochState and down.
Added Profile improvements, use HashSet(Name era) rather than Set(Name era)
Parameterized the Preds directory files by UnivSize, so on can control the size of the universes.
Added the Gadt Rule, and sts :: Proof era -> Rule tag -> ...
Added all the Constrained sub directory tests to the Tests in cardano-ledger-test
  • Loading branch information
TimSheard authored Sep 13, 2023
1 parent abb70fd commit 46be183
Show file tree
Hide file tree
Showing 36 changed files with 3,105 additions and 985 deletions.
3 changes: 1 addition & 2 deletions eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules/Utxo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,7 @@ validateValueNotConservedUTxO ::
TxBody era ->
Test (ShelleyUtxoPredFailure era)
validateValueNotConservedUTxO pp utxo dpstate txb =
failureUnless (consumedValue == producedValue) $
(ValueNotConservedUTxO consumedValue producedValue)
failureUnless (consumedValue == producedValue) $ ValueNotConservedUTxO consumedValue producedValue
where
consumedValue = consumed pp dpstate utxo txb
producedValue = produced pp dpstate txb
Expand Down
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@
# specific enough, or doesn't allow setting these.
modules = [
({pkgs, ...}: {
# packages.plutus-core.components.library.ghcOptions = [ "-fexternal-interpreter" ];
# uncomment when profiling
packages.byron-spec-chain.configureFlags = ["--ghc-option=-Werror"];
packages.byron-spec-ledger.configureFlags = ["--ghc-option=-Werror"];
packages.delegation.configureFlags = ["--ghc-option=-Werror"];
Expand Down
8 changes: 8 additions & 0 deletions libs/cardano-ledger-test/cardano-ledger-test.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ library
Test.Cardano.Ledger.Constrained.Lenses
Test.Cardano.Ledger.Constrained.Monad
Test.Cardano.Ledger.Constrained.Pairing
Test.Cardano.Ledger.Constrained.Stage
Test.Cardano.Ledger.Constrained.Preds.PParams
Test.Cardano.Ledger.Constrained.Preds.Universes
Test.Cardano.Ledger.Constrained.Preds.TxOut
Expand All @@ -34,6 +35,11 @@ library
Test.Cardano.Ledger.Constrained.Preds.Repl
Test.Cardano.Ledger.Constrained.Preds.Certs
Test.Cardano.Ledger.Constrained.Preds.LedgerState
Test.Cardano.Ledger.Constrained.Trace.TraceMonad
Test.Cardano.Ledger.Constrained.Trace.SimpleTx
Test.Cardano.Ledger.Constrained.Trace.Actions
Test.Cardano.Ledger.Constrained.Trace.Pipeline
Test.Cardano.Ledger.Constrained.Trace.Tests
Test.Cardano.Ledger.Constrained.Spec
Test.Cardano.Ledger.Constrained.SpecClass
Test.Cardano.Ledger.Constrained.Tests
Expand Down Expand Up @@ -110,6 +116,7 @@ library
formatting,
groups,
haskeline,
hashable,
vector-map,
data-default-class,
microlens,
Expand All @@ -130,6 +137,7 @@ library
text,
time,
transformers,
unordered-containers,
vector

test-suite cardano-ledger-test
Expand Down
Loading

0 comments on commit 46be183

Please sign in to comment.