cleveland-0.1.2: Testing framework for Morley.
Safe HaskellNone
LanguageHaskell2010

Test.Cleveland.Michelson.Entrypoints

Description

Utility functions for checking predicates on contract's entrypoints.

Synopsis

Documentation

contractHasEntrypoints :: Contract -> Map EpName Ty -> Bool Source #

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

testContractCoversEntrypoints :: TestName -> Contract -> Map EpName Ty -> TestTree Source #

Assert the contract contains the entrypoints given in spec (with matching types). Ignores any additional entrypoints present in the contract.

Also tests if the same holds after Michelson and Micheline roundtrips of the contract.

testContractMatchesEntrypoints :: TestName -> Contract -> Map EpName Ty -> TestTree Source #

Assert the contract exactly matches the given entrypoints. Will report both missing and extraneous entrypoint names, and type mismatches.

Also tests if the same holds after Michelson and Micheline roundtrips of the contract.

mkEntrypointsMap :: ParameterType -> Map EpName Ty #

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

Check if entrypoint is present in T.