Skip to content

Version 3.0.0

Compare
Choose a tag to compare
@florentc florentc released this 22 Mar 10:55
· 138 commits to main since this release

Added

  • Modifiers to ease specification of payments in transaction skeletons:
    • withDatum, withInlineDatum, and withDatumHash to add or override datums in payments, regardless of whether the type matches the validator type in case of scripts
    • paysScriptNoDatum to be used with withDatum, withInlineDatum and withDatumHash.
    • withReferenceScript and withStakingCredential to add a reference script or staking credential to a payment
  • Export Cooked.UtxoState
  • A module Cooked.ShowBS to provide a Plutus-level analogue of Show with BuiltinString as its codomain. This is very inefficient due to limitations of BuiltinString, but potentially useful for "printf-debugging" of scripts.
  • An option txOptEmulatorParamsModification to temporarily change protocol parameters for balancing and validation of a transaction
  • A function combineModsTweak to construct branching tweaks depending on the different combinations of foci of an optic on TxSkel
  • New PrettyCooked instances for common Plutus types
  • Tweaks on signers in the non-lens tweak API
  • A function resolveTypedDatum to recover typed data on UTxOs in MonadBlockChainBalancing.
  • A UtxoSearch that starts from a list of TxOutRefs
  • A transaction option to choose which UTxOs can be spent for balancing
  • Lenses for the fields of TxOpts
  • Cheatsheet
  • API now exposes: Cooked.Tweak.ValidityRange, interpretAndRun, interpretAndRunWith, runTweak, runTweakFrom and datumHijackingTarget
  • there modifier to apply a tweak at a precise place in a trace
  • New tweaks to change the start or end of the transaction validity range: setValidityStartTweak and setValidityEndTweak
  • UTxo searches with predicates over values, including only ada, or not only ada: filterWithValuePred, filterWithOnlyAda and filterWithNotOnlyAda
  • New pretty-printing options related to hashes in pcOptHashes including the possibility to assign human readable names to hashes (pubkeys, scripts, minting policies)
  • Initial distributions of funds can now include arbitrat payments instead of only consisting of values belonging to wallets. In particular, we can now initially pay to scripts and have utxos with datums and reference scripts. We can still create an initial distribution in the old fashion way with distributionFromList or directly provide a list of payments with InitialDistribution.
  • Dummy pre-existing validators in Cooked.Validators to be used for testing purposes mainly but also as targets for attacks and tweaks.
  • Small QOL helpers (ada, lovelace and adaAssetClass) to create values in Cooked.ValueUtils.

Removed

  • paysPKWithReferenceScript (superseded by the withReferenceScript modifier)
  • Do not export Cooked.UtxoPayloadSet

Changed

  • Cooked.holdingInState is relpaced by Cooked.holdsInState which takes an address instead of a wallet as argument.

  • Failure testing is slightly modified so that every test has to check that the right error is thrown

    • Cooked.testFailsFrom' is renamed to Cooked.testFailsFrom
    • Cooked.testFails is (the new) Cooked.testFailsFrom with the default distribution.

    To update their code, users must

    1. Adapt invokations of Cooked.testFails and Cooked.testFailsFrom adding a predicate that must hold on the error returned by running the transaction,
    2. Rename Cooked.testFailsFrom' into Cooked.testFailsFrom.
    3. (Bonus) simplify, knowing that Cooked.testFailsFrom o x def == Cooked.testFails o x
  • Quick and permanent value minting policies have been migrated to PlutusV2.

  • Default initial distribution only provides 5 UTxOs per wallet instead of 10.

Fixes

  • Add forgotten export of permanentValue
  • In MockChainT: don't delete data on transaction inputs if there are still UTxOs with that datum around.
  • Prettyprint unresolved transaction inputs