diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..0fe5694 --- /dev/null +++ b/.envrc @@ -0,0 +1,6 @@ +# https://github.com/nix-community/nix-direnv A fast, persistent use_nix/use_flake implementation for direnv: +if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8=" +fi +# https://github.com/input-output-hk/devx Slightly opinionated shared GitHub Action for Cardano-Haskell projects +use flake "github:input-output-hk/devx?rev=2f4fa7f42aa1184ce1ed03f468f60648c466fa84#ghc96-iog" diff --git a/.gitignore b/.gitignore index 037125f..e61e558 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ cabal.project.local~ .ghc.environment.* devnet/db haddocks +.direnv/ diff --git a/cabal.project b/cabal.project index 6a63a2e..fc1b785 100644 --- a/cabal.project +++ b/cabal.project @@ -11,21 +11,26 @@ repository cardano-haskell-packages d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee index-state: - , hackage.haskell.org 2023-12-24T05:49:51Z - , cardano-haskell-packages 2023-12-24T05:54:15Z - -source-repository-package - type: git - location: https://github.com/geniusyield/plutus-simple-model - tag: 0cb63af903a835c73aec662092eb67d228bba9b0 - --sha256: sha256-H56EyRFNdDvLDo9FVeGZyQZ92itQPG39TkMVyEC/xqM= - subdir: - cardano-simple - psm + , hackage.haskell.org 2024-02-06T15:25:20Z + , cardano-haskell-packages 2024-02-06T16:14:24Z tests: true allow-newer: - cardano-ledger-shelley-ma:base + cardano-ledger-shelley-ma:base, + ouroboros-consensus-cardano:base, + +-- This is needed since prettyprinting stuff was moved to +-- cardano-ledger-test library which is no longer a subject +-- to be published on CHaP. +-- See discussion in https://github.com/IntersectMBO/cardano-ledger/pull/3973 +source-repository-package + type: git + location: https://github.com/IntersectMBO/cardano-ledger + tag: 6e2d37cc0f47bd02e89b4ce9f78b59c35c958e96 + subdir: + libs/cardano-ledger-test -packages: . +packages: + . + ../clb diff --git a/cabal.project.freeze b/cabal.project.freeze new file mode 100644 index 0000000..3418c32 --- /dev/null +++ b/cabal.project.freeze @@ -0,0 +1,541 @@ +active-repositories: hackage.haskell.org:merge, cardano-haskell-packages:merge +constraints: any.Cabal ==3.10.1.0, + any.Cabal-syntax ==3.10.1.0, + any.Diff ==0.5, + any.FailT ==0.1.2.0, + any.Glob ==0.10.2, + any.HUnit ==1.6.2.0, + any.MemoTrie ==0.6.11, + MemoTrie -examples, + any.MonadRandom ==0.6, + any.OneTuple ==0.4.1.1, + any.Only ==0.1, + any.PyF ==0.11.2.1, + PyF -python_test, + any.QuickCheck ==2.14.3, + QuickCheck -old-random +templatehaskell, + any.StateVar ==1.2.2, + any.Stream ==0.4.7.2, + any.Unique ==0.4.7.9, + any.Win32-network ==0.1.1.1, + Win32-network -demo, + any.adjunctions ==4.4.2, + any.aeson ==2.2.1.0, + aeson +ordered-keymap, + any.aeson-pretty ==0.8.10, + aeson-pretty -lib-only, + any.algebraic-graphs ==0.7, + any.ansi-terminal ==1.0.2, + ansi-terminal -example, + any.ansi-terminal-types ==0.11.5, + any.ansi-wl-pprint ==0.6.9, + ansi-wl-pprint -example, + any.appar ==0.1.8, + any.array ==0.5.5.0, + any.asn1-encoding ==0.9.6, + any.asn1-parse ==0.9.5, + any.asn1-types ==0.3.4, + any.assoc ==1.1, + assoc +tagged, + any.async ==2.2.5, + async -bench, + any.attoparsec ==0.14.4, + attoparsec -developer, + any.attoparsec-aeson ==2.2.0.1, + any.auto-update ==0.1.6, + any.barbies ==2.1.1.0, + any.base ==4.18.1.0, + any.base-compat ==0.13.1, + any.base-compat-batteries ==0.13.1, + any.base-deriving-via ==0.1.0.2, + any.base-orphans ==0.9.1, + any.base16-bytestring ==1.0.2.0, + any.base58-bytestring ==0.1.0, + any.base64-bytestring ==1.2.1.0, + any.base64-bytestring-type ==1.0.1, + base64-bytestring-type +cereal +http-api-data +serialise, + any.basement ==0.0.16, + any.bech32 ==1.1.4.1, + bech32 -release -static, + any.bifunctors ==5.6.1, + bifunctors +tagged, + any.bimap ==0.5.0, + any.bin ==0.1.3, + any.binary ==0.8.9.1, + any.binary-orphans ==1.0.4.1, + any.bitvec ==1.1.5.0, + bitvec +simd, + any.blaze-builder ==0.4.2.3, + any.boring ==0.2.1, + boring +tagged, + any.brick ==2.3.1, + brick -demos, + any.byron-spec-chain ==1.0.0.2, + any.byron-spec-ledger ==1.0.0.2, + any.byteorder ==1.0.4, + any.bytestring ==0.11.5.2, + any.bytestring-builder ==0.10.8.2.0, + bytestring-builder +bytestring_has_builder, + any.bytestring-strict-builder ==0.4.5.7, + any.cabal-doctest ==1.0.9, + any.call-stack ==0.4.0, + any.canonical-json ==0.6.0.1, + any.cardano-api ==8.38.0.0, + any.cardano-binary ==1.7.1.0, + any.cardano-crypto ==1.1.2, + cardano-crypto -golden-tests -golden-tests-exe, + any.cardano-crypto-class ==2.1.4.0, + cardano-crypto-class +secp256k1-support, + any.cardano-crypto-praos ==2.1.2.0, + cardano-crypto-praos -external-libsodium-vrf, + any.cardano-crypto-test ==1.5.0.1, + any.cardano-crypto-tests ==2.1.2.0, + cardano-crypto-tests +secp256k1-support, + any.cardano-crypto-wrapper ==1.5.1.1, + any.cardano-data ==1.2.0.0, + any.cardano-git-rev ==0.1.3.0, + any.cardano-ledger-allegra ==1.3.0.0, + any.cardano-ledger-alonzo ==1.6.0.0, + any.cardano-ledger-alonzo-test ==1.2.0.0, + any.cardano-ledger-api ==1.8.0.0, + any.cardano-ledger-babbage ==1.6.0.0, + any.cardano-ledger-babbage-test ==1.2.0.0, + any.cardano-ledger-binary ==1.3.0.0, + any.cardano-ledger-byron ==1.0.0.4, + cardano-ledger-byron -test-normal-form, + any.cardano-ledger-byron-test ==1.5.0.1, + any.cardano-ledger-conway ==1.12.0.0, + cardano-ledger-conway -asserts, + any.cardano-ledger-conway-test ==1.2.1.3, + any.cardano-ledger-core ==1.10.0.0, + cardano-ledger-core -asserts, + any.cardano-ledger-mary ==1.5.0.0, + cardano-ledger-mary -asserts, + any.cardano-ledger-shelley ==1.9.0.0, + cardano-ledger-shelley -asserts, + any.cardano-ledger-shelley-ma-test ==1.2.1.6, + any.cardano-ledger-shelley-test ==1.3.0.1, + any.cardano-ledger-test ==9.9.9.9, + any.cardano-prelude ==0.1.0.4, + cardano-prelude -development, + any.cardano-prelude-test ==0.1.0.2, + cardano-prelude-test -development, + any.cardano-protocol-tpraos ==1.1.0.0, + any.cardano-slotting ==0.1.2.0, + any.cardano-strict-containers ==0.1.2.1, + any.case-insensitive ==1.2.1.0, + any.cassava ==0.5.3.0, + cassava -bytestring--lt-0_10_4, + any.cborg ==0.2.10.0, + cborg +optimize-gmp, + cem-script +dev, + any.cereal ==0.5.8.3, + cereal -bytestring-builder, + any.charset ==0.3.10, + clb -force-recomp, + any.clock ==0.8.4, + clock -llvm, + any.cmdargs ==0.10.22, + cmdargs +quotation -testprog, + any.code-page ==0.2.1, + any.colour ==2.3.6, + any.comonad ==5.0.8, + comonad +containers +distributive +indexed-traversable, + any.composition-prelude ==3.0.0.2, + composition-prelude -development, + any.concurrent-output ==1.10.20, + any.conduit ==1.3.5, + any.conduit-extra ==1.3.6, + any.config-ini ==0.2.7.0, + config-ini -enable-doctests, + any.constraints ==0.14, + any.constraints-extras ==0.4.0.0, + constraints-extras +build-readme, + any.containers ==0.6.7, + any.contra-tracer ==0.1.0.2, + any.contravariant ==1.5.5, + contravariant +semigroups +statevar +tagged, + any.cookie ==0.4.6, + any.criterion ==1.6.3.0, + criterion -embed-data-files -fast, + any.criterion-measurement ==0.2.1.0, + criterion-measurement -fast, + any.crypton ==0.34, + crypton -check_alignment +integer-gmp -old_toolchain_inliner +support_aesni +support_deepseq +support_pclmuldq +support_rdrand -support_sse +use_target_attributes, + any.crypton-connection ==0.3.2, + any.crypton-x509 ==1.7.6, + any.crypton-x509-store ==1.6.9, + any.crypton-x509-system ==1.6.7, + any.crypton-x509-validation ==1.6.12, + any.cryptonite ==0.30, + cryptonite -check_alignment +integer-gmp -old_toolchain_inliner +support_aesni +support_deepseq -support_pclmuldq +support_rdrand -support_sse +use_target_attributes, + any.data-clist ==0.2, + any.data-default ==0.7.1.1, + any.data-default-class ==0.1.2.0, + any.data-default-instances-containers ==0.0.1, + any.data-default-instances-dlist ==0.0.1, + any.data-default-instances-old-locale ==0.0.1, + any.data-fix ==0.3.2, + any.dec ==0.0.5, + any.deepseq ==1.4.8.1, + any.deferred-folds ==0.9.18.6, + any.dense-linear-algebra ==0.1.0.0, + any.dependent-map ==0.4.0.0, + any.dependent-sum ==0.7.2.0, + any.deque ==0.4.4.1, + any.deriving-aeson ==0.2.9, + any.deriving-compat ==0.6.5, + deriving-compat +base-4-9 +new-functor-classes +template-haskell-2-11, + any.dictionary-sharing ==0.1.0.0, + any.digest ==0.0.2.0, + digest -have_arm64_crc32c -have_builtin_prefetch -have_mm_prefetch -have_sse42 -have_strong_getauxval -have_weak_getauxval +pkg-config, + any.directory ==1.3.8.1, + any.distributive ==0.6.2.1, + distributive +semigroups +tagged, + any.dlist ==1.0, + dlist -werror, + any.dns ==4.2.0, + any.doctest ==0.22.2, + any.dom-lt ==0.2.3, + any.double-conversion ==2.0.4.2, + double-conversion -developer +embedded_double_conversion, + any.either ==5.0.2, + any.erf ==2.0.0.0, + any.errors ==2.3.0, + any.exceptions ==0.10.7, + any.extra ==1.7.14, + any.fgl ==5.8.2.0, + fgl +containers042, + any.file-embed ==0.0.16.0, + any.filelock ==0.1.1.7, + any.filepath ==1.4.100.4, + any.fin ==0.3, + any.fingertree ==0.1.5.0, + any.flat ==0.6, + any.foldl ==1.4.15, + any.formatting ==7.2.0, + formatting -no-double-conversion, + any.foundation ==0.0.30, + foundation -bench-all -bounds-check -doctest -experimental -linktest -minimal-deps, + any.free ==5.2, + any.fs-api ==0.2.0.1, + any.fs-sim ==0.2.1.1, + any.generic-random ==1.5.0.1, + generic-random -enable-inspect, + any.generically ==0.1.1, + any.generics-sop ==0.5.1.4, + any.genvalidity ==1.1.0.0, + any.ghc ==9.6.3, + any.ghc-bignum ==1.3, + any.ghc-boot ==9.6.3, + any.ghc-boot-th ==9.6.3, + any.ghc-heap ==9.6.3, + any.ghc-paths ==0.1.0.12, + any.ghc-prim ==0.10.0, + any.ghci ==9.6.3, + any.githash ==0.1.7.0, + any.graphviz ==2999.20.2.0, + graphviz -test-parsing, + any.groups ==0.5.3, + any.half ==0.3.1, + any.happy ==1.20.1.1, + any.hashable ==1.4.3.0, + hashable +integer-gmp -random-initial-seed, + any.haskeline ==0.8.2.1, + any.haskell-lexer ==1.1.1, + any.heapwords ==0.1.0.2, + any.hedgehog ==1.4, + any.hedgehog-extras ==0.6.0.2, + any.hedgehog-quickcheck ==0.1.1, + any.hourglass ==0.2.12, + any.hpc ==0.6.2.0, + any.hsc2hs ==0.68.10, + hsc2hs -in-ghc-tree, + any.hspec ==2.11.7, + any.hspec-core ==2.11.7, + any.hspec-discover ==2.11.7, + any.hspec-expectations ==0.8.4, + any.http-api-data ==0.6, + http-api-data -use-text-show, + any.http-client ==0.7.16, + http-client +network-uri, + any.http-client-tls ==0.3.6.3, + any.http-conduit ==2.3.8.3, + http-conduit +aeson, + any.http-types ==0.12.4, + any.indexed-traversable ==0.1.3, + any.indexed-traversable-instances ==0.1.1.2, + any.infinite-list ==0.1.1, + any.integer-conversion ==0.1.0.1, + any.integer-gmp ==1.1, + any.integer-logarithms ==1.0.3.1, + integer-logarithms -check-bounds +integer-gmp, + any.invariant ==0.6.2, + any.io-classes ==1.3.1.0, + io-classes -asserts, + any.io-classes-mtl ==0.1.0.3, + any.io-sim ==1.3.1.0, + io-sim -asserts, + any.iproute ==1.7.12, + any.isomorphism-class ==0.1.0.12, + any.js-chart ==2.9.4.1, + any.kan-extensions ==5.2.5, + any.lazy-search ==0.1.3.0, + any.lazysmallcheck ==0.6, + any.lens ==5.2.3, + lens -benchmark-uniplate -dump-splices +inlining -j +test-hunit +test-properties +test-templates +trustworthy, + any.libyaml ==0.1.2, + libyaml -no-unicode -system-libyaml, + any.lifted-async ==0.10.2.5, + any.lifted-base ==0.2.3.12, + any.list-t ==1.0.5.7, + any.logict ==0.8.1.0, + any.math-functions ==0.3.4.3, + math-functions +system-erf +system-expm1, + any.measures ==0.1.0.2, + any.megaparsec ==9.6.1, + megaparsec -dev, + any.memory ==0.18.0, + memory +support_bytestring +support_deepseq, + any.microlens ==0.4.13.1, + any.microlens-mtl ==0.2.0.3, + any.microlens-th ==0.4.3.14, + any.microstache ==1.0.2.3, + any.mime-types ==0.1.2.0, + any.mmorph ==1.2.0, + any.monad-control ==1.0.3.1, + any.mono-traversable ==1.0.15.3, + any.monoidal-containers ==0.6.4.0, + monoidal-containers +split-these, + any.monoidal-synchronisation ==0.1.0.5, + any.mtl ==2.3.1, + any.mtl-compat ==0.2.2, + mtl-compat -two-point-one -two-point-two, + any.multiset ==0.3.4.3, + any.mwc-random ==0.15.0.2, + any.network ==3.1.4.0, + network -devel, + any.network-mux ==0.4.5.0, + network-mux -ipv6 -tracetcpinfo, + any.network-uri ==2.6.4.2, + any.newtype ==0.2.2.0, + any.newtype-generics ==0.6.2, + any.non-integral ==1.0.0.0, + any.nonempty-vector ==0.2.3, + any.nothunks ==0.1.5, + nothunks +bytestring +text +vector, + any.old-locale ==1.0.0.7, + any.old-time ==1.1.0.4, + any.optparse-applicative ==0.18.1.0, + optparse-applicative +process, + any.optparse-applicative-fork ==0.18.1.0, + optparse-applicative-fork +process, + any.ordered-containers ==0.2.3, + any.ouroboros-consensus ==0.15.0.0, + ouroboros-consensus -asserts, + any.ouroboros-consensus-cardano ==0.13.0.0, + ouroboros-consensus-cardano -asserts, + any.ouroboros-consensus-diffusion ==0.10.0.0, + ouroboros-consensus-diffusion -asserts, + any.ouroboros-consensus-protocol ==0.7.0.0, + ouroboros-consensus-protocol -asserts, + any.ouroboros-network ==0.11.0.0, + ouroboros-network -asserts, + any.ouroboros-network-api ==0.6.3.0, + ouroboros-network-api -asserts, + any.ouroboros-network-framework ==0.11.0.0, + ouroboros-network-framework -ipv6, + any.ouroboros-network-mock ==0.1.1.1, + ouroboros-network-mock -asserts, + any.ouroboros-network-protocols ==0.7.0.0, + ouroboros-network-protocols -asserts +cddl, + any.ouroboros-network-testing ==0.5.0.0, + ouroboros-network-testing -nightly, + any.parallel ==3.2.2.0, + any.parsec ==3.1.16.1, + any.parser-combinators ==1.3.0, + parser-combinators -dev, + any.parsers ==0.12.11, + parsers +attoparsec +binary +parsec, + any.partial-order ==0.2.0.0, + partial-order +extra-instances, + any.pem ==0.2.4, + any.pipes ==4.3.16, + any.plutus-core ==1.21.0.0, + plutus-core -with-cert -with-inline-r, + any.plutus-ledger-api ==1.21.0.0, + any.plutus-tx ==1.21.0.0, + any.plutus-tx-plugin ==1.21.0.0, + plutus-tx-plugin -use-ghc-stub, + any.polyparse ==1.13, + any.pretty ==1.1.3.6, + any.pretty-show ==1.10, + any.pretty-simple ==4.1.2.0, + pretty-simple -buildexample +buildexe, + any.prettyprinter ==1.7.1, + prettyprinter -buildreadme +text, + any.prettyprinter-ansi-terminal ==1.1.3, + any.prettyprinter-configurable ==1.21.0.0, + any.primitive ==0.9.0.0, + any.process ==1.6.17.0, + any.profunctors ==5.6.2, + any.protolude ==0.3.4, + any.psqueues ==0.2.8.0, + any.quickcheck-dynamic ==3.3.1, + any.quickcheck-instances ==0.3.30, + quickcheck-instances -bytestring-builder, + any.quickcheck-io ==0.2.0, + any.quickcheck-state-machine ==0.9.0, + any.quickcheck-transformer ==0.3.1.2, + any.quiet ==0.2, + any.ral ==0.2.1, + ral +adjunctions +distributive +semigroupoids, + any.random ==1.2.1.2, + any.random-shuffle ==0.0.4, + any.recursion-schemes ==5.2.2.5, + recursion-schemes +template-haskell, + any.reflection ==2.1.7, + reflection -slow +template-haskell, + any.resourcet ==1.3.0, + any.retry ==0.9.3.1, + retry -lib-werror, + any.rts ==1.0.2, + any.safe ==0.3.21, + any.safe-exceptions ==0.1.7.4, + any.scientific ==0.3.7.0, + scientific -bytestring-builder -integer-simple, + any.selective ==0.5, + any.semialign ==1.3, + semialign +semigroupoids, + any.semigroupoids ==6.0.0.1, + semigroupoids +comonad +containers +contravariant +distributive +tagged +unordered-containers, + any.semigroups ==0.20, + semigroups +binary +bytestring -bytestring-builder +containers +deepseq +hashable +tagged +template-haskell +text +transformers +unordered-containers, + any.serialise ==0.2.6.1, + serialise +newtime15, + any.set-algebra ==1.1.0.2, + any.si-timers ==1.3.0.0, + si-timers -asserts, + any.singletons ==3.0.2, + any.singletons-th ==3.2, + any.size-based ==0.1.3.2, + any.small-steps ==1.0.1.0, + small-steps -sts_assert, + any.small-steps-test ==1.0.1.0, + any.socks ==0.6.1, + any.some ==1.0.6, + some +newtype-unsafe, + any.sop-core ==0.5.0.2, + any.sop-extras ==0.1.0.0, + any.split ==0.2.5, + any.splitmix ==0.1.0.5, + splitmix -optimised-mixer, + any.statistics ==0.16.2.1, + any.statistics-linreg ==0.3, + any.stm ==2.5.1.0, + any.streaming ==0.2.4.0, + any.streaming-binary ==0.3.0.1, + any.streaming-bytestring ==0.3.2, + any.streaming-commons ==0.2.2.6, + streaming-commons -use-bytestring-builder, + any.strict ==0.5, + any.strict-checked-vars ==0.2.0.0, + strict-checked-vars -checkmvarinvariants -checktvarinvariants, + any.strict-list ==0.1.7.4, + any.strict-mvar ==1.3.0.0, + any.strict-sop-core ==0.1.0.0, + any.strict-stm ==1.3.0.0, + strict-stm -asserts, + any.syb ==0.7.2.4, + any.system-cxx-std-lib ==1.0, + any.tagged ==0.8.8, + tagged +deepseq +transformers, + any.tar ==0.5.1.1, + tar -old-bytestring -old-time, + any.tasty ==1.5, + tasty +unix, + any.tasty-expected-failure ==0.12.3, + any.tasty-golden ==2.3.5, + tasty-golden -build-example, + any.tasty-hedgehog ==1.4.0.2, + any.tasty-hunit ==0.10.1, + any.tasty-quickcheck ==0.10.3, + any.template-haskell ==2.20.0.0, + any.temporary ==1.3, + any.terminal-size ==0.3.4, + any.terminfo ==0.4.1.6, + any.testing-type-modifiers ==0.1.0.1, + any.text ==2.0.2, + any.text-builder ==0.6.7.2, + any.text-builder-dev ==0.3.4.2, + any.text-iso8601 ==0.1, + any.text-short ==0.1.5, + text-short -asserts, + any.text-zipper ==0.13, + any.tf-random ==0.5, + any.th-abstraction ==0.6.0.0, + any.th-compat ==0.1.4, + any.th-desugar ==1.15, + any.th-expand-syns ==0.4.11.0, + any.th-lift ==0.8.4, + any.th-lift-instances ==0.1.20, + any.th-orphans ==0.13.14, + any.th-reify-many ==0.1.10, + any.th-utilities ==0.2.5.0, + any.these ==1.2, + any.time ==1.12.2, + any.time-compat ==1.9.6.1, + time-compat -old-locale, + any.tls ==1.9.0, + tls +compat -hans +network, + any.transformers ==0.6.1.0, + any.transformers-base ==0.4.6, + transformers-base +orphaninstances, + any.transformers-compat ==0.7.2, + transformers-compat -five +five-three -four +generic-deriving +mtl -three -two, + any.transformers-except ==0.1.4, + any.tree-diff ==0.3.0.1, + any.type-equality ==1, + any.typed-process ==0.2.11.1, + any.typed-protocols ==0.1.1.0, + any.typed-protocols-cborg ==0.1.0.4, + any.typed-protocols-examples ==0.2.0.2, + any.unbounded-delays ==0.1.1.1, + any.uniplate ==1.6.13, + any.universe-base ==1.1.3.1, + any.unix ==2.8.1.0, + any.unix-bytestring ==0.4.0, + any.unix-compat ==0.7.1, + unix-compat -old-time, + any.unix-time ==0.4.12, + any.unliftio ==0.2.25.0, + any.unliftio-core ==0.2.1.0, + any.unordered-containers ==0.2.20, + unordered-containers -debug, + any.utf8-string ==1.0.2, + any.uuid-types ==1.0.5.1, + any.validation-selective ==0.2.0.0.0.0.0.0.1, + any.validity ==0.12.0.2, + any.vector ==0.13.1.0, + vector +boundschecks -internalchecks -unsafechecks -wall, + any.vector-algorithms ==0.9.0.1, + vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks, + any.vector-binary-instances ==0.2.5.2, + any.vector-map ==1.1.0.0, + any.vector-stream ==0.1.0.1, + any.vector-th-unbox ==0.2.2, + any.void ==0.7.3, + void -safe, + any.vty ==6.0, + any.vty-crossplatform ==0.2.0.0, + vty-crossplatform -demos, + any.vty-unix ==0.1.0.0, + any.witherable ==0.4.2, + any.wl-pprint-annotated ==0.1.0.1, + any.wl-pprint-text ==1.2.0.2, + any.word-wrap ==0.5, + any.yaml ==0.11.11.2, + yaml +no-examples +no-exe, + any.zlib ==0.6.3.0, + zlib -bundled-c-zlib -non-blocking-ffi -pkg-config +index-state: cardano-haskell-packages 2024-02-06T15:25:20Z, hackage.haskell.org 2024-02-06T15:14:59Z diff --git a/cem-script.cabal b/cem-script.cabal index 92b49ee..9e15df7 100644 --- a/cem-script.cabal +++ b/cem-script.cabal @@ -122,6 +122,8 @@ common common-offchain , retry , cardano-api -- , cardano-cli + , ouroboros-network-protocols + , clb , cardano-ledger-core , cardano-ledger-babbage , cardano-ledger-alonzo @@ -174,13 +176,13 @@ library Cardano.CEM.Examples.Voting Cardano.CEM.Monads Cardano.CEM.Monads.L1 + Cardano.CEM.Monads.CLB Cardano.CEM.OnChain build-depends: cem-script:data-spine, cem-script:cardano-extras, dependent-map, singletons-th, - -- plutarch, test-suite cem-sdk-test import: diff --git a/src/Cardano/CEM/Examples/Auction.hs b/src/Cardano/CEM/Examples/Auction.hs index bf1c6d2..ba49424 100644 --- a/src/Cardano/CEM/Examples/Auction.hs +++ b/src/Cardano/CEM/Examples/Auction.hs @@ -1,4 +1,5 @@ {-# LANGUAGE NoPolyKinds #-} +{-# LANGUAGE ViewPatterns #-} module Cardano.CEM.Examples.Auction where diff --git a/src/Cardano/CEM/Examples/Voting.hs b/src/Cardano/CEM/Examples/Voting.hs index 70cc479..3f5c3bb 100644 --- a/src/Cardano/CEM/Examples/Voting.hs +++ b/src/Cardano/CEM/Examples/Voting.hs @@ -1,4 +1,5 @@ {-# OPTIONS_GHC -Wno-overlapping-patterns #-} +{-# LANGUAGE ViewPatterns #-} module Cardano.CEM.Examples.Voting where diff --git a/src/Cardano/CEM/Monads/CLB.hs b/src/Cardano/CEM/Monads/CLB.hs new file mode 100644 index 0000000..11d3064 --- /dev/null +++ b/src/Cardano/CEM/Monads/CLB.hs @@ -0,0 +1,40 @@ +{-# LANGUAGE RecordWildCards #-} + +module Cardano.CEM.Monads.CLB where + +import Prelude + +import Text.Show.Pretty + +import Control.Monad.Reader (MonadReader (..), ReaderT (..), asks) +import Control.Monad.State (gets) +import Control.Monad.Trans (MonadIO (..)) + +-- Cardano imports +import Cardano.Api hiding (queryUtxo) +import Cardano.Api.Shelley (LedgerProtocolParameters (..)) + +-- Lib imports +import Clb +import Clb.MockConfig + +-- CEM imports + +import Cardano.CEM +import Cardano.CEM.Monads +import Cardano.Extras + +instance MonadFail Clb where + fail = error "TODO" + +instance MonadBlockchainParams Clb where + askNetworkId :: Clb NetworkId + askNetworkId = gets (mockConfigNetworkId . mockConfig) + + -- mockConfigProtocolb + + queryCurrentSlot :: Clb SlotNo + queryCurrentSlot = getCurrentSlot + -- clbState <- ask + -- return clbState.ledgerEnv.ledgerSlotNo + diff --git a/src/Cardano/CEM/Monads/L1.hs b/src/Cardano/CEM/Monads/L1.hs index b7d09aa..538f3a5 100644 --- a/src/Cardano/CEM/Monads/L1.hs +++ b/src/Cardano/CEM/Monads/L1.hs @@ -12,14 +12,12 @@ import Data.Set qualified as Set import Unsafe.Coerce (unsafeCoerce) import Data.Aeson +import Data.Aeson.KeyMap ((!?)) -- Cardano imports --- import Cardano.Ledger.Chain (PredicateFailure) --- import Cardano.Ledger.Shelley.API () --- import Ouroboros.Consensus.Shelley.Ledger (ApplyTxError (..)) --- import Cardano.Ledger.Alonzo.TxInfo (ExtendedUTxO, TranslationError) import Cardano.Api hiding (queryUtxo) -import Cardano.Api.Shelley (LedgerProtocolParameters (..)) +import Cardano.Api.Shelley (LedgerProtocolParameters (..), ) +import Ouroboros.Network.Protocol.LocalStateQuery.Type (Target (..)) -- CEM imports @@ -73,7 +71,7 @@ queryCardanoNode :: QueryInShelleyBasedEra Era b -> L1Runner b queryCardanoNode query = do node <- localNode <$> ask - result <- liftIO $ queryNodeLocalState node Nothing cardanoQuery + result <- liftIO $ queryNodeLocalState node VolatileTip cardanoQuery return $ case result of -- TODO: better handling of wrong-era exceptions Right (Right x) -> x @@ -142,9 +140,6 @@ instance MonadSubmitTx L1Runner where mainAddress <- fromPlutusAddressInMonad mainAddress' utxo <- queryUtxo $ ByTxIns $ map fst txIns - -- liftIO $ pPrint preBody - -- liftIO $ pPrint utxo - body <- either (\x -> fail $ "Autobalance error: " <> show x) return =<< callBodyAutoBalance @@ -190,7 +185,7 @@ callBodyAutoBalance :: TxBodyContent BuildTx Era -> UTxO Era -> AddressInEra Era -> - m (Either TxBodyErrorAutoBalance (TxBody Era)) + m (Either (TxBodyErrorAutoBalance Era) (TxBody Era)) callBodyAutoBalance preBody utxo diff --git a/src/Cardano/CEM/Stages.hs b/src/Cardano/CEM/Stages.hs index 1669625..5f8c8b5 100644 --- a/src/Cardano/CEM/Stages.hs +++ b/src/Cardano/CEM/Stages.hs @@ -1,4 +1,5 @@ {-# LANGUAGE NoPolyKinds #-} +{-# LANGUAGE ViewPatterns #-} module Cardano.CEM.Stages where