Skip to content

Commit cfa8af9

Browse files
committed
Merge remote-tracking branch 'origin/develop' into dshuiski/1119-query-backend
2 parents 95ecb80 + fcdd234 commit cfa8af9

35 files changed

+431
-343
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
4747

4848
### Added
4949

50+
- `bundlePursProject` allows passing of `includeBundledModule` flag to export the bundled JS module `spago bundle-module` outputs
51+
5052
- `Contract.Transaction` exports `mkPoolPubKeyHash` and `poolPubKeyHashToBech32` for bech32 roundtripping ([#1360](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1360))
5153

5254
### Changed
@@ -55,12 +57,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
5557

5658
- Testing interface is re-implemented. Assertion functions from `Contract.Test.Utils` are moved to `Contract.Test.Assert`. See [the docs](./doc/test-utils.md) for info on the new interface. ([#1389](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1389))
5759

60+
- `startPlutipCluster` error message now includes cluster startup failure details. ([#1407](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1407))
61+
5862
### Removed
5963

6064
### Fixed
6165
- CIP-25 strings are now being split into chunks whose sizes are less than or equal to 64 to adhere to the CIP-25 standard ([#1343](https://github.com/Plutonomicon/cardano-transaction-lib/issues/1343))
6266
- Critical upstream fix in [`purescript-bignumber`](https://github.com/mlabs-haskell/purescript-bignumber/pull/2)
6367
- `OutputDatum` aeson encoding now roundtrips ([#1388](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1388))
68+
- Fix incorrect redeemer indexing for Plutus stake validator scripts ([#1417](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1417))
6469

6570
### Runtime Dependencies
6671

doc/ctl-as-dependency.md

+4
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ Make sure to perform **all** of the following steps, otherwise you **will** enco
8282
- That is, avoid using the `~` or `^` prefixes (e.g use versions like `"1.6.51"` instead of `"^1.6.51"`)
8383
- If you're using a `package-lock.json` (which is _highly_ recommended), you can update the lockfile with `npm i --package-lock-only`
8484

85+
4. **Update your webpack config**
86+
87+
- Sometimes the WebPack configuration also comes with breaking changes. Common source of problems are changes to `resolve.fallback`, `plugins` and `experiments` fields of the WebPack config. Use `git diff old-revision new-revision webpack.config.js` in the root of a cloned CTL repo, or use `git blame`.
88+
8589
## Using CTL from JS
8690

8791
### Bundling

nix/default.nix

+4-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ let
9393
# available in the shell environment. This can help with ensuring that
9494
# any e2e tests that you write and run with `Contract.Test.E2E` are
9595
# reproducible
96-
, withChromium ? false
96+
, withChromium ? true
9797
}:
9898
assert pkgs.lib.assertOneOf "formatter" formatter [ "purs-tidy" "purty" ];
9999
with pkgs.lib;
@@ -382,6 +382,8 @@ let
382382
# Generated `node_modules` in the Nix store. Can be passed to have better
383383
# control over individual project components
384384
, nodeModules ? projectNodeModules
385+
# If the spago bundle-module output should be included in the derivation
386+
, includeBundledModule ? false
385387
, ...
386388
}: pkgs.runCommand "${name}"
387389
{
@@ -405,6 +407,7 @@ let
405407
spago bundle-module --no-install --no-build -m "${main}" \
406408
--to ${bundledModuleName}
407409
mkdir ./dist
410+
${pkgs.lib.optionalString includeBundledModule "cp ${bundledModuleName} ./dist"}
408411
webpack --mode=production -c ${webpackConfig} -o ./dist \
409412
--entry ./${entrypoint}
410413
mkdir $out

package-lock.json

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"@emurgo/cardano-message-signing-nodejs": "1.0.1",
3232
"@emurgo/cardano-serialization-lib-browser": "11.2.1",
3333
"@emurgo/cardano-serialization-lib-nodejs": "11.2.1",
34+
"@mlabs-haskell/csl-gc-wrapper": "^1.0.1",
3435
"@mlabs-haskell/json-bigint": " 1.0.0",
3536
"@noble/secp256k1": "^1.7.0",
3637
"apply-args-browser": "0.0.1",

src/Internal/ApplyArgs.js

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
99
lib = require("@emurgo/cardano-serialization-lib-nodejs");
1010
apply_args = require("apply-args-nodejs");
1111
}
12+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
13+
apply_args = require("@mlabs-haskell/csl-gc-wrapper")(apply_args);
1214

1315
/**
1416
* @param {} left

src/Internal/BalanceTx/UtxoMinAda.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
66
} else {
77
lib = require("@emurgo/cardano-serialization-lib-nodejs");
88
}
9+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
910

1011
exports.minAdaForOutput = maybe => txOutput => dataCost => {
1112
try {

src/Internal/Deserialization/FromBytes.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
66
} else {
77
lib = require("@emurgo/cardano-serialization-lib-nodejs");
88
}
9+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
910

1011
exports._fromBytes = helper => name => bytes => {
1112
try {

src/Internal/Deserialization/Keys.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
66
} else {
77
lib = require("@emurgo/cardano-serialization-lib-nodejs");
88
}
9+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
910

1011
exports.freshPrivateKey = () => {
1112
return lib.PrivateKey.generate_ed25519();

src/Internal/Deserialization/Language.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
66
} else {
77
lib = require("@emurgo/cardano-serialization-lib-nodejs");
88
}
9+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
910

1011
exports._convertLanguage = langCtors => cslLang => {
1112
if (cslLang.kind() == lib.LanguageKind.PlutusV1) {

src/Internal/Deserialization/NativeScript.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
66
} else {
77
lib = require("@emurgo/cardano-serialization-lib-nodejs");
88
}
9+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
910

1011
exports._convertNativeScript = handler => ns => {
1112
switch (ns.kind()) {

src/Internal/Deserialization/PlutusData.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
66
} else {
77
lib = require("@emurgo/cardano-serialization-lib-nodejs");
88
}
9+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
910

1011
exports._convertPlutusData = handle => pd => {
1112
switch (pd.kind()) {

src/Internal/Deserialization/Transaction.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
66
} else {
77
lib = require("@emurgo/cardano-serialization-lib-nodejs");
88
}
9+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
910

1011
const call = property => object => object[property]();
1112
const callMaybe = property => maybe => object => {

src/Internal/Deserialization/UnspentOutput.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
66
} else {
77
lib = require("@emurgo/cardano-serialization-lib-nodejs");
88
}
9+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
910

1011
const call = property => object => object[property]();
1112
const callMaybe = property => maybe => object => {

src/Internal/Hashing.js

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
1010
} else {
1111
lib = require("@emurgo/cardano-serialization-lib-nodejs");
1212
}
13+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
1314

1415
exports.blake2b256Hash = bytesToHash => {
1516
return Blake2.blake2b(bytesToHash, null, 32);

src/Internal/Plutip/Server.purs

+3-2
Original file line numberDiff line numberDiff line change
@@ -660,8 +660,9 @@ startPlutipCluster cfg keysToGenerate = do
660660
$ (decodeAeson <=< parseJsonStringToAeson) body
661661
either (liftEffect <<< throw <<< show) pure res >>=
662662
case _ of
663-
ClusterStartupFailure _ -> do
664-
liftEffect $ throw "Failed to start up cluster"
663+
ClusterStartupFailure reason -> do
664+
liftEffect $ throw $
665+
"Failed to start up cluster. Reason: " <> show reason
665666
ClusterStartupSuccess response@{ privateKeys } ->
666667
case Array.uncons privateKeys of
667668
Nothing ->

src/Internal/Plutip/UtxoDistribution.purs

+3-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ import Data.Map as Map
5656
import Data.Maybe (Maybe(Nothing, Just))
5757
import Data.Newtype (unwrap)
5858
import Data.Traversable (traverse)
59+
import Data.Tuple (Tuple)
5960
import Data.Tuple.Nested (type (/\), (/\))
6061
import Effect.Class (liftEffect)
6162
import Effect.Ref as Ref
@@ -135,7 +136,8 @@ instance
135136
( UtxoDistribution headSpec headWallets
136137
, UtxoDistribution restSpec restWallets
137138
) =>
138-
UtxoDistribution (headSpec /\ restSpec) (headWallets /\ restWallets) where
139+
UtxoDistribution (Tuple headSpec restSpec)
140+
(Tuple headWallets restWallets) where
139141
encodeDistribution (distr /\ rest) =
140142
encodeDistribution distr <> encodeDistribution rest
141143
decodeWallets d p = decodeWalletsDefault d p

src/Internal/Serialization.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
66
} else {
77
lib = require("@emurgo/cardano-serialization-lib-nodejs");
88
}
9+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
910

1011
const setter = prop => obj => value => () => obj["set_" + prop](value);
1112

src/Internal/Serialization/Address.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
66
} else {
77
lib = require("@emurgo/cardano-serialization-lib-nodejs");
88
}
9+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
910

1011
const callClassStaticMaybe = (classname, functionname) => maybe => input => {
1112
let ret = null;

src/Internal/Serialization/AuxiliaryData.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
66
} else {
77
lib = require("@emurgo/cardano-serialization-lib-nodejs");
88
}
9+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
910

1011
const setter = prop => obj => value => () => obj["set_" + prop](value);
1112

src/Internal/Serialization/BigInt.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
66
} else {
77
lib = require("@emurgo/cardano-serialization-lib-nodejs");
88
}
9+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
910

1011
exports._BigInt_from_str = helper => str => {
1112
try {

src/Internal/Serialization/Hash.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
66
} else {
77
lib = require("@emurgo/cardano-serialization-lib-nodejs");
88
}
9+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
910

1011
exports.hashToBytes = hash => {
1112
return hash.to_bytes();

src/Internal/Serialization/MinFee.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
66
} else {
77
lib = require("@emurgo/cardano-serialization-lib-nodejs");
88
}
9+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
910

1011
exports._minFee = maybe => tx => txFeeFixed => txFeePerByte => {
1112
try {

src/Internal/Serialization/NativeScript.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
66
} else {
77
lib = require("@emurgo/cardano-serialization-lib-nodejs");
88
}
9+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
910

1011
const mkScript = prop => arg => lib.NativeScript[prop](arg);
1112

src/Internal/Serialization/PlutusData.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
66
} else {
77
lib = require("@emurgo/cardano-serialization-lib-nodejs");
88
}
9+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
910

1011
exports._mkPlutusData_bytes = bytes => lib.PlutusData.new_bytes(bytes);
1112
exports._mkPlutusData_list = list => lib.PlutusData.new_list(list);

src/Internal/Serialization/PlutusScript.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
66
} else {
77
lib = require("@emurgo/cardano-serialization-lib-nodejs");
88
}
9+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
910

1011
exports.newPlutusV1Script = bytes => lib.PlutusScript.new(bytes);
1112

src/Internal/Serialization/WitnessSet.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
66
} else {
77
lib = require("@emurgo/cardano-serialization-lib-nodejs");
88
}
9+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
910

1011
exports.newTransactionWitnessSet = () => lib.TransactionWitnessSet.new();
1112

src/Internal/Types/BigNum.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
66
} else {
77
lib = require("@emurgo/cardano-serialization-lib-nodejs");
88
}
9+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
910

1011
exports.bnCompare = lhs => rhs => lhs.compare(rhs);
1112

src/Internal/Types/Int.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
66
} else {
77
lib = require("@emurgo/cardano-serialization-lib-nodejs");
88
}
9+
lib = require("@mlabs-haskell/csl-gc-wrapper")(lib);
910

1011
exports.newPositive = lib.Int.new;
1112
exports.newNegative = lib.Int.new_negative;

0 commit comments

Comments
 (0)