Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into fiuba-collaboration-w…
Browse files Browse the repository at this point in the history
…riting-actus-contracts
  • Loading branch information
yveshauser committed Jan 26, 2022
2 parents 292e3f8 + 24817b4 commit 829eb56
Show file tree
Hide file tree
Showing 509 changed files with 47,034 additions and 6,080 deletions.
62 changes: 53 additions & 9 deletions .github/workflows/test.yml
@@ -1,6 +1,17 @@
name: "Tests"
env:
CACHE_NAME: marlowe-temp
ALLOWED_URIS: "https://github.com https://api.github.com"
TRUSTED_PUBLIC_KEYS: "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= marlowe-temp.cachix.org-1:1gPjVFpu4QjaAT3tRurCioX+BC23V7mjvFwpP5bV0Ec="
SUBSTITUTERS: "https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/ https://marlowe-temp.cachix.org"
on:
pull_request:
push:
branches-ignore:
- main # staging
- production
- deploy-hernan
- deploy-pablo
- shlevy
jobs:
nix-instantiate:
strategy:
Expand All @@ -9,23 +20,56 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2.3.4
- uses: nixbuild/nix-quick-install-action@v8
- run: nix-instantiate release.nix --arg checkMaterialization true --arg supportedSystems '[ builtins.currentSystem ]' --restrict-eval -I . --allowed-uris 'https://github.com/NixOS/nixpkgs https://github.com/input-output-hk https://github.com/NixOS/nixpkgs-channels' --option trusted-public-keys "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" --option substituters "https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/" --show-trace
nix-tests:
- uses: cachix/install-nix-action@v16
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v10
with:
name: ${{ env.CACHE_NAME }}
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- run: nix-instantiate release.nix --arg checkMaterialization true --arg supportedSystems '[ builtins.currentSystem ]' --restrict-eval -I . --allowed-uris '${{ env.ALLOWED_URIS }}' --option trusted-public-keys "${{ env.TRUSTED_PUBLIC_KEYS }}" --option substituters "${{ env.SUBSTITUTERS }}"
nix-code-formatting:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2.3.4
- uses: nixbuild/nix-quick-install-action@v8
- run: nix-build -A tests.nixpkgsFmt -A tests.pursTidy -A tests.prettier -A tests.shellcheck -A tests.stylishHaskell --arg supportedSystems '[ builtins.currentSystem ]' --restrict-eval -I . --allowed-uris 'https://github.com/NixOS/nixpkgs https://github.com/input-output-hk https://github.com/NixOS/nixpkgs-channels https://github.com/edolstra/flake-compat https://api.github.com/repos' --option trusted-public-keys "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" --option substituters "https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/"
hydra-workaround:
- uses: cachix/install-nix-action@v16
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v10
with:
name: ${{ env.CACHE_NAME }}
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- run: nix-build -A tests.nixpkgsFmt -A tests.pursTidy -A tests.prettier -A tests.shellcheck -A tests.stylishHaskell --arg supportedSystems '[ builtins.currentSystem ]' --restrict-eval -I . --allowed-uris '${{ env.ALLOWED_URIS }}' --option trusted-public-keys "${{ env.TRUSTED_PUBLIC_KEYS }}" --option substituters "${{ env.SUBSTITUTERS }}"
nix-code-generation:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2.3.4
- uses: nixbuild/nix-quick-install-action@v8
- run: nix-build release.nix -A required --arg checkMaterialization true --arg supportedSystems '[ builtins.currentSystem ]' --restrict-eval -I . --allowed-uris 'https://github.com/NixOS/nixpkgs https://github.com/input-output-hk https://github.com/NixOS/nixpkgs-channels' --option trusted-public-keys "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" --option substituters "https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/" --show-trace
- uses: cachix/install-nix-action@v16
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v10
with:
name: ${{ env.CACHE_NAME }}
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- run: nix-build -A tests.generated --arg supportedSystems '[ builtins.currentSystem ]' --restrict-eval -I . --allowed-uris '${{ env.ALLOWED_URIS }}' --option trusted-public-keys "${{ env.TRUSTED_PUBLIC_KEYS }}" --option substituters "${{ env.SUBSTITUTERS }}"
check-for-updates:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2.3.4
- uses: nixbuild/nix-quick-install-action@v9
- run: |
nix --extra-experimental-features 'nix-command flakes' flake lock --option trusted-public-keys "${{ env.TRUSTED_PUBLIC_KEYS }}" --option substituters "${{ env.SUBSTITUTERS }}"
nix-shell --command "cd marlowe-playground-client && (update-client-deps || update-client-deps)" --option trusted-public-keys "${{ env.TRUSTED_PUBLIC_KEYS }}" --option substituters "${{ env.SUBSTITUTERS }}" # Double-call to work around bug in spago2nix on first fetch
nix-shell --command "cd marlowe-dashboard-client && (update-client-deps || update-client-deps)" --option trusted-public-keys "${{ env.TRUSTED_PUBLIC_KEYS }}" --option substituters "${{ env.SUBSTITUTERS }}" # Double-call to work around bug in spago2nix on first fetch
# Disabled until we can find a way to run it only for Linux
# nix-shell --command "updateMaterialized" --option trusted-public-keys "${{ env.TRUSTED_PUBLIC_KEYS }}" --option substituters "${{ env.SUBSTITUTERS }}"
git diff --exit-code
4 changes: 1 addition & 3 deletions .gitignore
Expand Up @@ -68,10 +68,8 @@ pkgs/.stack
*.code-workspace
.*.sw*

# Frontend generated files (NPM/Yarn, Spago, generated PS, etc.)
# Frontend files (NPM/Yarn, Spago, etc.)
# N.B. officially we use NPM; ignoring Yarn files allows the local use of Yarn for those that want
**/generated
**/generated/
**/generated-docs/
**/node_modules/
**/output/
Expand Down
3 changes: 2 additions & 1 deletion bitte/pab.nix
Expand Up @@ -8,7 +8,7 @@

{ writeShellScriptBin, writeText, pabExe, staticPkg, cacert, coreutils, lib, gnused, utillinux, wait-for-socket }:
let
slotZeroTime = 1596059091000; # POSIX time of slot zeron is milliseconds. See note [Datetime to slot] in Marlowe.Slot
slotZeroTime = 1638215277000; # POSIX time of slot zeron is milliseconds. See note [Datetime to slot] in Marlowe.Slot
slotLengthMillis = 1000;

constantFee = 10; # Constant fee per transaction in lovelace
Expand Down Expand Up @@ -48,6 +48,7 @@ let
mscKeptBlocks = 100000;
mscInitialTxWallets = [ ];
mscNodeMode = "AlonzoNode";
mscProtocolParametersJsonPath = ../marlowe-dashboard-client/private-testnet.protocol;
};

chainIndexConfig = {
Expand Down
68 changes: 50 additions & 18 deletions cabal.project
@@ -1,12 +1,13 @@
-- Bump this if you need newer packages
index-state: 2021-08-14T00:00:00Z
index-state: 2021-10-20T00:00:00Z

packages: doc
marlowe
marlowe-actus
marlowe-playground-server
marlowe-dashboard-server
marlowe-symbolic
marlowe-cli

-- We never, ever, want this.
write-ghc-environment-files: never
Expand Down Expand Up @@ -36,6 +37,9 @@ constraints:
-- 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
-- Newer Hashable have instances for Set, which breaks beam-migrate
-- which declares its own instances of Hashable Set
, hashable < 1.3.4.0

-- Copied from plutus-apps
package cardano-ledger-alonzo
Expand All @@ -46,6 +50,16 @@ 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-apps
source-repository-package
Expand All @@ -63,19 +77,21 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/servant-purescript.git
tag: 1abfc8ad0ed56b3159a5fffc556f65a2145493b9
tag: 6746a0bd441e90978669cc6a229cbeb1220d4a1c

-- Copied from plutus-apps
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-crypto.git
tag: 07397f0e50da97eaa0575d93bee7ac4b2b2576ec
tag: f73079303f663e028288f9f4a9e08bcca39a923e
--sha256: 1n87i15x54s0cjkh3nsxs4r1x016cdw1fypwmr68936n3xxsjn6q

-- Copied from plutus-apps
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-base
tag: 4ea7e2d927c9a7f78ddc69738409a5827ab66b98
tag: 654f5b7c76f7cc57900b4ddc664a82fc3b925fb0
--sha256: 0j4x9zbx5dkww82sqi086h39p456iq5xr476ylmrnpwcpfb4xai4
subdir:
base-deriving-via
binary
Expand All @@ -88,11 +104,12 @@ source-repository-package
slotting
strict-containers

-- Copied from plutus-apps
-- Copied from plutus-core
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-prelude
tag: fd773f7a58412131512b9f694ab95653ac430852
tag: bb4ed71ba8e587f672d06edf9d2e376f4b055555
--sha256: 00h10l5mmiza9819p9v5q5749nb9pzgi20vpzpy1d34zmh6gf1cj
subdir:
cardano-prelude
cardano-prelude-test
Expand All @@ -109,9 +126,11 @@ source-repository-package
-- Copied from plutus-apps
source-repository-package
type: git
location: https://github.com/j-mueller/cardano-wallet
tag: 6be73ab852c0592713dfe78218856d4a8a0ee69e
location: https://github.com/input-output-hk/cardano-wallet
tag: 760140e238a5fbca61d1b286d7a80ece058dc729
--sha256: 014njpddrlqm9bbab636h2gf58zkm0bx04i1jsn07vh5j3k0gri6
subdir:
lib/dbvar
lib/text-class
lib/strict-non-empty-containers
lib/core
Expand All @@ -126,7 +145,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/ouroboros-network
tag: 1f4973f36f689d6da75b5d351fb124d66ef1057d
tag: d613de3d872ec8b4a5da0c98afb443f322dc4dab
--sha256: 0lfbipfdrzay8v1pcazx0qgkda3d1j0505yig9jrml9j7991rmhl
subdir:
monoidal-synchronisation
typed-protocols
Expand Down Expand Up @@ -172,8 +192,9 @@ source-repository-package
-- Copied from plutus-apps
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-ledger-specs
location: https://github.com/input-output-hk/cardano-ledger
tag: bf008ce028751cae9fb0b53c3bef20f07c06e333
--sha256: 0my3801w1vinc0kf5yh9lxl6saqxgwm6ccg0vvzi104pafcwwcqx
subdir:
byron/ledger/impl
cardano-ledger-core
Expand All @@ -194,19 +215,25 @@ source-repository-package
libs/cardano-ledger-pretty
semantics/small-steps-test


-- A lot of marlowe 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.
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-node.git
tag: b6ca519f97a0e795611a63174687e6bb70c9f752
tag: 4f65fb9a27aa7e3a1873ab4211e412af780a3648
--sha256: 00k9fqrm0gphjji23x0nc9z6bqh8bqrncgivn3mi3csacjzicrrx
subdir:
cardano-api
cardano-node
cardano-cli
cardano-config

-- Copied from plutus-apps
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-config
tag: e9de7a2cf70796f6ff26eac9f9540184ded0e4e6
--sha256: 1wm1c99r5zvz22pdl8nhkp13falvqmj8dgkm8fxskwa9ydqz01ld

-- Copied from plutus-apps
source-repository-package
Expand Down Expand Up @@ -238,31 +265,36 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/plutus
tag: 3f089ccf0ca746b399c99afe51e063b0640af547
tag: 2721c59fd2302b75c4138456c29fd5b509e8340a
--sha256: 02g8pzldyfl4pm8sy22yd3l2fr3zpyhwkvv9x3h9lsf6lfx5wi7k
subdir:
plutus-core
plutus-ledger-api
plutus-tx
plutus-tx-plugin
word-array
prettyprinter-configurable
stubs/plutus-ghc-stub
plutus-core
plutus-tx
plutus-tx-plugin

-- A lot of marlowe dependencies have to be syncronized with the dependencies of
-- plutus-apps. If you update plutus-apps, please make sure that all dependencies
-- of plutus-apps are also updated
source-repository-package
type: git
location: https://github.com/input-output-hk/plutus-apps
tag: 404af7ac3e27ebcb218c05f79d9a70ca966407c9
tag: 65463b72ffc110bd0762403339c4c72543a99b16
--sha256: 1l5pflzk5y91hzrgdm4mcg3dycgck36pbps6fcr8ahnj8855ghn7
subdir:
freer-extras
playground-common
plutus-chain-index
plutus-chain-index-core
plutus-contract
plutus-ledger
plutus-ledger-constraints
plutus-pab
plutus-pab-executables
plutus-playground-server
plutus-use-cases
quickcheck-dynamic
web-ghc
12 changes: 10 additions & 2 deletions default.nix
Expand Up @@ -39,6 +39,8 @@ rec {

inherit (haskell.packages.marlowe.components.exes) marlowe-pab;

inherit (haskell.packages.marlowe-cli.components.exes) marlowe-cli;

# TODO This stuff should probably be exposed as an overlay in the plutus-apps if
# we switch to flakes.
webCommonPlayground = pkgs.callPackage (sources.plutus-apps + "/web-common-playground") { inherit (marlowe.lib) gitignore-nix; };
Expand All @@ -48,15 +50,19 @@ rec {
inherit (pkgs.callPackage ./marlowe-playground-client {
inherit (marlowe.lib) buildPursPackage buildNodeModules filterNpm gitignore-nix;
inherit haskell webCommon webCommonMarlowe webCommonPlayground;
}) client server generate-purescript start-backend;
inherit (marlowe) purs-tidy;
inherit (pkgs.nodePackages) prettier;
}) client server generated-purescript generate-purescript start-backend;
};

marlowe-dashboard = pkgs.recurseIntoAttrs rec {
inherit (pkgs.callPackage ./marlowe-dashboard-client {
inherit haskell;
inherit (marlowe.lib) buildPursPackage buildNodeModules filterNpm gitignore-nix;
inherit webCommon webCommonMarlowe;
}) client pab-setup-invoker marlowe-invoker marlowe-run-backend-invoker generated-purescript generate-purescript start-backend;
inherit (marlowe) purs-tidy;
inherit (pkgs.nodePackages) prettier;
}) client marlowe-setup-invoker marlowe-invoker marlowe-run-backend-invoker generated-purescript generate-purescript start-backend;
};

tests = import ./nix/tests/default.nix {
Expand All @@ -66,6 +72,8 @@ rec {
inherit (haskell) plutus-pab;
inherit marlowe-playground marlowe-dashboard web-ghc marlowe-pab;
src = ./.;
run-generated = marlowe-dashboard.generated-purescript;
play-generated = marlowe-playground.generated-purescript;
};

docs = import ./nix/docs.nix { inherit pkgs marlowe; };
Expand Down
3 changes: 2 additions & 1 deletion doc/plutus-doc.cabal
Expand Up @@ -27,7 +27,7 @@ common lang
default-extensions: ExplicitForAll ScopedTypeVariables
DeriveGeneric StandaloneDeriving DeriveLift
GeneralizedNewtypeDeriving DeriveFunctor DeriveFoldable
DeriveTraversable MultiParamTypeClasses
DeriveTraversable MultiParamTypeClasses ImportQualifiedPost
ghc-options: -Wall -Wnoncanonical-monad-instances
-Wincomplete-uni-patterns -Wincomplete-record-updates
-Wredundant-constraints -Widentities
Expand Down Expand Up @@ -65,6 +65,7 @@ executable doc-doctests
plutus-tx -any,
plutus-ledger -any,
plutus-ledger-api -any,
plutus-ledger-constraints -any,
plutus-contract -any,
playground-common -any,
plutus-use-cases -any,
Expand Down
2 changes: 1 addition & 1 deletion doc/plutus/explanations/order-book-pattern.rst
Expand Up @@ -61,7 +61,7 @@ The original application matches buyers and sellers of currency values, but ther
Off-chain oracles
~~~~~~~~~~~~~~~~~

Imagine a Plutus script that says "If you give me a the current USD/EUR exchange rate signed by a specific private key, then I will pay you 5 ADA (and use the exchange rate to run the rest of my `$BUSINESS_LOGIC`)".
Imagine a Plutus script that says "If you give me the current USD/EUR exchange rate signed by a specific private key, then I will pay you 5 ADA (and use the exchange rate to run the rest of my `$BUSINESS_LOGIC`)".
The match maker then builds a transaction that combines the oracle value with the Plutus script.
Of course this example requires the match maker to be able to obtain the signed value, but it does succeed in decoupling consumers of the information from producers.

Expand Down

0 comments on commit 829eb56

Please sign in to comment.