Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Utility functions for checking predicates on contract's entrypoints.
Synopsis
- contractHasEntrypoints :: Contract -> Map EpName Ty -> Bool
- testContractCoversEntrypoints :: TestName -> Contract -> Map EpName Ty -> TestTree
- testContractMatchesEntrypoints :: TestName -> Contract -> Map EpName Ty -> TestTree
- mkEntrypointsMap :: HandleImplicitDefaultEp -> ParameterType -> Map EpName Ty
- hasEp :: T -> (EpName, Ty) -> Bool
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 :: HandleImplicitDefaultEp -> ParameterType -> Map EpName Ty #