Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to PureScript 0.15 #1521

Merged
merged 101 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from 95 commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
c40c786
build: update `purs`, update `spago`, upgrade package-set
errfrom Jun 29, 2023
5d0d316
build: update `medea` and `sequences` deps, remove `math`
errfrom Jun 29, 2023
dcc6a7c
build: update `bignumber` dependency, fix `flake.nix`
errfrom Jun 29, 2023
87606c0
build: update `aeson` dependency
errfrom Jun 29, 2023
36c0ce2
build: update `noble-secp256k1` dependency
errfrom Jun 30, 2023
cc5dc89
build: update `toppokki` dependency
errfrom Jun 30, 2023
1f2f31e
build: use esm exports, fix aeson instances for `Plutus.AssocMap`
errfrom Jun 30, 2023
856ed1d
build: select affjax driver based on environment (node or browser)
errfrom Jun 30, 2023
4c66024
style: fix formatting
errfrom Jun 30, 2023
b41ca18
build: bump `purs` to v0.15.8
errfrom Jun 30, 2023
8cb2766
build: fix `ToData` and `FromData` instances
errfrom Jul 3, 2023
43678ef
build: use `frequency` with `NonEmptyArray`
errfrom Jul 3, 2023
389c5ce
build: use `exists` from `Node.FS.Sync` (ctl compiles!)
errfrom Jul 3, 2023
3ac0f74
build: multiple changes
errfrom Jul 4, 2023
6e061e1
build: fix `package.json`, re-gen `spago-packages.nix`, fix formatting
errfrom Jul 4, 2023
0cb50b1
chore: fix warnings
errfrom Jul 4, 2023
ba71dfa
build: fix plutip tests
errfrom Jul 5, 2023
682badc
build: bundle and serve using `esbuild`
errfrom Jul 6, 2023
ae495bd
style: fix formatting
errfrom Jul 6, 2023
a7799f2
style: remove unused imports
errfrom Jul 6, 2023
6f2758b
build: use `esm` imports in `nix/default.nix`
errfrom Jul 6, 2023
084ca27
build: use `esm` imports in `nix/default.nix`
errfrom Jul 6, 2023
fe138b0
build: create `node_modules` symlink for `NODE_PATH`
errfrom Jul 6, 2023
70e3356
build: disable md link check for `the-plutus-scaffold`
errfrom Jul 6, 2023
1b3b13d
fix: fix unit tests
errfrom Jul 6, 2023
7993b9f
build: bundle using `esbuild` for e2e tests
errfrom Jul 6, 2023
ef1441b
build: use dynamic imports when selecting affjax driver
errfrom Jul 6, 2023
d1f1e1d
build: update `templates/ctl-scaffold`
errfrom Jul 7, 2023
5a80b60
build: update dependencies
errfrom Jul 7, 2023
e5c6014
build: drop `sequences` dependency
errfrom Jul 7, 2023
218b70c
build: fix bundling using `webpack`
errfrom Jul 11, 2023
b7a151f
Use CSL version with GC
klntsky Aug 1, 2023
ebe2c7b
Update docs
klntsky Aug 4, 2023
35debff
Do not store scripts in external files
klntsky Aug 8, 2023
812afec
Fix unit tests
klntsky Aug 9, 2023
ccc7466
Update the template
klntsky Aug 9, 2023
325665b
Update NodeJS deps in the template
klntsky Aug 9, 2023
b462b65
Update CTL revision in the CTL template
klntsky Aug 9, 2023
fd65ad4
Update the template and docs
klntsky Aug 10, 2023
7139e1e
WIP
klntsky Sep 13, 2023
f1514a1
Merge remote-tracking branch 'origin/develop' into dshuiski/purs-0.15…
klntsky Oct 6, 2023
f318a77
Update spago dependencies, fix broken link
klntsky Oct 6, 2023
b764665
Fix 'Invalid "exports" main target "index.js" defined in the package …
klntsky Oct 6, 2023
0c314cc
Fix toppoki dependency
klntsky Oct 6, 2023
62faa6e
Inline script contents in ApplyArgs example to avoid bundling files
klntsky Oct 6, 2023
d51471f
Move Blockfrost API key setup to the core of the lib
klntsky Oct 10, 2023
2c01b2d
Synchronize webpack config in the template
klntsky Oct 10, 2023
5072d03
WIP: refactor bundling; let bundle* commands produce just the bundle
klntsky Oct 11, 2023
3565be1
Only enable blockfrost examples if blockfrost key is set
klntsky Oct 11, 2023
3c7c67d
Separate building of deps and sources in nix
klntsky Oct 12, 2023
1604657
Move compilers to nativeBuildInputs
klntsky Oct 12, 2023
29695e6
Rewrite the bundling system (Nix & Makefile)
klntsky Oct 13, 2023
eb8e7e8
Fix internal module name (Ctl.Internal.Test.E2E.Route)
klntsky Oct 13, 2023
0825b1b
Remove html-webpack-plugin dependency
klntsky Oct 13, 2023
bf1de19
Simplify esbuild script in nix
klntsky Oct 13, 2023
8014c94
Simplify webpack build script in nix
klntsky Oct 13, 2023
d568417
Synchronize webpack & esbuild setup in the template
klntsky Oct 13, 2023
19be30b
Update template's Makefile
klntsky Oct 13, 2023
d2fe25d
Use JS.BigInt
kozross Oct 16, 2023
c8ce038
Merge pull request #1553 from Plutonomicon/klntsky/refactor-bundling-…
klntsky Oct 17, 2023
6e4debe
Support nodejs bundling. Proxy-pass kupo requests when serving via es…
klntsky Oct 17, 2023
080e06b
Update the template
klntsky Oct 17, 2023
cc808a7
Update formatting rules
klntsky Oct 17, 2023
f3dc557
Merge branch 'dshuiski/purs-0.15-migration' into koz/1472
kozross Oct 17, 2023
73ea867
Merge pull request #1554 from Plutonomicon/klntsky/support-nodejs-bun…
klntsky Oct 20, 2023
f729825
Merge branch 'dshuiski/purs-0.15-migration' into koz/1472
kozross Oct 22, 2023
0ccc85d
Update error message fixtures in plutip tests
klntsky Nov 8, 2023
c677f5f
Use newer purescript-aeson and json-bigint
klntsky Nov 8, 2023
539093d
Remove big-integer runtime dep, update the template
klntsky Nov 8, 2023
fbf56b2
Adds a missing NPM json-bigint upgrade in CTL scaffold
bladyjoker Nov 9, 2023
6b76ffe
Merge pull request #1551 from Plutonomicon/koz/1472
klntsky Nov 9, 2023
dba4895
Merge remote-tracking branch 'origin' into dshuiski/purs-0.15-migration
klntsky Nov 10, 2023
02869ce
Fixes runPursTest setting of `node_modules`
bladyjoker Nov 13, 2023
49766d5
Merge pull request #1557 from Plutonomicon/bladyjoker/runpurstest-fix
klntsky Nov 13, 2023
acbd363
Merge remote-tracking branch 'origin/develop' into dshuiski/purs-0.15…
klntsky Nov 21, 2023
908927e
Update `easy-purscript-nix` nix flake input
aciceri Nov 21, 2023
98de298
Add Hercules CI `flake-update` effect
aciceri Nov 22, 2023
4eebbd4
Update `easy-purscript-nix` nix flake input
aciceri Nov 21, 2023
a0469eb
Fix merge
klntsky Nov 24, 2023
fffaed0
Fix formatting, improve unit test speed
klntsky Nov 25, 2023
46be734
Fix Arion volumes
aciceri Dec 5, 2023
809f3e3
Merge pull request #1561 from Plutonomicon/aciceri/upgrade-easy-pures…
klntsky Dec 5, 2023
865faae
Merge branch 'dshuiski/purs-0.15-migration' of github.com:Plutonomico…
klntsky Dec 5, 2023
a5879fd
Fixes CIP links to https://cips.cardano.org/cip/CIP-...
bladyjoker Dec 11, 2023
7620749
Merge remote-tracking branch 'plutonomicon/develop' into dshuiski/pur…
bladyjoker Dec 11, 2023
cfcaa6c
Trying an upgrade of cardano-node v8.1.1 and pinned cardano-configs
bladyjoker Dec 11, 2023
7a6c763
Trying out plutip?ref=gergley/version-bump
bladyjoker Dec 11, 2023
d86035e
Merge branch 'dshuiski/purs-0.15-migration' of github.com:Plutonomico…
klntsky Dec 11, 2023
ea6c393
Uses cardano-node 8.1.1 from flake inputs in all places (no dockerhub)
bladyjoker Dec 12, 2023
5c97dcf
Uses Kupo from flake inputs and fixes cardano-node
bladyjoker Dec 12, 2023
1666aba
Merge pull request #1573 from Plutonomicon/bladyjoker/upgrading-carda…
klntsky Dec 12, 2023
bec703d
Merge branch 'dshuiski/purs-0.15-migration' of github.com:Plutonomico…
klntsky Dec 13, 2023
8761720
Merge remote-tracking branch 'origin/develop' into dshuiski/purs-0.15…
klntsky Dec 13, 2023
774c005
Remove duplicate logging from plutip
klntsky Dec 13, 2023
7f43c00
Update the template
klntsky Dec 13, 2023
1f2e3a4
Remove searchable docs from nix machinery for now
klntsky Dec 15, 2023
cf8ffac
Update template's .gitignore
klntsky Dec 15, 2023
9f05925
Fix jssha import
klntsky Dec 15, 2023
a742692
Update CHANGELOG, docs and README
klntsky Dec 15, 2023
d78a808
Update the template
klntsky Dec 15, 2023
485cf79
Fix markdown link
klntsky Dec 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ test-data/keys
tmp
node_modules
plutip-server/dist-newstyle/
plutip-server/dist/
plutip-server/.stack-work/

62 changes: 51 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,61 @@
SHELL := bash
.ONESHELL:
.PHONY: run-dev run-build check-format format query-testnet-tip clean check-explicit-exports
.PHONY: esbuild-bundle esbuild-serve webpack-bundle webpack-serve check-format format query-testnet-tip clean check-explicit-exports spago-build create-bundle-entrypoint create-html-entrypoint delete-bundle-entrypoint
.SHELLFLAGS := -eu -o pipefail -c

ps-sources := $(shell fd --no-ignore-parent -epurs)
nix-sources := $(shell fd --no-ignore-parent -enix --exclude='spago*')
js-sources := $(shell fd --no-ignore-parent -ejs)
ps-entrypoint := Ctl.Examples.ByUrl # points to one of the example PureScript modules in examples/
ps-bundle = spago bundle-module -m ${ps-entrypoint} --to output.js
js-sources := $(shell fd --no-ignore-parent -ejs -ecjs)

### Bundler setup

# The main Purescript module
ps-entrypoint := Ctl.Examples.ByUrl
# The entry point function in the main PureScript module
ps-entrypoint-function := main
# Whether to bundle for the browser
browser-runtime := 1 # Use "1" for true and "" for false

preview-node-ipc = $(shell docker volume inspect store_node-preview-ipc | jq -r '.[0].Mountpoint')
preprod-node-ipc = $(shell docker volume inspect store_node-preprod-ipc | jq -r '.[0].Mountpoint')
serve-port := 4008

spago-build:
@spago build

create-bundle-entrypoint:
@mkdir -p dist/
@echo 'import("../output/${ps-entrypoint}/index.js").then(m => m.${ps-entrypoint-function}());' > ./dist/entrypoint.js

run-dev:
@${ps-bundle} && BROWSER_RUNTIME=1 webpack-dev-server --progress
delete-bundle-entrypoint:
@rm -f ./dist/entrypoint.js

run-build:
@${ps-bundle} && BROWSER_RUNTIME=1 webpack --mode=production
create-html-entrypoint:
@mkdir -p dist/
@cat << EOF > dist/index.html
<!DOCTYPE html>
<html>
<body><script type="module" src="./index.js"></script></body>
</html>
EOF

esbuild-bundle: spago-build create-bundle-entrypoint
@mkdir -p dist/
BROWSER_RUNTIME=${browser-runtime} node esbuild/bundle.js ./dist/entrypoint.js dist/index.js
@make delete-bundle-entrypoint

esbuild-serve: spago-build create-bundle-entrypoint create-html-entrypoint
BROWSER_RUNTIME=1 node esbuild/serve.js ./dist/entrypoint.js dist/index.js dist/ ${serve-port}

webpack-bundle: spago-build create-bundle-entrypoint
BROWSER_RUNTIME=${browser-runtime} webpack --mode=production \
-o dist/ --env entry=./dist/entrypoint.js
@make delete-bundle-entrypoint

webpack-serve: spago-build create-bundle-entrypoint create-html-entrypoint
BROWSER_RUNTIME=1 webpack-dev-server --progress \
--port ${serve-port} \
-o dist/ --env entry=./dist/entrypoint.js

.ONESHELL:
check-explicit-exports:
Expand All @@ -35,8 +75,8 @@ check-whitespace:
check-format: check-explicit-exports check-examples-imports check-whitespace
@purs-tidy check ${ps-sources}
@nixpkgs-fmt --check ${nix-sources}
@prettier --log-level warn -c ${js-sources}
@eslint --quiet ${js-sources}
@prettier --loglevel warn -c ${js-sources}
@eslint --quiet ${js-sources} --parser-options 'sourceType: module'

format:
@purs-tidy format-in-place ${ps-sources}
Expand Down Expand Up @@ -66,7 +106,6 @@ run-ci-actions:
nix build -L .#checks.x86_64-linux.ctl-staking-test
nix build -L .#checks.x86_64-linux.examples-imports-check


clean:
@ rm -r .psc-ide-port || true
@ rm -rf .psci_modules || true
Expand All @@ -75,3 +114,4 @@ clean:
@ rm -rf .spago2nix || true
@ rm -rf node_modules || true
@ rm -rf output || true
@ rm -rf dist || true
6 changes: 3 additions & 3 deletions doc/babbage-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This document is a reference/explainer for the new CTL APIs introduced for Babba
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Reference Inputs

[Reference inputs](https://cips.cardano.org/cip/CIP-0031/#reference-inputs) allow looking at an output without spending it in Plutus scripts.
[Reference inputs](https://cips.cardano.org/cip/CIP-0031#reference-inputs) allow looking at an output without spending it in Plutus scripts.

There are two ways to use an input as a reference in the constraints API:

Expand All @@ -28,7 +28,7 @@ There are two ways to use an input as a reference in the constraints API:

## Reference Scripts

[Reference Scripts](https://developers.cardano.org/docs/governance/cardano-improvement-proposals/cip-0033/) allows the use of scripts without attaching them to the transaction (and using a reference instead).
[Reference Scripts](https://cips.cardano.org/cip/CIP-0033) allows the use of scripts without attaching them to the transaction (and using a reference instead).

Reference scripts can be utilized in CTL by first creating a reference point for the script to be used later via `mustPayToScriptWithScriptRef` (or its variants).

Expand All @@ -40,7 +40,7 @@ Then, `mustSpendScriptOutputUsingScriptRef` (or its variants) can be used to use

## Inline Data

[CIP-32](https://developers.cardano.org/docs/governance/cardano-improvement-proposals/cip-0032/) introduces the inline data feature that allows storing datum values directly in transaction outputs, instead of just the hashes.
[CIP-32](https://cips.cardano.org/cip/CIP-0032) introduces the inline data feature that allows storing datum values directly in transaction outputs, instead of just the hashes.

In CTL, alternating between datum storage options can be achieved by specifying a `DatumPresence` value with constraints that accept it, like `mustPayToPubKeyWithDatum`.

Expand Down
2 changes: 1 addition & 1 deletion doc/e2e-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ Note that the test closes successfully after the first successful `Contract` exe

CTL offers a function to serve the `Contract`s to be tested with a router, that dispatches contracts and configuration parameters based on query part of the URL.

It also builds a page with a table consisting of links to all possible examples with all possible environments, that looks like this:
It also builds a page with drop-downs, allowing to select an example and an environments, that looks like this:

![Headless browser test suite - served examples](./images/e2e.png)

Expand Down
Binary file modified doc/images/e2e.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 30 additions & 3 deletions doc/importing-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Exporting scripts from Plutus](#exporting-scripts-from-plutus)
- [Exporting scripts from Plutus or Plutarch](#exporting-scripts-from-plutus-or-plutarch)
- [Using Plutonomy](#using-plutonomy)
- [Importing serialized scripts](#importing-serialized-scripts)
- [Serializing Plutus scripts](#serializing-plutus-scripts)
- [PlutusTx](#plutustx)
Expand All @@ -13,9 +14,35 @@

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Exporting scripts from Plutus
## Exporting scripts from Plutus or Plutarch

See [the-plutus-scaffold](https://github.com/mlabs-haskell/the-plutus-scaffold)'s [exporter](https://github.com/mlabs-haskell/the-plutus-scaffold/tree/main/onchain/exporter) for a pipeline example.
Usually projects use a Haskell binary called *exporter* that outputs a pre-compiler UPLC bundle into a file.

The output file should be a Cardano envelope:

```json
{
"cborHex": "4e4d01000033222220051200120011",
"description": "always-succeeds",
"type": "PlutusScriptV2"
}
```

- An example of a Plutus exporter can be found [here](https://github.com/Mr-Andersen/ctl-multisign-mre/blob/main/onchain/exporter/Main.hs).
- For Plutarch, see [the-plutus-scaffold](https://github.com/mlabs-haskell/the-plutus-scaffold)'s [exporter](https://github.com/mlabs-haskell/the-plutus-scaffold/tree/main/onchain/exporter).


### Using Plutonomy

It makes sense to use [Plutonomy](https://github.com/well-typed/plutonomy) (an optimizer for UPLC) in the exporter:

```haskell
import Plutonomy (aggressiveOptimizerOptions, optimizeUPLCWith)

script :: Script
script = fromCompiledCode $
optimizeUPLCWith aggressiveOptimizerOptions $$(PlutusTx.compile [||policy||])
```

## Importing serialized scripts

Expand Down
2 changes: 1 addition & 1 deletion doc/key-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# Key Management

The process of going from private key menmonic to a set of addresses that the wallet can use is well specified in [CIP-1852](https://cips.cardano.org/cip/CIP-1852/).
The process of going from private key menmonic to a set of addresses that the wallet can use is well specified in [CIP-1852](https://cips.cardano.org/cip/CIP-1852).

For an address to be built, the user must provide some entropy for private key derivation and a *derivation path*, that specifies a list of cryptographic operations to perform on the "parent" or "root" key to get the "child" private key that can be used for signing.

Expand Down
2 changes: 1 addition & 1 deletion doc/using-from-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {

to only one of the import variants.

Our default [WebPack config](../webpack.config.js) uses `BROWSER_RUNTIME` environment variable to differentiate between two bundling options:
Our default [WebPack config](../webpack.config.cjs) uses `BROWSER_RUNTIME` environment variable to differentiate between two bundling options:

```js
plugins: [
Expand Down
13 changes: 13 additions & 0 deletions esbuild/bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as esbuild from "esbuild";
import { buildOptions } from "./config.js";

if (process.argv.length < 4) {
throw `usage: node bundle.js ENTRY_POINT OUTPUT_FILENAME`;
}

esbuild.build(
buildOptions({
entryPoint: process.argv[2],
outfile: process.argv[3]
})
);
41 changes: 41 additions & 0 deletions esbuild/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { wasmLoader } from "esbuild-plugin-wasm";
import { polyfillNode } from "esbuild-plugin-polyfill-node";

const isBrowser = !!process.env.BROWSER_RUNTIME;

export const buildOptions = ({ entryPoint, outfile }) => {
const config = {
entryPoints: [entryPoint],
outfile: outfile,
define: {
BROWSER_RUNTIME: isBrowser ? "true" : '""'
},
plugins: [
wasmLoader({
mode: "deferred"
})
],
bundle: true,
platform: isBrowser ? "browser" : "node",
format: "esm",
treeShaking: true,
logLevel: "error"
};

// https://esbuild.github.io/api/#packages
if (!isBrowser) {
config.packages = "external";
} else {
config.plugins.push(
polyfillNode({
polyfills: {
crypto: true,
fs: true,
os: true
}
})
);
}

return config;
};
72 changes: 72 additions & 0 deletions esbuild/serve.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import * as esbuild from "esbuild";
import { buildOptions } from "./config.js";
import http from "node:http";
import * as url from "url";

if (process.argv.length < 6) {
throw `usage: node serve.js ENTRY_POINT OUTPUT_FILE SERVE_DIR PORT`;
}

const ctx = await esbuild.context(
buildOptions({
entryPoint: process.argv[2],
outfile: process.argv[3]
})
);

const config = {
// Use the next port for esbuild server,
// we need a port for our proxy (see below).
port: parseInt(process.argv[5]) + 1,
servedir: process.argv[4]
};

let { host, port } = await ctx.serve(config);

// Proxy Kupo to esbuild server. This is needed due to CORS

const kupoEndpoint = process.env.KUPO_HOST || "http://localhost:1442";
const kupoHost = url.parse(kupoEndpoint).hostname;
const kupoPort = url.parse(kupoEndpoint).port || 80;

http
.createServer((req, res) => {
const options = {
hostname: host,
port: port,
path: req.url,
method: req.method,
headers: req.headers
};

// Forward each incoming request to esbuild
const proxyReq = http.request(options, proxyRes => {
// If esbuild returns "not found" and the path starts from /kupo/
if (proxyRes.statusCode === 404 && req.url.startsWith("/kupo/")) {
// Connect to Kupo running on port 1442
const kupoOptions = {
hostname: kupoHost,
port: kupoPort,
path: req.url.slice("/kupo".length),
method: req.method,
headers: req.headers
};
// Request the corresponding path
http
.request(kupoOptions, kupoRes => {
// Pipe the response from Kupo back to the client
res.writeHead(kupoRes.statusCode, kupoRes.headers);
kupoRes.pipe(res, { end: true });
})
.end();
} else {
// Otherwise, forward the response from esbuild to the client
res.writeHead(proxyRes.statusCode, proxyRes.headers);
proxyRes.pipe(res, { end: true });
}
});

// Forward the body of the request to esbuild
req.pipe(proxyReq, { end: true });
})
.listen(parseInt(process.argv[5]));
2 changes: 1 addition & 1 deletion examples/AdditionalUtxos.purs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ import Contract.Value (Value)
import Contract.Value (lovelaceValueOf) as Value
import Ctl.Examples.PlutusV2.Scripts.AlwaysSucceeds (alwaysSucceedsScriptV2)
import Data.Array (fromFoldable) as Array
import Data.BigInt (fromInt) as BigInt
import Data.Map (difference, filter, keys) as Map
import JS.BigInt (fromInt) as BigInt
import Test.QuickCheck (arbitrary)
import Test.QuickCheck.Gen (randomSampleOne)

Expand Down
19 changes: 5 additions & 14 deletions examples/AlwaysMints.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
/* global BROWSER_RUNTIME */

let script;
if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
script = require("Scripts/always-mints.plutus");
} else {
const fs = require("fs");
const path = require("path");
script = fs.readFileSync(
path.resolve(__dirname, "../../fixtures/scripts/always-mints.plutus"),
"utf8"
);
}
exports.alwaysMints = script;
export const alwaysMints = `{
"cborHex": "484701000022120011",
"description": "always-mints",
"type": "PlutusScriptV1"
}`;
Loading