Safe Haskell | None |
---|---|
Language | Haskell2010 |
Utility functions for unit testing.
Synopsis
- type ContractReturn s st = (Either MichelsonFailed ([Operation Instr], Val Instr st), InterpreterState s)
- type ContractPropValidator st prop = ContractReturn MorleyLogs st -> prop
- contractProp :: (ToVal param, ToVal storage, ToT param ~ cp, ToT storage ~ st, Typeable cp, Typeable st) => Contract cp st -> ContractPropValidator st prop -> ContractEnv -> param -> storage -> prop
- contractPropVal :: (Typeable cp, Typeable st) => Contract cp st -> ContractPropValidator st prop -> ContractEnv -> Val Instr cp -> Val Instr st -> prop
Documentation
type ContractReturn s st = (Either MichelsonFailed ([Operation Instr], Val Instr st), InterpreterState s) Source #
type ContractPropValidator st prop = ContractReturn MorleyLogs 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 :: (ToVal param, ToVal storage, ToT param ~ cp, ToT storage ~ st, Typeable cp, Typeable st) => 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 :: (Typeable cp, Typeable st) => Contract cp st -> ContractPropValidator st prop -> ContractEnv -> Val Instr cp -> Val Instr st -> prop Source #
Version of contractProp
which takes Val
as arguments instead
of regular Haskell values.