Skip to content
This repository was archived by the owner on May 20, 2024. It is now read-only.

Commit 7f964bf

Browse files
authored
Upgrade plutus-apps to v0.1.0 (#53)
1 parent aafa7d6 commit 7f964bf

File tree

8 files changed

+58
-41
lines changed

8 files changed

+58
-41
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Plutus Starter Project",
3-
"image": "docker.io/inputoutput/plutus-starter-devcontainer:v1.0.14",
3+
"image": "docker.io/inputoutput/plutus-starter-devcontainer:v0.1.0",
44

55
"remoteUser": "plutus",
66

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
## How to update dependencies
44

5-
1. Go to https://github.com/input-output-hk/plutus-apps/tags and take note of the latest `plutus-starter-devcontainer` tag and its commit hash.
5+
1. Go to https://github.com/input-output-hk/plutus-apps/tags and take note of the latest `v.X.Y.Z` tag.
66
2. Update the tag and/or hash in the following files:
77
- `.devcontainer/devcontainer.json`
88
- `nix/sources.json`
9-
- `nix/pkgs/haskell/haskell.nix`
9+
- `nix/pkgs/haskell/sha256map.nix`
1010
- `cabal.project`
1111
3. Copy over most of https://github.com/input-output-hk/plutus-apps/blob/main/cabal.project into `cabal.project`
12-
4. Copy over the `sha256map` values from https://github.com/input-output-hk/plutus-apps/blob/main/nix/pkgs/haskell/haskell.nix into `nix/pkgs/haskell/haskell.nix` (but leave the first line that you just changed in step 2). To get the right hash value for `plutus-apps`, change one digit, then run `nix-shell`. You will get an error that shows the correct hash.
12+
4. Copy over the `sha256map` values from https://github.com/input-output-hk/plutus-apps/blob/main/nix/pkgs/haskell/sha256map.nix into `nix/pkgs/haskell/sha256map.nix` (but leave the first line that you just changed in step 2). To get the right hash value for `plutus-apps`, change one digit, then run `nix-shell`. You will get an error that shows the correct hash.
1313
5. It’s likely that the code for the guessing game needs to be changed; luckily, you can copy the source from https://github.com/input-output-hk/plutus-apps/blob/main/plutus-playground-server/usecases/Game.hs roughly, and it should work.
1414
6. Test the different parts:
1515
- VSCode

cabal.project

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ benchmarks: true
1313
source-repository-package
1414
type: git
1515
location: https://github.com/input-output-hk/plutus-apps.git
16+
tag: v0.1.0
1617
subdir:
1718
doc
1819
freer-extras
@@ -27,10 +28,11 @@ source-repository-package
2728
plutus-pab
2829
plutus-pab-executables
2930
plutus-playground-server
31+
plutus-script-utils
32+
plutus-streaming
33+
plutus-tx-constraints
3034
plutus-use-cases
31-
quickcheck-dynamic
3235
web-ghc
33-
tag: v2022-04-06
3436

3537

3638
-- The following sections are copied from the 'plutus-apps' repository cabal.project at the revision
@@ -109,7 +111,7 @@ source-repository-package
109111
source-repository-package
110112
type: git
111113
location: https://github.com/input-output-hk/plutus
112-
tag: 4127e9cd6e889824d724c30eae55033cb50cbf3e
114+
tag: 6d9ac7c2f89363d574dbc10be5c2db4b661c9a43
113115
subdir:
114116
plutus-core
115117
plutus-ledger-api
@@ -158,14 +160,14 @@ source-repository-package
158160
lib/strict-non-empty-containers
159161
lib/test-utils
160162
lib/text-class
161-
163+
162164

163165
-- Should follow cardano-wallet.
164166
-- Currently tracking v1.34.1.
165167
source-repository-package
166168
type: git
167169
location: https://github.com/input-output-hk/cardano-node
168-
tag: 73f9a746362695dc2cb63ba757fbcabb81733d23
170+
tag: 2b1d18c6c7b7142d9eebfec34da48840ed4409b6
169171
subdir:
170172
cardano-api
171173
cardano-cli
@@ -175,12 +177,12 @@ source-repository-package
175177
trace-dispatcher
176178
trace-forward
177179
trace-resources
178-
180+
179181
source-repository-package
180182
type: git
181183
location: https://github.com/input-output-hk/ekg-forward
182184
tag: 297cd9db5074339a2fb2e5ae7d0780debb670c63
183-
185+
184186
source-repository-package
185187
type: git
186188
location: https://github.com/input-output-hk/cardano-config
@@ -301,3 +303,14 @@ source-repository-package
301303
type: git
302304
location: https://github.com/input-output-hk/Win32-network
303305
tag: 3825d3abf75f83f406c1f7161883c438dac7277d
306+
307+
-- Temporary indexing
308+
source-repository-package
309+
type: git
310+
location: https://github.com/raduom/hysterical-screams
311+
tag: 4c523469e9efd3f0d10d17da3304923b7b0e0674
312+
313+
source-repository-package
314+
type: git
315+
location: https://github.com/input-output-hk/quickcheck-dynamic
316+
tag: c272906361471d684440f76c297e29ab760f6a1e

examples/src/Plutus/Contracts/Game.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ import qualified Data.ByteString.Char8 as C
4444
import Data.Map (Map)
4545
import qualified Data.Map as Map
4646
import Data.Maybe (catMaybes)
47-
import Ledger (Address, Datum (Datum), ScriptContext, Validator, Value)
47+
import Plutus.V1.Ledger.Api (Address, ScriptContext, Validator, Value, Datum(Datum))
4848
import qualified Ledger
4949
import qualified Ledger.Ada as Ada
5050
import qualified Ledger.Constraints as Constraints
5151
import Ledger.Tx (ChainIndexTxOut (..))
52-
import qualified Ledger.Typed.Scripts as Scripts
5352
import Playground.Contract
5453
import Plutus.Contract
5554
import Plutus.Contract.Trace as X
@@ -58,6 +57,7 @@ import PlutusTx.Prelude hiding (pure, (<$>))
5857
import qualified Prelude as Haskell
5958
import Plutus.Trace.Emulator (EmulatorTrace)
6059
import qualified Plutus.Trace.Emulator as Trace
60+
import qualified Plutus.Script.Utils.V1.Typed.Scripts as Scripts
6161

6262
newtype HashedString = HashedString BuiltinByteString deriving newtype (PlutusTx.ToData, PlutusTx.FromData, PlutusTx.UnsafeFromData)
6363

@@ -80,7 +80,7 @@ gameInstance :: Scripts.TypedValidator Game
8080
gameInstance = Scripts.mkTypedValidator @Game
8181
$$(PlutusTx.compile [|| validateGuess ||])
8282
$$(PlutusTx.compile [|| wrap ||]) where
83-
wrap = Scripts.wrapValidator @HashedString @ClearString
83+
wrap = Scripts.mkUntypedValidator @HashedString @ClearString
8484

8585
-- create a data script for the guessing game by hashing the string
8686
-- and lifting the hash to its on-chain representation

nix/pkgs/haskell/haskell.nix

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,7 @@ let
2121

2222
# If using materialization, be sure to disable it when source-repo-override is set or it won't take effect.
2323

24-
sha256map = {
25-
"https://github.com/input-output-hk/plutus-apps.git"."v2022-04-06" = "13yg3vb6a6gmjawlfa3wam5c6krqm7lip4w1p0j30hflca23x2h2";
26-
"https://github.com/input-output-hk/ekg-forward"."297cd9db5074339a2fb2e5ae7d0780debb670c63" = "1zcwry3y5rmd9lgxy89wsb3k4kpffqji35dc7ghzbz603y1gy24g";
27-
"https://github.com/input-output-hk/cardano-addresses"."71006f9eb956b0004022e80aadd4ad50d837b621" = "11dl3fmq7ry5wdmz8kw07ji8yvrxnrsf7pgilw5q9mi4aqyvnaqk";
28-
"https://github.com/input-output-hk/cardano-base"."41545ba3ac6b3095966316a99883d678b5ab8da8" = "0icq9y3nnl42fz536da84414av36g37894qnyw4rk3qkalksqwir";
29-
"https://github.com/input-output-hk/cardano-config"."e9de7a2cf70796f6ff26eac9f9540184ded0e4e6" = "1wm1c99r5zvz22pdl8nhkp13falvqmj8dgkm8fxskwa9ydqz01ld";
30-
"https://github.com/input-output-hk/cardano-crypto"."f73079303f663e028288f9f4a9e08bcca39a923e" = "1n87i15x54s0cjkh3nsxs4r1x016cdw1fypwmr68936n3xxsjn6q";
31-
"https://github.com/input-output-hk/cardano-ledger"."1a9ec4ae9e0b09d54e49b2a40c4ead37edadcce5" = "0avzyiqq0m8njd41ck9kpn992yq676b1az9xs77977h7cf85y4wm";
32-
"https://github.com/input-output-hk/cardano-node"."73f9a746362695dc2cb63ba757fbcabb81733d23" = "1hh53whcj5y9kw4qpkiza7rmkniz18r493vv4dzl1a8r5fy3b2bv";
33-
"https://github.com/input-output-hk/cardano-prelude"."bb4ed71ba8e587f672d06edf9d2e376f4b055555" = "00h10l5mmiza9819p9v5q5749nb9pzgi20vpzpy1d34zmh6gf1cj";
34-
"https://github.com/input-output-hk/cardano-wallet"."f6d4db733c4e47ee11683c343b440552f59beff7" = "0gb3zyv3q5v5sd8r29s02yc0brwq5a01is9c0n528391n2r8g1yy";
35-
"https://github.com/input-output-hk/goblins"."cde90a2b27f79187ca8310b6549331e59595e7ba" = "17c88rbva3iw82yg9srlxjv2ia5wjb9cyqw44hik565f5v9svnyg";
36-
"https://github.com/input-output-hk/iohk-monitoring-framework"."46f994e216a1f8b36fe4669b47b2a7011b0e153c" = "1il8fx3misp3650ryj368b3x95ksz01zz3x0z9k00807j93d0ka0";
37-
"https://github.com/input-output-hk/ouroboros-network"."4fac197b6f0d2ff60dc3486c593b68dc00969fbf" = "1b43vbdsr9m3ry1kgag2p2ixpv54gw7a4vvmndxl6knqg8qbsb8b";
38-
"https://github.com/input-output-hk/plutus"."4127e9cd6e889824d724c30eae55033cb50cbf3e" = "186w0x7vk8m8npmsfg9pdkxds0rlj6bmhr8nkgn96rkvaz5azjsb";
39-
"https://github.com/input-output-hk/purescript-bridge"."47a1f11825a0f9445e0f98792f79172efef66c00" = "0da1vn2l6iyfxcjk58qal1l4755v92zi6yppmjmqvxf1gacyf9px";
40-
"https://github.com/input-output-hk/servant-purescript"."44e7cacf109f84984cd99cd3faf185d161826963" = "10pb0yfp80jhb9ryn65a4rha2lxzsn2vlhcc6xphrrkf4x5lhzqc";
41-
"https://github.com/input-output-hk/Win32-network"."3825d3abf75f83f406c1f7161883c438dac7277d" = "19wahfv726fa3mqajpqdqhnl9ica3xmf68i254q45iyjcpj1psqx";
42-
"https://github.com/Quid2/flat"."ee59880f47ab835dbd73bea0847dab7869fc20d8" = "1lrzknw765pz2j97nvv9ip3l1mcpf2zr4n56hwlz0rk7wq7ls4cm";
43-
};
24+
sha256map = import ./sha256map.nix;
4425

4526
modules = [
4627
{
@@ -59,4 +40,4 @@ let
5940
inherit source-repo-override;
6041
};
6142
in
62-
project
43+
project

nix/pkgs/haskell/sha256map.nix

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"https://github.com/input-output-hk/plutus-apps.git"."v0.1.0" = "1pcxv8l4rgwi0sa3ygq1ag1hyxj61rh03ij5mws78hax09p16vl4";
3+
"https://github.com/input-output-hk/ekg-forward"."297cd9db5074339a2fb2e5ae7d0780debb670c63" = "1zcwry3y5rmd9lgxy89wsb3k4kpffqji35dc7ghzbz603y1gy24g";
4+
"https://github.com/input-output-hk/cardano-addresses"."71006f9eb956b0004022e80aadd4ad50d837b621" = "11dl3fmq7ry5wdmz8kw07ji8yvrxnrsf7pgilw5q9mi4aqyvnaqk";
5+
"https://github.com/input-output-hk/cardano-base"."41545ba3ac6b3095966316a99883d678b5ab8da8" = "0icq9y3nnl42fz536da84414av36g37894qnyw4rk3qkalksqwir";
6+
"https://github.com/input-output-hk/cardano-config"."e9de7a2cf70796f6ff26eac9f9540184ded0e4e6" = "1wm1c99r5zvz22pdl8nhkp13falvqmj8dgkm8fxskwa9ydqz01ld";
7+
"https://github.com/input-output-hk/cardano-crypto"."f73079303f663e028288f9f4a9e08bcca39a923e" = "1n87i15x54s0cjkh3nsxs4r1x016cdw1fypwmr68936n3xxsjn6q";
8+
"https://github.com/input-output-hk/cardano-ledger"."1a9ec4ae9e0b09d54e49b2a40c4ead37edadcce5" = "0avzyiqq0m8njd41ck9kpn992yq676b1az9xs77977h7cf85y4wm";
9+
"https://github.com/input-output-hk/cardano-node"."2b1d18c6c7b7142d9eebfec34da48840ed4409b6" = "102pj525ysvj27h9nb8gidxm1cmwp8vpdyfnpwm1ywz3zkpk2mjp";
10+
"https://github.com/input-output-hk/cardano-prelude"."bb4ed71ba8e587f672d06edf9d2e376f4b055555" = "00h10l5mmiza9819p9v5q5749nb9pzgi20vpzpy1d34zmh6gf1cj";
11+
"https://github.com/input-output-hk/cardano-wallet"."f6d4db733c4e47ee11683c343b440552f59beff7" = "0gb3zyv3q5v5sd8r29s02yc0brwq5a01is9c0n528391n2r8g1yy";
12+
"https://github.com/input-output-hk/goblins"."cde90a2b27f79187ca8310b6549331e59595e7ba" = "17c88rbva3iw82yg9srlxjv2ia5wjb9cyqw44hik565f5v9svnyg";
13+
"https://github.com/input-output-hk/iohk-monitoring-framework"."46f994e216a1f8b36fe4669b47b2a7011b0e153c" = "1il8fx3misp3650ryj368b3x95ksz01zz3x0z9k00807j93d0ka0";
14+
"https://github.com/input-output-hk/ouroboros-network"."4fac197b6f0d2ff60dc3486c593b68dc00969fbf" = "1b43vbdsr9m3ry1kgag2p2ixpv54gw7a4vvmndxl6knqg8qbsb8b";
15+
"https://github.com/input-output-hk/plutus"."6d9ac7c2f89363d574dbc10be5c2db4b661c9a43" = "1678c7fgd7sn8wfd8bpv60wqnfla3vijyb9n6x6d2d2mfiri6p9c";
16+
"https://github.com/input-output-hk/purescript-bridge"."47a1f11825a0f9445e0f98792f79172efef66c00" = "0da1vn2l6iyfxcjk58qal1l4755v92zi6yppmjmqvxf1gacyf9px";
17+
"https://github.com/input-output-hk/servant-purescript"."44e7cacf109f84984cd99cd3faf185d161826963" = "10pb0yfp80jhb9ryn65a4rha2lxzsn2vlhcc6xphrrkf4x5lhzqc";
18+
"https://github.com/input-output-hk/Win32-network"."3825d3abf75f83f406c1f7161883c438dac7277d" = "19wahfv726fa3mqajpqdqhnl9ica3xmf68i254q45iyjcpj1psqx";
19+
"https://github.com/Quid2/flat"."ee59880f47ab835dbd73bea0847dab7869fc20d8" = "1lrzknw765pz2j97nvv9ip3l1mcpf2zr4n56hwlz0rk7wq7ls4cm";
20+
"https://github.com/raduom/hysterical-screams"."4c523469e9efd3f0d10d17da3304923b7b0e0674" = "0w118v4vffrsjxfmwfv8qcn2qxmxpd1gxwcjnda91qz09jnpg0vp";
21+
"https://github.com/input-output-hk/quickcheck-dynamic"."c272906361471d684440f76c297e29ab760f6a1e" = "sha256-TioJQASNrQX6B3n2Cv43X2olyT67//CFQqcpvNW7N60=";
22+
}

nix/sources.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"plutus-apps": {
3-
"branch": "v2022-04-06",
4-
"description": "The Plutus application platform",
3+
"branch": "v0.1.0",
4+
"description": "The Plutus Application Platform",
55
"homepage": "",
66
"owner": "input-output-hk",
77
"repo": "plutus-apps",
8-
"rev": "e4062bca213f233cdf9822833b07aa69dff6d22a",
9-
"sha256": "13yg3vb6a6gmjawlfa3wam5c6krqm7lip4w1p0j30hflca23x2h2",
8+
"rev": "v0.1.0",
9+
"sha256": "1pcxv8l4rgwi0sa3ygq1ag1hyxj61rh03ij5mws78hax09p16vl4",
1010
"type": "tarball",
11-
"url": "https://github.com/input-output-hk/plutus-apps/archive/e4062bca213f233cdf9822833b07aa69dff6d22a.tar.gz",
11+
"url": "https://github.com/input-output-hk/plutus-apps/archive/v0.1.0.tar.gz",
1212
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
1313
}
1414
}

plutus-starter.cabal

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ library
5656
plutus-ledger-constraints -any,
5757
plutus-tx -any,
5858
plutus-tx-plugin -any,
59+
plutus-script-utils -any,
5960
text -any,
6061
lens -any,
6162
hs-source-dirs: src examples/src
@@ -80,7 +81,7 @@ test-suite plutus-example-projects-test
8081
tasty-hunit -any,
8182
text -any,
8283
tasty-hedgehog >=0.2.0.0
83-
84+
8485

8586
executable plutus-starter-pab
8687
import: lang

0 commit comments

Comments
 (0)