morley-0.3.0.1: Developer tools for the Michelson Language

Safe HaskellNone
LanguageHaskell2010

Michelson.Test.Import

Description

Functions to import contracts to be used in tests.

Synopsis

Documentation

specWithContract :: (Each [Typeable, SingI] [cp, st], HasCallStack) => FilePath -> ((Contract, Contract cp st) -> Spec) -> Spec Source #

Import contract and use it in the spec. Both versions of contract are passed to the callback function (untyped and typed).

If contract's import failed, a spec with single failing expectation will be generated (so tests will run unexceptionally, but a failing result will notify about problem).

specWithContractL :: (Each [Typeable, SingI] [ToT cp, ToT st], HasCallStack) => FilePath -> ((Contract, Contract cp st) -> Spec) -> Spec Source #

Like specWithContract, but for Lorentz types.

specWithTypedContract :: (Each [Typeable, SingI] [cp, st], HasCallStack) => FilePath -> (Contract cp st -> Spec) -> Spec Source #

A version of specWithContract which passes only the typed representation of the contract.

importContract :: forall cp st. Each [Typeable, SingI] [cp, st] => FilePath -> IO (Contract, Contract cp st) Source #

Import contract from a given file path.

This function reads file, parses and type checks a contract. Within the typechecking we assume that no contracts are originated, otherwise a type checking error will be caused.

This function may throw IOException and ImportContractError.