Skip to content

Commit

Permalink
Expand CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
klntsky committed Apr 16, 2024
1 parent 6f51fc5 commit d29f7e8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 10 deletions.
38 changes: 29 additions & 9 deletions CHANGELOG.md
Expand Up @@ -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
Expand All @@ -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`
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions doc/faq.md
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion templates/ctl-scaffold/test/Main.purs
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit d29f7e8

Please sign in to comment.