From 3412d474833e9b9ca80cbb0a9b039b38923f4e93 Mon Sep 17 00:00:00 2001 From: Richard Marko Date: Wed, 9 Feb 2022 16:18:17 +0100 Subject: [PATCH] pab-nami updates (#303) * nix: export pab-setup-invoker from pab-nami/client/default.nix * pab-nami: add argonaut to spago.dhall * pab-nami: spago2nix * pab-nami: generate purescript Ord instance for DemoContract --- .../demo/pab-nami/client/default.nix | 2 +- .../client/generated/DemoContract.purs | 2 + .../demo/pab-nami/client/spago-packages.nix | 132 +++++++++--------- .../demo/pab-nami/client/spago.dhall | 1 + .../demo/pab-nami/pab/app/DemoContract.hs | 4 +- 5 files changed, 72 insertions(+), 69 deletions(-) diff --git a/plutus-pab-executables/demo/pab-nami/client/default.nix b/plutus-pab-executables/demo/pab-nami/client/default.nix index c8c7ea4921..691b6274bb 100644 --- a/plutus-pab-executables/demo/pab-nami/client/default.nix +++ b/plutus-pab-executables/demo/pab-nami/client/default.nix @@ -57,5 +57,5 @@ let }); in { - inherit client pab-nami-demo-invoker pab-nami-demo-generator generate-purescript generated-purescript start-backend; + inherit client pab-nami-demo-invoker pab-nami-demo-generator pab-setup-invoker generate-purescript generated-purescript start-backend; } diff --git a/plutus-pab-executables/demo/pab-nami/client/generated/DemoContract.purs b/plutus-pab-executables/demo/pab-nami/client/generated/DemoContract.purs index ed05c22648..98a038c149 100644 --- a/plutus-pab-executables/demo/pab-nami/client/generated/DemoContract.purs +++ b/plutus-pab-executables/demo/pab-nami/client/generated/DemoContract.purs @@ -29,6 +29,8 @@ data DemoContract = DemoContract derive instance Eq DemoContract +derive instance Ord DemoContract + instance Show DemoContract where show a = genericShow a diff --git a/plutus-pab-executables/demo/pab-nami/client/spago-packages.nix b/plutus-pab-executables/demo/pab-nami/client/spago-packages.nix index 8c40c18d9b..3999a1bca6 100644 --- a/plutus-pab-executables/demo/pab-nami/client/spago-packages.nix +++ b/plutus-pab-executables/demo/pab-nami/client/spago-packages.nix @@ -53,6 +53,18 @@ let installPhase = "ln -s $src $out"; }; + "argonaut" = pkgs.stdenv.mkDerivation { + name = "argonaut"; + version = "v8.0.0"; + src = pkgs.fetchgit { + url = "https://github.com/purescript-contrib/purescript-argonaut.git"; + rev = "e5137df76065c14e5de70c4e2820222bd7c78fc2"; + sha256 = "05sq1102rl1phm2gadx0gp966yvk9q1r492bb30q1m0nz762q4v2"; + }; + phases = "installPhase"; + installPhase = "ln -s $src $out"; + }; + "argonaut-codecs" = pkgs.stdenv.mkDerivation { name = "argonaut-codecs"; version = "v8.1.0"; @@ -77,6 +89,18 @@ let installPhase = "ln -s $src $out"; }; + "argonaut-traversals" = pkgs.stdenv.mkDerivation { + name = "argonaut-traversals"; + version = "v9.0.0"; + src = pkgs.fetchgit { + url = "https://github.com/purescript-contrib/purescript-argonaut-traversals.git"; + rev = "36f2e368ceea1ed681bd8e2884eaca451945fc44"; + sha256 = "0bj88s7rz50jfhyawq4h97lvbr3h7pksbqnz4lmh714f5fda6ncx"; + }; + phases = "installPhase"; + installPhase = "ln -s $src $out"; + }; + "arraybuffer" = pkgs.stdenv.mkDerivation { name = "arraybuffer"; version = "v11.0.1"; @@ -785,54 +809,6 @@ let installPhase = "ln -s $src $out"; }; - "node-fs" = pkgs.stdenv.mkDerivation { - name = "node-fs"; - version = "v6.1.0"; - src = pkgs.fetchgit { - url = "https://github.com/purescript-node/purescript-node-fs.git"; - rev = "09a2b71a3a86f0cd19c46f4b6c40310cc1648909"; - sha256 = "1w97m2afn7yn757niknkbk7w6nyg4n5dabxr7gzfz368z1nkf45s"; - }; - phases = "installPhase"; - installPhase = "ln -s $src $out"; - }; - - "node-path" = pkgs.stdenv.mkDerivation { - name = "node-path"; - version = "v4.0.0"; - src = pkgs.fetchgit { - url = "https://github.com/purescript-node/purescript-node-path.git"; - rev = "a2d7cf05e40b607ef7d048a3684cda788cd42890"; - sha256 = "1384qyf4v84wbahafzvqdxjllqy8qkd5dpkhsl3js444vsm2aplr"; - }; - phases = "installPhase"; - installPhase = "ln -s $src $out"; - }; - - "node-process" = pkgs.stdenv.mkDerivation { - name = "node-process"; - version = "v8.2.0"; - src = pkgs.fetchgit { - url = "https://github.com/purescript-node/purescript-node-process.git"; - rev = "e1e807ac7831d1a8a15e242964f7e5005e42f76b"; - sha256 = "0nl9r271s8f71a9wqfkadq9b490h8phwgqc61jbzhm4ags23pqpg"; - }; - phases = "installPhase"; - installPhase = "ln -s $src $out"; - }; - - "node-streams" = pkgs.stdenv.mkDerivation { - name = "node-streams"; - version = "v5.0.0"; - src = pkgs.fetchgit { - url = "https://github.com/purescript-node/purescript-node-streams.git"; - rev = "886bb2045685e3b9031687d69ccfed29972147bb"; - sha256 = "1jc3d4x0v77h8qcwq7hpwprsdr3gqmdfiyr1ph0kiy7r9bbrqwfx"; - }; - phases = "installPhase"; - installPhase = "ln -s $src $out"; - }; - "nonempty" = pkgs.stdenv.mkDerivation { name = "nonempty"; version = "v6.0.0"; @@ -953,18 +929,6 @@ let installPhase = "ln -s $src $out"; }; - "posix-types" = pkgs.stdenv.mkDerivation { - name = "posix-types"; - version = "v5.0.0"; - src = pkgs.fetchgit { - url = "https://github.com/purescript-node/purescript-posix-types.git"; - rev = "e562680fce64b67e26741a61a51160a04fd3e7fb"; - sha256 = "1knhdnnmxx77qsjz3gk1ga7n713l303dxyn8zs46qh7p2hnkalkc"; - }; - phases = "installPhase"; - installPhase = "ln -s $src $out"; - }; - "precise" = pkgs.stdenv.mkDerivation { name = "precise"; version = "v5.1.0"; @@ -1037,6 +1001,18 @@ let installPhase = "ln -s $src $out"; }; + "quickcheck-laws" = pkgs.stdenv.mkDerivation { + name = "quickcheck-laws"; + version = "v6.0.1"; + src = pkgs.fetchgit { + url = "https://github.com/purescript-contrib/purescript-quickcheck-laws.git"; + rev = "464597522e5e001adc2619676584871f423b9ea0"; + sha256 = "1m397bh2w5a0wvms8rjgfxh71m7krmfkgk11j5krhz86b72k3izd"; + }; + phases = "installPhase"; + installPhase = "ln -s $src $out"; + }; + "random" = pkgs.stdenv.mkDerivation { name = "random"; version = "v5.0.0"; @@ -1099,11 +1075,11 @@ let "servant-support" = pkgs.stdenv.mkDerivation { name = "servant-support"; - version = "78a0693a9409bce31bf538a8f2aa54adb8200733"; + version = "1fcf4e93723f7f5d36476735b76888938ced871e"; src = pkgs.fetchgit { url = "https://github.com/input-output-hk/purescript-servant-support"; - rev = "78a0693a9409bce31bf538a8f2aa54adb8200733"; - sha256 = "11x6lzv6a9yp5ccdi6fay931brm8cfacg3kmi4rphgdg01037cn6"; + rev = "1fcf4e93723f7f5d36476735b76888938ced871e"; + sha256 = "1p16vp5yfc9xffbmcv7rdg9s1q1nn5mxp6pgyxkz67v527gdj625"; }; phases = "installPhase"; installPhase = "ln -s $src $out"; @@ -1169,6 +1145,18 @@ let installPhase = "ln -s $src $out"; }; + "these" = pkgs.stdenv.mkDerivation { + name = "these"; + version = "v5.0.0"; + src = pkgs.fetchgit { + url = "https://github.com/purescript-contrib/purescript-these.git"; + rev = "38dcf86a9bd772091e1153f2f1c13223703599b7"; + sha256 = "0d6yg3lwgralh1kcm5cd4myyz66k9qzld61hc5dg3z92d96zbvlr"; + }; + phases = "installPhase"; + installPhase = "ln -s $src $out"; + }; + "transformers" = pkgs.stdenv.mkDerivation { name = "transformers"; version = "v5.2.0"; @@ -1289,6 +1277,18 @@ let installPhase = "ln -s $src $out"; }; + "uri" = pkgs.stdenv.mkDerivation { + name = "uri"; + version = "v8.0.1"; + src = pkgs.fetchgit { + url = "https://github.com/purescript-contrib/purescript-uri.git"; + rev = "d56b9c24933e40b523a0d64e272f3b9f603a1f7c"; + sha256 = "095svp82ik9574klx8s7vjsw34d4psda1hniqnhb75jkycspmqzw"; + }; + phases = "installPhase"; + installPhase = "ln -s $src $out"; + }; + "uuid" = pkgs.stdenv.mkDerivation { name = "uuid"; version = "v8.0.0"; @@ -1339,11 +1339,11 @@ let "web-common" = pkgs.stdenv.mkDerivation { name = "web-common"; - version = "v1.1.3"; + version = "v2.0.1"; src = pkgs.fetchgit { url = "https://github.com/input-output-hk/purescript-web-common"; - rev = "f6ba33c8543e5c830592f86e94b3e89ca117e602"; - sha256 = "10hsvndlvag0c89gwn6hmiiar45cifl1416b0psbvqjdjqbmhvv0"; + rev = "fa101cd785ef6aa2f7aa908b38c2195aa2c2ff3d"; + sha256 = "0sbngaydgrmn948hyvx1ifdanvph1wchsdmjmvc1b25z2zrdc74q"; }; phases = "installPhase"; installPhase = "ln -s $src $out"; diff --git a/plutus-pab-executables/demo/pab-nami/client/spago.dhall b/plutus-pab-executables/demo/pab-nami/client/spago.dhall index 51008322a8..8bcf077a17 100644 --- a/plutus-pab-executables/demo/pab-nami/client/spago.dhall +++ b/plutus-pab-executables/demo/pab-nami/client/spago.dhall @@ -3,6 +3,7 @@ [ "aff" , "aff-promise" , "affjax" + , "argonaut" , "argonaut-codecs" , "argonaut-core" , "arraybuffer" diff --git a/plutus-pab-executables/demo/pab-nami/pab/app/DemoContract.hs b/plutus-pab-executables/demo/pab-nami/pab/app/DemoContract.hs index b31ed02cbf..2c73c0c002 100644 --- a/plutus-pab-executables/demo/pab-nami/pab/app/DemoContract.hs +++ b/plutus-pab-executables/demo/pab-nami/pab/app/DemoContract.hs @@ -19,7 +19,7 @@ import Data.Aeson (FromJSON, ToJSON) import Data.OpenApi qualified as OpenApi import Data.Void (Void) import GHC.Generics (Generic) -import Language.PureScript.Bridge (argonaut, equal, genericShow, mkSumType) +import Language.PureScript.Bridge (argonaut, equal, genericShow, mkSumType, order) import Ledger (PaymentPubKeyHash, StakePubKeyHash, Value) import Ledger.Constraints (adjustUnbalancedTx, mustPayToPubKeyAddress) import Playground.Types (FunctionSchema) @@ -39,7 +39,7 @@ instance Pretty DemoContract where instance HasPSTypes DemoContract where psTypes = - [ equal . genericShow . argonaut $ mkSumType @DemoContract + [ order . equal . genericShow . argonaut $ mkSumType @DemoContract ]