morley-0.6.0: Developer tools for the Michelson Language

Safe HaskellNone
LanguageHaskell2010

Michelson.Test.Unit

Description

Utility functions for unit testing.

Synopsis

Documentation

type ContractPropValidator st prop = ContractReturn st -> prop Source #

Type for contract execution validation.

It's a function which is supplied with contract execution output (failure or new storage with operation list).

Function returns a property which type is designated by type variable prop and might be Property or Expectation or anything else relevant.

contractProp :: (IsoValue param, IsoValue storage, ToT param ~ cp, ToT storage ~ st, ParameterScope cp) => Contract cp st -> ContractPropValidator st prop -> ContractEnv -> param -> storage -> prop Source #

Contract's property tester against given input. Takes contract environment, initial storage and parameter, interprets contract on this input and invokes validation function.

contractPropVal :: ParameterScope cp => Contract cp st -> ContractPropValidator st prop -> ContractEnv -> Value cp -> Value st -> prop Source #

Version of contractProp which takes Val as arguments instead of regular Haskell values.

contractHasEntryPoints :: Contract -> Map EpName Type -> Bool Source #

Check whether the given set of entrypoints is present in contract.

matchContractEntryPoints :: HasCallStack => Contract -> Map EpName Type -> Either (NonEmpty (EpName, Type)) () Source #

Match the given contract with provided set of entrypoints, return left if some entrypoints were not found.

hasEp :: T -> (EpName, Type) -> Bool Source #

Check if entrypoint is present in T.