From d29f7e85abba760b661febca6d475245c9134cd8 Mon Sep 17 00:00:00 2001 From: Vladimir Kalnitsky Date: Tue, 16 Apr 2024 04:27:16 +0400 Subject: [PATCH] Expand CHANGELOG --- CHANGELOG.md | 38 ++++++++++++++++++++------- doc/faq.md | 5 ++++ templates/ctl-scaffold/test/Main.purs | 2 +- 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb8ddd7b1..021f623a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,7 +64,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ## [Unreleased] -In this version, we've refactored CTL and separated it into multiple reusable sub-packages, most notably: +In this version, we've refactored CTL and split it into multiple reusable sub-packages, most notably: - this package - `purescript-cardano-types` - (`Cardano.Types.*`) - domain types for Cardano ledger @@ -73,27 +73,49 @@ In this version, we've refactored CTL and separated it into multiple reusable su See the [cardano-purescript repo](https://github.com/klntsky/cardano-purescript) for a complete list of new packages. +These packages maintain their own public API, so the interfaces you should use are not necessarily namespaced under `Contract.*` anymore. E.g. `Cardano.Types.*` from `purescript-cardano-types` is public. + +Starting from this version, CTL does not use Plutus-domain types anymore. There are no more Plutus domain <-> Cardano domain conversion functions. This change comes with some downsides (e.g. the need to provide NetworkId in `Address`es), but the benefit of not caring about conversions for basic functionality will hopefully be more noticeable. + ### Added +- New purescript dependencies: + - [`purescript-bytearrays`](https://github.com/mlabs-haskell/purescript-bytearrays) + - [`purescript-cardano-hd-wallet`](https://github.com/mlabs-haskell/purescript-cardano-hd-wallet) + - [`purescript-cardano-message-signing`](https://github.com/mlabs-haskell/purescript-cardano-message-signing) + - [`purescript-cardano-plutus-data-schema`](https://github.com/mlabs-haskell/purescript-cardano-plutus-data-schema) + - [`purescript-cardano-serialization-lib`](https://github.com/mlabs-haskell/purescript-cardano-serialization-lib) + - [`purescript-cardano-types`](https://github.com/mlabs-haskell/purescript-cardano-types) +- `Contract.Address.mkAddress` - a helper that automatically uses the correct `NetworkId` to construct an `Address`. + ### Changed - Replaced custom CIP-30 wrapper code with [`purescript-cip30-typesafe`](https://github.com/mlabs-haskell/purescript-cip30-typesafe/) - ([#1583](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1583)) -- Renamings for better confirmity with CSL: +- Renamings for better conformity with CSL: - `TokenName` renamed to `AssetName` - `NonAdaAsset` renamed to `MultiAsset` - `Coin` now wraps BigNum instead of BigInt (in line with CSL) -- Instances for `Address` type: - - `Show`, `EncodeAeson` and `DecodeAeson` return a data-generic representation instead of Bech32-based. -- `plutusScriptV1FromEnvelope`, `plutusScriptV2FromEnvelope` have been replaced with `plutusScriptFromEnvelope` (the script is tagged with its language anyway) -- `NoOutputDatum` variant has been removed from `OutputDatum`: instead, it was made optional via Maybe in `TransactionOutput` -- `TransactionMetadatum` constructor naming, in PS and JSON encoding: `MetadataMap` -> `Map`, `MetadataList` -> `List` +- `NoOutputDatum` variant has been removed from `OutputDatum`: instead, it was made optional via `Maybe` in `TransactionOutput` +- `TransactionMetadatum` constructor naming change, in PS and in JSON encoding: `MetadataMap` -> `Map`, `MetadataList` -> `List` - `Contract.PlutusData.Redeemer` has been renamed to `RedeemerDatum` (to resolve naming conflict with `cardano-ledger`-style redeemer) - `Contract.PlutusData.Datum` has been deprecated, use `Cardano.Types.PlutusData` +- `plutusScriptV1FromEnvelope`, `plutusScriptV2FromEnvelope` have been replaced with `plutusScriptFromEnvelope` (the script is tagged with its language anyway) ### Fixed ### Removed +- NPM runtime dependencies: + +```diff + "bip39": "^3.1.0", +- "blakejs": "1.2.1", + "bufferutil": "4.0.5", +- "jssha": "3.2.0", + "puppeteer-core": "^15.3.2", + "reconnecting-webs +``` + - `Contract.Address` utilities to work with `Address` - use `mkAddress` and machinery from `Cardano.Types.Address` - `Contract.Credential` renamings: - `PubKeyCredential` -> `PubKeyHashCredential` @@ -132,8 +154,6 @@ See the [cardano-purescript repo](https://github.com/klntsky/cardano-purescript) - `Contract.Numeric.NatRatio` - the module was not used in the library. - `Contract.AssocMap` - use `Cardano.Plutus.Types.Map` from [`purescript-plutus-types`](https://github.com/mlabs-haskell/purescript-plutus-types) - - ## [v7.0.0] ### Added diff --git a/doc/faq.md b/doc/faq.md index e92226e6d..5e0bb925b 100644 --- a/doc/faq.md +++ b/doc/faq.md @@ -8,6 +8,7 @@ This document lists common problems encountered by CTL users and developers. - [Bundling-related](#bundling-related) - [Q: `lib.something` is not a function, why?](#q-libsomething-is-not-a-function-why) + - [Q: `Module parse failed: 'import' and 'export' may appear only with 'sourceType: module'` error?](#q-module-parse-failed-import-and-export-may-appear-only-with-sourcetype-module-error) - [Q: I see `spago: Error: Remote host not found`, why?](#q-i-see-spago-error-remote-host-not-found-why) - [Q: I see `WebAssembly module is included in initial chunk.` error, why?](#q-i-see-webassembly-module-is-included-in-initial-chunk-error-why) - [Q: I see `Cannot use 'import.meta' outside a module` error in the browser, why?](#q-i-see-cannot-use-importmeta-outside-a-module-error-in-the-browser-why) @@ -39,6 +40,10 @@ This is probably because npm is used directly. This is something users have repo You can prevent `npm` from ever installing to local `node_modules` by enabling the `packageLockOnly` flag in the `shell` argument to `purescriptProject`. When enabled, `npm i` will always act as if the `--package-lock-only` flag has been passed. This is not enabled by default, but we recommend enabling it. +### Q: `Module parse failed: 'import' and 'export' may appear only with 'sourceType: module'` error? + +Make sure you've specified `"type": "module"` in your project's `package.json`. + ### Q: I see `spago: Error: Remote host not found`, why? An error like this one: diff --git a/templates/ctl-scaffold/test/Main.purs b/templates/ctl-scaffold/test/Main.purs index 9696b07eb..86c3f3e57 100644 --- a/templates/ctl-scaffold/test/Main.purs +++ b/templates/ctl-scaffold/test/Main.purs @@ -4,6 +4,7 @@ module Test.Scaffold.Main (main, suite) where import Contract.Prelude +import Contract.Numeric.BigNum as BigNum import Contract.Test.Mote (TestPlanM, interpretWithConfig) import Contract.Test.Plutip ( InitialUTxOs @@ -14,7 +15,6 @@ import Contract.Test.Plutip , withWallets ) import Contract.Test.Utils (exitCode, interruptOnSignal) -import Contract.Numeric.BigNum as BigNum import Data.Posix.Signal (Signal(SIGINT)) import Effect.Aff ( Milliseconds(Milliseconds)