morley-0.2.0.1: Developer tools for the Michelson Language

Safe HaskellNone
LanguageHaskell2010

Morley.Test.Import

Description

Functions to import contracts to be used in tests.

Synopsis

Documentation

specWithContract :: (Typeable cp, Typeable st) => FilePath -> ((UntypedContract, 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).

specWithTypedContract :: (Typeable cp, Typeable st) => FilePath -> (Contract cp st -> Spec) -> Spec Source #

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

importContract :: forall cp st. (Typeable cp, Typeable st) => FilePath -> IO (UntypedContract, Contract cp st) Source #

Import contract from a given file path.

This function reads file, parses and type checks contract.

This function may throw IOException and ImportContractError.