All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and we follow Semantic Versioning.
Table of Contents
- [Unreleased]
- [2.0.0-alpha] - 2022-07-06
- [1.1.0] - 2022-06-30
- [1.0.1] - 2022-06-17
- [1.0.0] - 2022-06-10
- Plutip integration to run
Contract
s in local, private testnets (#470) - Ability to run
Contract
s in Plutip environment in parallel -Contract.Test.Plutip.withPlutipContractEnv
(#800) withKeyWallet
utility that allows to simulate multiple actors in Plutip environment (#663)withStakeKey
utility that allows providing a stake key to be used byKeyWallet
s in Plutip environment (#838)Alt
andPlus
instances forContract
.Contract.Utxos.getUtxo
call to get a single utxo at a given output referenceContract.Monad.withContractEnv
function that constructs and finalizes a contract environment that is usable inside a bracket callback. This is the intended way to run multiple contracts. (#731)Contract.Monad.stopContractEnv
function to finalize a contract environment (close theWebSockets
). It should be used together withmkContractEnv
, and is not needed withwithContractEnv
. (#731)Contract.Config
module that contains everything needed to create and manipulateConfigParams
, as well as a number ofConfigParams
fixtures for common use cases. (#731)Contract.Monad.askConfig
andContract.Monad.asksConfig
functions to access user-defined configurations. (#731)Contract.Config.WalletSpec
type that allows to define wallet parameters declaratively inConfigParams
, instead of initializing wallet and setting it to aContractConfig
(#731)- Faster initialization of
Contract
runtime due to parallelism. (#731) purescriptProject
'sshell
parameter now acceptspackageLockOnly
, which if set to true will stop npm from generatingnode_modules
. This is enabled for CTL developersContract.Transaction.awaitTxConfirmed
andContract.Transaction.awaitTxConfirmedWithTimeout
Contract.TextEnvelope.textEnvelopeBytes
and family to decode theTextEnvelope
format, a common format output by tools likecardano-cli
to serialize values such as cryptographical keys and on-chain scriptsContract.Wallet.isNamiAvailable
andContract.Wallet.isGeroAvailable
functions (#558])Contract.Transaction.balanceTxWithOwnAddress
andContract.Transaction.balanceTxsWithOwnAddress
to override anAddress
used inbalanceTx
internally (#775)Contract.Transaction.awaitTxConfirmedWithTimeoutSlots
waits a specified number of slots for a transaction to succeed. (#790)Contract.Transaction.submitE
like submit but uses anEither (Array Aeson) TransactionHash
to handle a SubmitFail response from OgmiosContract.Chain.waitNSlots
,Contract.Chain.currentSlot
andContract.Chain.currentTime
a function to wait at leastN
number of slots and functions to get the current time inSlot
orPOSIXTime
. (#740)Contract.Transaction.getTxByHash
to retrieve contents of an on-chain transaction.project.launchSearchablePursDocs
to create anapps
output for serving Pursuit documentation locally (#816)KeyWallet.MintsAndSendsToken
example (#802)Contract.PlutusData.IsData
type class (ToData
+FromData
) (#809)- A check for port availability before Plutip runtime initialization attempt (#837)
Contract.Address.addressToBech32
andContract.Address.addressWithNetworkTagToBech32
(#846)doc/e2e-testing.md
describes the process of E2E testing. (#814)- Added unzip to the
devShell
. NewpurescriptProject.shell
flagwithChromium
also optionally adds Chromium to thedevShell
(#799) - Added paymentKey and stakeKey fields to the record in KeyWallet
- Added
formatPaymentKey
andformatStakeKey
toWallet.KeyFile
andContract.Wallet
for formatting private keys - Added
privatePaymentKeyToFile
andprivateStakeKeyToFile
toWallet.KeyFile
andContract.Wallet.KeyFile
for writing keys to files - Added
bytesFromPrivateKey
toSerialization
- Improved error handling of transaction evaluation through Ogmios. This helps with debugging during balancing, as it requires the transaction to be evaluated to calculate fees. (#832)
Contract.Hashing.transactionHash
to calculate the hash of the transaction (#870)- Flint wallet support (#556)
- Support for
NativeScript
s in constraints interface:mustPayToNativeScript
andmustSpendNativeScriptOutput
functions (#869) Contract.Test.Cip30Mock
module to mock CIP-30 wallet interface usingKeyWallet
. The mock can be used for testing without a wallet (even in NodeJS environment). This increases test coverage for CTL code. (#784)Plutus.Types.AssocMap.AssocMap
now hasTraversableWithIndex
,FoldableWithIndex
,FunctorWithIndex
instances (#943)- The return value of
purescriptProject
now includes the project with its compiledoutput
and its generatednode_modules
(under thecompiled
andnodeModules
attributes, respectively) (#956) Contract.Utxos.getWalletUtxos
function that calls CIP-30getUtxos
method. (#961)- Lode wallet support (#556)
- Added
Contract.Transaction.lookupTxHash
helper function (#957) Contract.Test.Utils
for making assertions aboutContract
s. (#1005)Examples.ContractTestUtils
demonstrating the use ofContract.Test.Utils
. (#1005)mustNotBeValid
constraint which marks the transaction as invalid, allowing scripts to fail during balancing and for Ogmios to allow submission. (#947)ReferenceScripts
example, for testing reference scripts (#946)ReferenceInputs
example, for testing reference inputs (#946)- Constraints for creating outputs with reference scripts:
mustPayToScriptWithScriptRef
,mustPayToPubKeyAddressWithDatumAndScriptRef
,mustPayToPubKeyAddressWithScriptRef
,mustPayToPubKeyWithDatumAndScriptRef
,mustPayToPubKeyWithScriptRef
(#946) - Constraints for using reference validators and minting policies:
mustSpendScriptOutputUsingScriptRef
,mustMintCurrencyUsingScriptRef
,mustMintCurrencyWithRedeemerUsingScriptRef
(#946) - Constraint for attaching a reference input to a transaction:
mustReferenceOutput
(#946) Lose7Ada
example, for testing collateral return. (#947)PlutusV2.AlwaysSucceeds
example, for testing PlutusV2 scripts. (#947)InlineDatum
example, for testing inline datum constraints. (#931)DatumPresence
data type, which tags paying constraints that accept datum, to mark whether the datum should be inline or hashed in the transaction output. (#931)
PlutusScript
is now aware of which version of Plutus the script is for. The JSON representation has thus changed to reflect this and is not compatible with older JSON format.- CTL's
overlay
no longer requires an explicitly passedsystem
- Switched to CSL for utxo min ada value calculation (#715)
- Upgraded Haskell server to fully support Babbage-era transactions (#733)
- Improved the collateral selection algorithm for
KeyWallet
(#707) - Switched to CSL for
PlutusScript
hashing (#852) runContract
now acceptsConfigParams
instead ofContractConfig
(#731)mkContractConfig
has been renamed tomkContractEnv
. Users are advised to usewithContractEnv
instead to ensure proper finalization of WebSocket connections. (#731)ConfigParams
is now a type synonym instead of a newtype.ContractConfig
has been renamed toContractEnv
.- Moved logging functions to
Contract.Log
fromContract.Monad
(#727 - Renamed
Contract.Wallet.mkKeyWalletFromPrivateKey
toContract.Wallet.mkKeyWalletFromPrivateKeys
. - ServerConfig accepts a url
path
field (#728). - Examples now wait for transactions to be confirmed and log success (#739).
- Updated CSL version to v11.0.0 (#801)
- Better error message when attempting to initialize a wallet in NodeJS environment (#778)
- The
ctl-scaffold
repository has been archived and deprecated and its contents moved totemplates.ctl-scaffold
in the CTL flake (#760). - The CTL
overlay
output has been deprecated and replaced byoverlays.purescript
,overlays.runtime
, andoverlays.ctl-server
(#796 and #872). buildCtlRuntime
andlaunchCtlRuntime
now take anextraServices
argument to adddocker-compose
services to the resulting Arion expression (#769).- Use
cardano-serialization-lib
for fee calculation, instead of server-side code. balanceAndSignTx
no longer silently drops error information viaMaybe
. TheMaybe
wrapper is currently maintained for API compatibility, but will be dropped in the future.- Made it impossible to write unlawful
EncodeAeson
instances (#490) - The
ctl-server
component of the runtime is now optional and is only required when using theapplyArgs
endpoint (#872). Related changes include:- The
ctlServerConfig
fields of bothConfigParams
andPlutipConfig
now take aMaybe ServerConfig
. In the case ofPlutipConfig
, aJust
value will spawn the service inside the Plutip test. For theConfigParams
type, calls toapplyArgs
will fail when the field is set toNothing
. - The config accepted by
launchCtlRuntime
andbuildCtlRuntime
now takes actl-server.enable
field. Iffalse
,ctl-server
will not be launched.
- The
SlotLength
andRelativeTime
inEraSummary
from Ogmios are now of typeNumber
instead ofBigInt
. Also addMaybe
around some functions inType.Interval
or changed it's signature to useNumber
. (#868)- Renamed
UtxoM
toUtxoMap
(#963) - KeyWallet's
selectCollateral
field now allows multiple collateral to be selected, and is provided withcoinsPerUtxoByte
andmaxCollateralInputs
from the protocol parameters. (#947) mustPayWithDatumToPubKey
,mustPayWithDatumToPubKeyAddress
, andmustPayToScript
now expect aDatumPresence
tag in their arguments to mark whether the datum should be inline or hashed in the transaction output. ((#931)[Plutonomicon#931])- Switched to blakejs for blake2b hashing.
blake2b256Hash
andblake2b256HashHex
functions are now pure (#991)
Contract.Monad.traceTestnetContractConfig
- useContract.Config.testnetNamiConfig
instead (or other variants oftestnet...Config
for other wallets).runContract_
- usevoid <<< runContract
.Contract.Aeson
module - useAeson
(#938)
- Endless
awaitTxConfirmed
calls (#804) - Bug with collateral selection: only the first UTxO provided by wallet was included as collateral (#723)
- Bug with collateral selection for
KeyWallet
when signing multiple transactions (#709) - Bug when zero-valued non-Ada assets were added to the non-Ada change output (#802)
- Error recovery logic for
SubmitTx
if the WebSocket connection is dropped (#870) - Properly implemented CIP-25 V2 metadata. Now there's no need to split arbitrary-length strings manually to fit them in 64 PlutusData bytes (CTL handles that). A new
Cip25String
type has been introduced (a smart constructor ensures that byte representation fits 64 bytes, as required by the spec). Additionally, a newMetadata.Cip25.Common.Cip25TokenName
wrapper overTokenName
is added to ensure proper encoding ofasset_name
s. There are still some minor differences from the spec:- We do not split strings in pieces when encoding to JSON
- We require a
"version": 2
tag policy_id
must be 28 bytesasset_name
is up to 32 bytes. See cardano-foundation/CIPs#303 for motivation
ogmios-datum-cache
now works onx86_64-darwin
TypedValidator
interface (#808)Contract.Address.getWalletCollateral
now works withKeyWallet
.- Removed unwanted error messages in case
WebSocket
listeners get cancelled (#827) - Bug in
CostModel
serialization - incorrectInt
type (#874) - Use logger settings on Contract initialization (#897)
- Disallow specifying less than 1 ADA in Plutip UTxO distribution (#901)
- Bug in
TransactionMetadatum
deserialization (#932) - Fix excessive logging after the end of
Contract
execution (#893) - Add ability to suppress logs of successful
Contract
executions - with newsuppressLogs
config option the logs will be shown on error (#768) - Fix
runPlutipTest
not passing custombuildInputs
(#955) - Problem parsing ogmios
SlotLength
andRelativeTime
in era Summaries if those include non integer values. (#906) - Use
docs-search-0.0.12
that properly lists modules consisting only of re-exports (#973) - Inline datum in Ogmios transaction outputs are now parsed and preserved when converting to CTLs respective type. (#931)
This release adds support for running CTL contracts against Babbage-era nodes. Note: this release does not support Babbagge-era features and improvements, e.g. inline datums and reference inputs. Those feature will be implemented in v2.0.0
proper.
- Support for using a
PrivateKey
as aWallet
. mkKeyWalletFromFile
helper to usecardano-cli
-styleskey
s- Single
Plutus.Conversion
module exposing all(Type <-> Plutus Type)
conversion functions (#464) logAeson
family of functions to be able to log JSON representationsEncodeAeson
instances for most types underCardano.Types.*
as well as other useful types (Value
,Coin
, etc.)getProtocolParameters
call to retrieve current protocol parameters from Ogmios (#541)Contract.Utxos.getWalletBalance
call to get all available assets as a singleValue
(#590)balanceAndSignTxs
balances and signs multiple transactions while taking care to use transaction inputs only once- Ability to load stake keys from files when using
KeyWallet
(#635) - Implement utxosAt for
KeyWallet
(#617) FromMetadata
andToMetadata
instances forContract.Value.CurrencySymbol
Contract.Chain.waitUntilSlot
to delay contract execution until local chain tip reaches certain point of time (in slots).
FromPlutusType
/ToPlutusType
type classes. (#464)Contract.Wallet.mkGeroWallet
andContract.Wallet.mkNamiWallet
-Aff
versions should be used instead- Protocol param update setters for the decentralisation constant (
set_d
) and the extra entropy (set_extra_entropy
) (#609) AbsSlot
and related functions have been removed in favour ofSlot
- Modules
Metadata.Seabug
andMetadata.Seabug.Share
POST /eval-ex-units
Haskell server endpoint (#665)- Truncated test fixtures for time/slots inside
AffInterface
to test time/slots not too far into the future which can be problematic during hardforks Plutonomicon#676 d
andextraEntropy
protocol parameters from protocol parameters update proposal
- Updated
ogmios-datum-cache
- bug fixes (#542, #526, #589) - Improved error response handling for Ogmios (#584)
balanceAndSignTx
now locks transaction inputs within the currentContract
context. If the resulting transaction is never used, then the inputs must be freed withunlockTransactionInputs
.- Updated
ogmios-datum-cache
- bug fixes (#542, #526, #589). - Made protocol parameters part of
QueryConfig
. - Refactored
Plutus.Conversion.Address
code (utilized CSL functionality). - Changed the underlying type of
Slot
,TransactionIndex
andCertificateIndex
toBigNum
. - Moved transaction finalization logic to
balanceTx
. - Upgraded to CSL v11.0.0-beta.1.
purescriptProject
(exposed via the CTL overlay) was reworked significantly. Please see the updated example in the documentation for more details.- Switched to Ogmios for execution units evaluation (#665)
- Changed
inputs
insideTxBody
to beSet TransactionInput
insteadArray TransactionInput
. This guarantees ordering of inputs inline with Cardano (#641) - Upgraded to Ogmios v5.5.0
- Change
inputs
insideTxBody
to beSet TransactionInput
insteadArray TransactionInput
. This guarantees ordering of inputs inline with Cardano (#641).
- Handling of invalid UTF8 byte sequences in the Aeson instance for
TokenName
Types.ScriptLookups.require
function naming caused problems with WebPack (#593)- Bad logging in
queryDispatch
that didn't propagate error messages (#615) - Utxo min ada value calculation (#611)
- Discarding invalid inputs in
txInsValues
instead of yielding an error (#696) - Locking transaction inputs before the actual balancing of the transaction (#696)
- Changed
utxoIndex
inside anUnbalancedTx
to be aMap
with valuesTransactionOutput
instead ofScriptOutput
so there is no conversion in the balancer toScriptOutput
. This means the balancer can spend UTxOs from different wallets instead of just the current wallet and script addresses.
mustBeSignedBy
now sets theEd25519KeyHash
corresponding to the providedPaymentPubKeyHash
directly. Previously, this constraint would fail as there was no way to provide a matchingPaymentPubKey
as a lookup. Note that this diverges from Plutus as thepaymentPubKey
lookup is always required in that implementation.
CTL's initial release!