From 7068a5141cd40a93668ace22267a9f564a57134c Mon Sep 17 00:00:00 2001 From: Alexandre de Alegria Junceiro Mascarenhas Monteiro Date: Wed, 23 Mar 2022 18:19:16 +0000 Subject: [PATCH] Updated the dependencies of the repository to work with the most recent version of Plutus --- cabal.project | 320 ++++++++++++++++++++--------------- examples/test/Spec/Game.hs | 4 +- nix/pkgs/haskell/haskell.nix | 33 ++-- pab/Main.hs | 3 +- plutus-starter.cabal | 28 +-- 5 files changed, 225 insertions(+), 163 deletions(-) diff --git a/cabal.project b/cabal.project index 8a375b4..6a17153 100644 --- a/cabal.project +++ b/cabal.project @@ -1,4 +1,4 @@ -index-state: 2021-08-14T00:00:00Z +index-state: 2022-01-22T00:00:00Z packages: ./. @@ -9,20 +9,27 @@ write-ghc-environment-files: never tests: true benchmarks: true --- Plutus revision from 2021/08/16 +-- Plutus apps revision from 2022/03/10 source-repository-package type: git location: https://github.com/input-output-hk/plutus-apps.git subdir: + doc freer-extras playground-common - plutus-contract plutus-chain-index + plutus-chain-index-core + plutus-contract + plutus-example plutus-ledger + plutus-ledger-constraints plutus-pab + plutus-pab-executables + plutus-playground-server plutus-use-cases quickcheck-dynamic - tag: plutus-starter-devcontainer/v1.0.14 + web-ghc + tag: c9f2601e342a2fc0e2b5870ce656ef434b0efa32 -- The following sections are copied from the 'plutus-apps' repository cabal.project at the revision @@ -38,26 +45,11 @@ write-ghc-environment-files: never tests: true benchmarks: true --- The only sensible test display option +-- The only sensible test display option. test-show-details: streaming allow-newer: - -- Copied from plutus-core size-based:template-haskell - , ouroboros-consensus-byron:formatting - , beam-core:aeson - , beam-sqlite:aeson - , beam-sqlite:dlist - , beam-migrate:aeson - --- Copied from plutus-core -constraints: - -- big breaking change here, inline-r doens't have an upper bound - singletons < 3.0 - -- bizarre issue: in earlier versions they define their own 'GEq', in newer - -- ones they reuse the one from 'some', but there isn't e.g. a proper version - -- constraint from dependent-sum-template (which is the library we actually use). - , dependent-sum > 0.6.2.0 -- These packages appear in our dependency tree and are very slow to build. -- Empirically, turning off optimization shaves off ~50% build time. @@ -71,179 +63,243 @@ package ouroboros-consensus-cardano optimization: False package cardano-api optimization: False +package cardano-wallet + optimization: False +package cardano-wallet-core + optimization: False +package cardano-wallet-cli + optimization: False +package cardano-wallet-launcher + optimization: False +package cardano-wallet-core-integration + optimization: False --- Copied from plutus-core +-- Direct dependency. +-- Are you thinking of updating this tag to some other commit? +-- Please ensure that the commit you are about to use is the latest one from +-- the *develop* branch of this repo: +-- * +-- (not master!) +-- +-- In particular we rely on the code from this PR: +-- * +-- being merged. source-repository-package type: git - location: https://github.com/Quid2/flat.git - tag: ee59880f47ab835dbd73bea0847dab7869fc20d8 + location: https://github.com/input-output-hk/iohk-monitoring-framework + tag: 46f994e216a1f8b36fe4669b47b2a7011b0e153c + subdir: + contra-tracer + iohk-monitoring + tracer-transformers + plugins/backend-ekg + plugins/backend-aggregation + plugins/backend-monitoring + plugins/backend-trace-forwarder --- Needs some patches, but upstream seems to be fairly dead (no activity in > 1 year) +-- Direct dependency. source-repository-package type: git - location: https://github.com/input-output-hk/purescript-bridge.git - tag: 6a92d7853ea514be8b70bab5e72077bf5a510596 + location: https://github.com/input-output-hk/plutus + tag: 4127e9cd6e889824d724c30eae55033cb50cbf3e + subdir: + plutus-core + plutus-ledger-api + plutus-tx + plutus-tx-plugin + prettyprinter-configurable + stubs/plutus-ghc-stub + word-array +-- Should follow plutus. source-repository-package type: git - location: https://github.com/input-output-hk/servant-purescript.git - tag: a0c7c7e37c95564061247461aef4be505a853538 + location: https://github.com/Quid2/flat + tag: ee59880f47ab835dbd73bea0847dab7869fc20d8 --- Copied from plutus-core +-- Direct dependency. source-repository-package type: git - location: https://github.com/input-output-hk/cardano-crypto.git - tag: 07397f0e50da97eaa0575d93bee7ac4b2b2576ec + location: https://github.com/input-output-hk/servant-purescript + tag: 44e7cacf109f84984cd99cd3faf185d161826963 --- Copied from plutus-core +-- Direct dependency. source-repository-package type: git - location: https://github.com/input-output-hk/cardano-base - tag: 4ea7e2d927c9a7f78ddc69738409a5827ab66b98 - subdir: - base-deriving-via - binary - binary/test - cardano-crypto-class - cardano-crypto-praos - cardano-crypto-tests - measures - orphans-deriving-via - slotting - strict-containers + location: https://github.com/input-output-hk/purescript-bridge + tag: 47a1f11825a0f9445e0f98792f79172efef66c00 --- Copied from plutus-core +-- Direct dependency. +-- Compared to others, cardano-wallet doesn't bump dependencies very often. +-- Making it a good place to start when bumping dependencies. +-- As, for example, bumping the node first highly risks breaking API with the wallet. +-- Unless early bug fixes are required, this is fine as the wallet tracks stable releases of the node. +-- And it is indeed nice for plutus-apps to track stable releases of the node too. source-repository-package type: git - location: https://github.com/input-output-hk/cardano-prelude - tag: fd773f7a58412131512b9f694ab95653ac430852 + location: https://github.com/input-output-hk/cardano-wallet + tag: f6d4db733c4e47ee11683c343b440552f59beff7 subdir: - cardano-prelude - cardano-prelude-test + lib/cli + lib/core + lib/core-integration + lib/dbvar + lib/launcher + lib/numeric + lib/shelley + lib/strict-non-empty-containers + lib/test-utils + lib/text-class + +-- Should follow cardano-wallet. +-- Currently tracking v1.34.1. source-repository-package type: git - location: https://github.com/input-output-hk/cardano-addresses - tag: d2f86caa085402a953920c6714a0de6a50b655ec + location: https://github.com/input-output-hk/cardano-node + tag: 73f9a746362695dc2cb63ba757fbcabb81733d23 subdir: - core - + cardano-api + cardano-cli + cardano-git-rev + cardano-node + cardano-testnet + trace-dispatcher + trace-forward + trace-resources + source-repository-package type: git - location: https://github.com/input-output-hk/cardano-wallet - tag: ae7569293e94241ef6829139ec02bd91abd069df - subdir: - lib/text-class - lib/strict-non-empty-containers - lib/core - lib/test-utils - lib/numeric + location: https://github.com/input-output-hk/ekg-forward + tag: 297cd9db5074339a2fb2e5ae7d0780debb670c63 + +source-repository-package + type: git + location: https://github.com/input-output-hk/cardano-config + tag: e9de7a2cf70796f6ff26eac9f9540184ded0e4e6 + --sha256: 1wm1c99r5zvz22pdl8nhkp13falvqmj8dgkm8fxskwa9ydqz01ld +-- Using a fork until our patches can be merged upstream source-repository-package type: git - location: https://github.com/input-output-hk/ouroboros-network - tag: 1f4973f36f689d6da75b5d351fb124d66ef1057d - subdir: - monoidal-synchronisation - typed-protocols - typed-protocols-cborg - typed-protocols-examples - ouroboros-network - ouroboros-network-testing - ouroboros-network-framework - ouroboros-consensus - ouroboros-consensus-byron - ouroboros-consensus-cardano - ouroboros-consensus-shelley - io-sim - io-classes - network-mux - ntp-client + location: https://github.com/input-output-hk/optparse-applicative + tag: 7497a29cb998721a9068d5725d49461f2bba0e7a + --sha256: 1gvsrg925vynwgqwplgjmp53vj953qyh3wbdf34pw21c8r47w35r source-repository-package type: git - location: https://github.com/input-output-hk/iohk-monitoring-framework - -- Important Note: Read below, before changing this! - tag: 46f994e216a1f8b36fe4669b47b2a7011b0e153c - -- Are you thinking of updating this tag to some other commit? Please - -- ensure that the commit you are about to use is the latest one from - -- the *develop* branch of this repo: - -- * - -- (not master!) - -- - -- In particular we rely on the code from this PR: - -- * - -- being merged. - subdir: - iohk-monitoring - tracer-transformers - contra-tracer - plugins/backend-aggregation - plugins/backend-ekg - plugins/backend-monitoring - plugins/backend-trace-forwarder - plugins/scribe-systemd + location: https://github.com/input-output-hk/hedgehog-extras + tag: edf6945007177a638fbeb8802397f3a6f4e47c14 + --sha256: 0wc7qzkc7j4ns2rz562h6qrx2f8xyq7yjcb7zidnj7f6j0pcd0i9 +-- Should follow cardano-wallet. source-repository-package type: git - location: https://github.com/input-output-hk/cardano-ledger-specs - tag: bf008ce028751cae9fb0b53c3bef20f07c06e333 + location: https://github.com/input-output-hk/cardano-ledger + tag: 1a9ec4ae9e0b09d54e49b2a40c4ead37edadcce5 subdir: - byron/ledger/impl - cardano-ledger-core - cardano-protocol-tpraos eras/alonzo/impl eras/byron/chain/executable-spec eras/byron/crypto eras/byron/crypto/test eras/byron/ledger/executable-spec + eras/byron/ledger/impl eras/byron/ledger/impl/test eras/shelley/impl + eras/shelley/test-suite eras/shelley-ma/impl + libs/cardano-data + libs/cardano-ledger-core + libs/cardano-ledger-pretty + libs/cardano-protocol-tpraos + libs/compact-map libs/non-integral + libs/set-algebra libs/small-steps - semantics/small-steps-test + libs/small-steps-test --- A lot of plutus-apps dependencies have to be synchronized with the dependencies of --- cardano-node. If you update cardano-node, please make sure that all dependencies --- of cardano-node are also updated. +-- Should follow cardano-wallet. source-repository-package type: git - location: https://github.com/input-output-hk/cardano-node.git - tag: b6ca519f97a0e795611a63174687e6bb70c9f752 + location: https://github.com/input-output-hk/ouroboros-network + tag: 4fac197b6f0d2ff60dc3486c593b68dc00969fbf subdir: - cardano-api - cardano-node - cardano-cli - cardano-config + io-classes + io-sim + monoidal-synchronisation + network-mux + ntp-client + ouroboros-consensus + ouroboros-consensus-byron + ouroboros-consensus-cardano + ouroboros-consensus-protocol + ouroboros-consensus-shelley + ouroboros-network + ouroboros-network-framework + ouroboros-network-testing + strict-stm + typed-protocols + typed-protocols-cborg + typed-protocols-examples +-- Should follow cardano-wallet. source-repository-package type: git - location: https://github.com/input-output-hk/optparse-applicative - tag: 7497a29cb998721a9068d5725d49461f2bba0e7a + location: https://github.com/input-output-hk/cardano-base + tag: 41545ba3ac6b3095966316a99883d678b5ab8da8 + subdir: + base-deriving-via + binary + binary/test + cardano-crypto-class + cardano-crypto-praos + measures + orphans-deriving-via + slotting + strict-containers +-- Should follow cardano-wallet. source-repository-package type: git - location: https://github.com/input-output-hk/Win32-network - tag: 3825d3abf75f83f406c1f7161883c438dac7277d + location: https://github.com/input-output-hk/cardano-prelude + tag: bb4ed71ba8e587f672d06edf9d2e376f4b055555 + subdir: + cardano-prelude + cardano-prelude-test + +-- Should follow cardano-wallet. +source-repository-package + type: git + location: https://github.com/input-output-hk/cardano-crypto + tag: f73079303f663e028288f9f4a9e08bcca39a923e +-- Should follow cardano-wallet. +source-repository-package + type: git + location: https://github.com/input-output-hk/cardano-addresses + tag: 71006f9eb956b0004022e80aadd4ad50d837b621 + subdir: + command-line + core + +-- Should follow cardano-wallet. source-repository-package type: git location: https://github.com/input-output-hk/goblins tag: cde90a2b27f79187ca8310b6549331e59595e7ba --- A lot of plutus-apps dependencies have to be syncronized with the dependencies of --- plutus. If you update plutus, please make sure that all dependencies of plutus --- are also updated +-- Should follow cardano-wallet. source-repository-package type: git - location: https://github.com/input-output-hk/plutus - tag: 3f089ccf0ca746b399c99afe51e063b0640af547 + location: https://github.com/input-output-hk/Win32-network + tag: 3825d3abf75f83f406c1f7161883c438dac7277d + +source-repository-package + type: git + location: https://github.com/blockfrost/blockfrost-haskell + tag: edfd43a95a21356b0cc540002bd1583a35883f85 subdir: - plutus-core - plutus-ledger-api - plutus-tx - plutus-tx-plugin - word-array - prettyprinter-configurable - stubs/plutus-ghc-stub + blockfrost-api + blockfrost-client-core + blockfrost-client + blockfrost-pretty \ No newline at end of file diff --git a/examples/test/Spec/Game.hs b/examples/test/Spec/Game.hs index a3b1beb..a2cc0dd 100644 --- a/examples/test/Spec/Game.hs +++ b/examples/test/Spec/Game.hs @@ -11,7 +11,7 @@ module Spec.Game import Control.Monad (void) import Ledger (ValidationError(ScriptFailure)) import qualified Ledger.Ada as Ada -import Plutus.Contract (Contract, ContractError(WalletError)) +import Plutus.Contract (Contract, ContractError(WalletContractError)) import Wallet.API (WalletAPIError(ValidationError)) import Plutus.Contract.Test import Plutus.Contracts.Game @@ -72,5 +72,5 @@ tests = testGroup "game" appropriateError :: ContractError -> Bool appropriateError e = case e of - WalletError (ValidationError (ScriptFailure _)) -> True + WalletContractError (ValidationError (ScriptFailure _)) -> True _ -> False diff --git a/nix/pkgs/haskell/haskell.nix b/nix/pkgs/haskell/haskell.nix index a4fcdfa..9c56c4e 100644 --- a/nix/pkgs/haskell/haskell.nix +++ b/nix/pkgs/haskell/haskell.nix @@ -22,24 +22,25 @@ let # If using materialization, be sure to disable it when source-repo-override is set or it won't take effect. sha256map = { - "https://github.com/input-output-hk/plutus-apps.git"."plutus-starter-devcontainer/v1.0.14" = "0j3hphj4b21vwdj900233d67qsaj91mppwsx1vv0ichnmnw2bmir"; - "https://github.com/Quid2/flat.git"."ee59880f47ab835dbd73bea0847dab7869fc20d8" = "1lrzknw765pz2j97nvv9ip3l1mcpf2zr4n56hwlz0rk7wq7ls4cm"; - "https://github.com/input-output-hk/purescript-bridge.git"."6a92d7853ea514be8b70bab5e72077bf5a510596" = "13j64vv116in3c204qsl1v0ajphac9fqvsjp7x3zzfr7n7g61drb"; - "https://github.com/input-output-hk/servant-purescript.git"."a0c7c7e37c95564061247461aef4be505a853538" = "177na04jf6wf18kandzsah40lw3xswmmccpr3hkb8wb4hypcffnf"; - "https://github.com/input-output-hk/cardano-base"."4ea7e2d927c9a7f78ddc69738409a5827ab66b98" = "0n0hxbr0l95cdc25jmmgs7apmmw17i91chhj5rzzv1k7f3iymf6d"; - "https://github.com/input-output-hk/cardano-crypto.git"."07397f0e50da97eaa0575d93bee7ac4b2b2576ec" = "06sdx5ndn2g722jhpicmg96vsrys89fl81k8290b3lr6b1b0w4m3"; - "https://github.com/input-output-hk/cardano-ledger-specs"."bf008ce028751cae9fb0b53c3bef20f07c06e333" = "0my3801w1vinc0kf5yh9lxl6saqxgwm6ccg0vvzi104pafcwwcqx"; - "https://github.com/input-output-hk/cardano-prelude"."fd773f7a58412131512b9f694ab95653ac430852" = "02jddik1yw0222wd6q0vv10f7y8rdgrlqaiy83ph002f9kjx7mh6"; + "https://github.com/input-output-hk/plutus-apps.git"."c9f2601e342a2fc0e2b5870ce656ef434b0efa32" = "sha256-GIL9uHQwlyD4qEpwUGlhN9o9blwhElmlKPOPjC3n714="; + "https://github.com/input-output-hk/ekg-forward"."297cd9db5074339a2fb2e5ae7d0780debb670c63" = "1zcwry3y5rmd9lgxy89wsb3k4kpffqji35dc7ghzbz603y1gy24g"; + "https://github.com/input-output-hk/cardano-addresses"."71006f9eb956b0004022e80aadd4ad50d837b621" = "11dl3fmq7ry5wdmz8kw07ji8yvrxnrsf7pgilw5q9mi4aqyvnaqk"; + "https://github.com/input-output-hk/cardano-base"."41545ba3ac6b3095966316a99883d678b5ab8da8" = "0icq9y3nnl42fz536da84414av36g37894qnyw4rk3qkalksqwir"; + "https://github.com/input-output-hk/cardano-config"."e9de7a2cf70796f6ff26eac9f9540184ded0e4e6" = "1wm1c99r5zvz22pdl8nhkp13falvqmj8dgkm8fxskwa9ydqz01ld"; + "https://github.com/input-output-hk/cardano-crypto"."f73079303f663e028288f9f4a9e08bcca39a923e" = "1n87i15x54s0cjkh3nsxs4r1x016cdw1fypwmr68936n3xxsjn6q"; + "https://github.com/input-output-hk/cardano-ledger"."1a9ec4ae9e0b09d54e49b2a40c4ead37edadcce5" = "0avzyiqq0m8njd41ck9kpn992yq676b1az9xs77977h7cf85y4wm"; + "https://github.com/input-output-hk/cardano-node"."73f9a746362695dc2cb63ba757fbcabb81733d23" = "1hh53whcj5y9kw4qpkiza7rmkniz18r493vv4dzl1a8r5fy3b2bv"; + "https://github.com/input-output-hk/cardano-prelude"."bb4ed71ba8e587f672d06edf9d2e376f4b055555" = "00h10l5mmiza9819p9v5q5749nb9pzgi20vpzpy1d34zmh6gf1cj"; + "https://github.com/input-output-hk/cardano-wallet"."f6d4db733c4e47ee11683c343b440552f59beff7" = "0gb3zyv3q5v5sd8r29s02yc0brwq5a01is9c0n528391n2r8g1yy"; "https://github.com/input-output-hk/goblins"."cde90a2b27f79187ca8310b6549331e59595e7ba" = "17c88rbva3iw82yg9srlxjv2ia5wjb9cyqw44hik565f5v9svnyg"; "https://github.com/input-output-hk/iohk-monitoring-framework"."46f994e216a1f8b36fe4669b47b2a7011b0e153c" = "1il8fx3misp3650ryj368b3x95ksz01zz3x0z9k00807j93d0ka0"; - "https://github.com/input-output-hk/optparse-applicative"."7497a29cb998721a9068d5725d49461f2bba0e7a" = "1gvsrg925vynwgqwplgjmp53vj953qyh3wbdf34pw21c8r47w35r"; - "https://github.com/input-output-hk/ouroboros-network"."1f4973f36f689d6da75b5d351fb124d66ef1057d" = "186056rvzdzy4jhvamjjbcmjyr94hs5hcyr8x6a0ch21hv5f014p"; - "https://github.com/input-output-hk/cardano-node.git"."b6ca519f97a0e795611a63174687e6bb70c9f752" = "0z5lpmqc98fwg3xzpzxkfslbxdjwfyyw8bn8yq0574sf4942vqdn"; + "https://github.com/input-output-hk/ouroboros-network"."4fac197b6f0d2ff60dc3486c593b68dc00969fbf" = "1b43vbdsr9m3ry1kgag2p2ixpv54gw7a4vvmndxl6knqg8qbsb8b"; + "https://github.com/input-output-hk/plutus"."4127e9cd6e889824d724c30eae55033cb50cbf3e" = "186w0x7vk8m8npmsfg9pdkxds0rlj6bmhr8nkgn96rkvaz5azjsb"; + "https://github.com/input-output-hk/purescript-bridge"."47a1f11825a0f9445e0f98792f79172efef66c00" = "0da1vn2l6iyfxcjk58qal1l4755v92zi6yppmjmqvxf1gacyf9px"; + "https://github.com/input-output-hk/servant-purescript"."44e7cacf109f84984cd99cd3faf185d161826963" = "10pb0yfp80jhb9ryn65a4rha2lxzsn2vlhcc6xphrrkf4x5lhzqc"; "https://github.com/input-output-hk/Win32-network"."3825d3abf75f83f406c1f7161883c438dac7277d" = "19wahfv726fa3mqajpqdqhnl9ica3xmf68i254q45iyjcpj1psqx"; - "https://github.com/input-output-hk/hedgehog-extras"."edf6945007177a638fbeb8802397f3a6f4e47c14" = "0wc7qzkc7j4ns2rz562h6qrx2f8xyq7yjcb7zidnj7f6j0pcd0i9"; - "https://github.com/input-output-hk/cardano-wallet"."ae7569293e94241ef6829139ec02bd91abd069df" = "1mv1dhpkdj9ridm1fvq6jc85qs6zvbp172228rq72gyawjwrgvi6"; - "https://github.com/input-output-hk/cardano-addresses"."d2f86caa085402a953920c6714a0de6a50b655ec" = "0p6jbnd7ky2yf7bwb1350k8880py8dgqg39k49q02a6ij4ld01ay"; - "https://github.com/input-output-hk/plutus"."3f089ccf0ca746b399c99afe51e063b0640af547" = "1nx8xmdgwmnsla4qg4k67f5md8vm3p1p9i25ndalrqdg40z90486"; + "https://github.com/Quid2/flat"."ee59880f47ab835dbd73bea0847dab7869fc20d8" = "1lrzknw765pz2j97nvv9ip3l1mcpf2zr4n56hwlz0rk7wq7ls4cm"; + "https://github.com/blockfrost/blockfrost-haskell"."edfd43a95a21356b0cc540002bd1583a35883f85" = "sha256-dOanQuBE/uNpcJTNtuCirGgG4JYtaxOVKjh4tjX8WUI="; }; modules = [ @@ -59,4 +60,4 @@ let inherit source-repo-override; }; in - project + project \ No newline at end of file diff --git a/pab/Main.hs b/pab/Main.hs index c699734..3d78163 100644 --- a/pab/Main.hs +++ b/pab/Main.hs @@ -95,7 +95,6 @@ instance Builtin.HasDefinitions StarterContracts where handlers :: SimulatorEffectHandlers (Builtin StarterContracts) handlers = - Simulator.mkSimulatorHandlers def def + Simulator.mkSimulatorHandlers def $ interpret (contractHandler Builtin.handleBuiltin) - diff --git a/plutus-starter.cabal b/plutus-starter.cabal index e303d32..f3d70ae 100644 --- a/plutus-starter.cabal +++ b/plutus-starter.cabal @@ -1,4 +1,4 @@ -cabal-version: 2.4 +cabal-version: 3.0 name: plutus-starter version: 0.1.0.0 @@ -45,15 +45,19 @@ library Plutus.Contracts.Game build-depends: base >= 4.9 && < 5, - aeson, - bytestring, - containers, - freer-extras, - playground-common, - plutus-contract, - plutus-tx-plugin, - plutus-tx, - plutus-ledger, + aeson -any, + bytestring -any, + containers -any, + freer-extras -any, + playground-common -any, + plutus-contract -any, + plutus-ledger -any, + plutus-ledger-api -any, + plutus-ledger-constraints -any, + plutus-tx -any, + plutus-tx-plugin -any, + text -any, + lens -any, hs-source-dirs: src examples/src test-suite plutus-example-projects-test @@ -67,13 +71,16 @@ test-suite plutus-example-projects-test plutus-tx -any, plutus-tx-plugin, plutus-contract -any, + plutus-pab -any, plutus-ledger -any, plutus-starter -any build-depends: base >=4.9 && <5, tasty -any, tasty-hunit -any, + text -any, tasty-hedgehog >=0.2.0.0 + executable plutus-starter-pab import: lang @@ -93,4 +100,3 @@ executable plutus-starter-pab freer-extras -any, plutus-ledger -any, openapi3 -any, -