plutus-tx-1.36.0.0: Libraries for Plutus Tx and its prelude
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusTx.Coverage

Synopsis

Documentation

data CoverageAnnotation Source #

Instances

Instances details
FromJSON CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

FromJSONKey CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

fromJSONKey :: FromJSONKeyFunction CoverageAnnotation

fromJSONKeyList :: FromJSONKeyFunction [CoverageAnnotation]

ToJSON CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

ToJSONKey CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

toJSONKey :: ToJSONKeyFunction CoverageAnnotation

toJSONKeyList :: ToJSONKeyFunction [CoverageAnnotation]

Generic CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Associated Types

type Rep CoverageAnnotation :: Type -> Type Source #

Read CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Show CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

NFData CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

rnf :: CoverageAnnotation -> () Source #

Flat CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

encode :: CoverageAnnotation -> Encoding

decode :: Get CoverageAnnotation

size :: CoverageAnnotation -> NumBits -> NumBits

Eq CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Ord CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Pretty CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

pretty :: CoverageAnnotation -> Doc ann

prettyList :: [CoverageAnnotation] -> Doc ann

Serialise CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

encode :: CoverageAnnotation -> Encoding

decode :: Decoder s CoverageAnnotation

encodeList :: [CoverageAnnotation] -> Encoding

decodeList :: Decoder s [CoverageAnnotation]

type Rep CoverageAnnotation Source # 
Instance details

Defined in PlutusTx.Coverage

newtype CoverageIndex Source #

This type keeps track of all coverage annotations and where they have been inserted / what annotations are expected to be found when executing a piece of code.

Instances

Instances details
FromJSON CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

parseJSON :: Value -> Parser CoverageIndex

parseJSONList :: Value -> Parser [CoverageIndex]

omittedField :: Maybe CoverageIndex

ToJSON CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

Monoid CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

Semigroup CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

Generic CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

Associated Types

type Rep CoverageIndex :: Type -> Type Source #

Show CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

NFData CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

rnf :: CoverageIndex -> () Source #

Flat CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

encode :: CoverageIndex -> Encoding

decode :: Get CoverageIndex

size :: CoverageIndex -> NumBits -> NumBits

Eq CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

Ord CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

Serialise CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

encode :: CoverageIndex -> Encoding

decode :: Decoder s CoverageIndex

encodeList :: [CoverageIndex] -> Encoding

decodeList :: Decoder s [CoverageIndex]

type Rep CoverageIndex Source # 
Instance details

Defined in PlutusTx.Coverage

type Rep CoverageIndex = D1 ('MetaData "CoverageIndex" "PlutusTx.Coverage" "plutus-tx-1.36.0.0-8y1X6QaF1WM5mIhDTsyzym" 'True) (C1 ('MetaCons "CoverageIndex" 'PrefixI 'True) (S1 ('MetaSel ('Just "_coverageMetadata") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map CoverageAnnotation CoverageMetadata))))

newtype CoverageMetadata Source #

Constructors

CoverageMetadata 

Instances

Instances details
FromJSON CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

ToJSON CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Monoid CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Semigroup CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Generic CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Associated Types

type Rep CoverageMetadata :: Type -> Type Source #

Show CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

NFData CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

rnf :: CoverageMetadata -> () Source #

Flat CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

encode :: CoverageMetadata -> Encoding

decode :: Get CoverageMetadata

size :: CoverageMetadata -> NumBits -> NumBits

Eq CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Ord CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Pretty CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

pretty :: CoverageMetadata -> Doc ann

prettyList :: [CoverageMetadata] -> Doc ann

Serialise CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

encode :: CoverageMetadata -> Encoding

decode :: Decoder s CoverageMetadata

encodeList :: [CoverageMetadata] -> Encoding

decodeList :: Decoder s [CoverageMetadata]

type Rep CoverageMetadata Source # 
Instance details

Defined in PlutusTx.Coverage

type Rep CoverageMetadata = D1 ('MetaData "CoverageMetadata" "PlutusTx.Coverage" "plutus-tx-1.36.0.0-8y1X6QaF1WM5mIhDTsyzym" 'True) (C1 ('MetaCons "CoverageMetadata" 'PrefixI 'True) (S1 ('MetaSel ('Just "_metadataSet") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set Metadata))))

data Metadata Source #

Constructors

ApplicationHeadSymbol String 
IgnoredAnnotation

Location that is not interesting to cover. This is not generated by the compiler, but can be added later using addCoverageMetadata.

Instances

Instances details
FromJSON Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

parseJSON :: Value -> Parser Metadata

parseJSONList :: Value -> Parser [Metadata]

omittedField :: Maybe Metadata

ToJSON Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

toJSON :: Metadata -> Value

toEncoding :: Metadata -> Encoding

toJSONList :: [Metadata] -> Value

toEncodingList :: [Metadata] -> Encoding

omitField :: Metadata -> Bool

Generic Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

Associated Types

type Rep Metadata :: Type -> Type Source #

Show Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

NFData Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

rnf :: Metadata -> () Source #

Flat Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

encode :: Metadata -> Encoding

decode :: Get Metadata

size :: Metadata -> NumBits -> NumBits

Eq Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

Ord Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

Pretty Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

pretty :: Metadata -> Doc ann

prettyList :: [Metadata] -> Doc ann

Serialise Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

encode :: Metadata -> Encoding

decode :: Decoder s Metadata

encodeList :: [Metadata] -> Encoding

decodeList :: Decoder s [Metadata]

type Rep Metadata Source # 
Instance details

Defined in PlutusTx.Coverage

type Rep Metadata = D1 ('MetaData "Metadata" "PlutusTx.Coverage" "plutus-tx-1.36.0.0-8y1X6QaF1WM5mIhDTsyzym" 'False) (C1 ('MetaCons "ApplicationHeadSymbol" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: C1 ('MetaCons "IgnoredAnnotation" 'PrefixI 'False) (U1 :: Type -> Type))

newtype CoverageData Source #

Instances

Instances details
FromJSON CoverageData Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

parseJSON :: Value -> Parser CoverageData

parseJSONList :: Value -> Parser [CoverageData]

omittedField :: Maybe CoverageData

ToJSON CoverageData Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

toJSON :: CoverageData -> Value

toEncoding :: CoverageData -> Encoding

toJSONList :: [CoverageData] -> Value

toEncodingList :: [CoverageData] -> Encoding

omitField :: CoverageData -> Bool

Monoid CoverageData Source # 
Instance details

Defined in PlutusTx.Coverage

Semigroup CoverageData Source # 
Instance details

Defined in PlutusTx.Coverage

Generic CoverageData Source # 
Instance details

Defined in PlutusTx.Coverage

Associated Types

type Rep CoverageData :: Type -> Type Source #

Show CoverageData Source # 
Instance details

Defined in PlutusTx.Coverage

NFData CoverageData Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

rnf :: CoverageData -> () Source #

Eq CoverageData Source # 
Instance details

Defined in PlutusTx.Coverage

Ord CoverageData Source # 
Instance details

Defined in PlutusTx.Coverage

type Rep CoverageData Source # 
Instance details

Defined in PlutusTx.Coverage

type Rep CoverageData = D1 ('MetaData "CoverageData" "PlutusTx.Coverage" "plutus-tx-1.36.0.0-8y1X6QaF1WM5mIhDTsyzym" 'True) (C1 ('MetaCons "CoverageData" 'PrefixI 'True) (S1 ('MetaSel ('Just "_coveredAnnotations") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set CoverageAnnotation))))

data CoverageReport Source #

Instances

Instances details
FromJSON CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

parseJSON :: Value -> Parser CoverageReport

parseJSONList :: Value -> Parser [CoverageReport]

omittedField :: Maybe CoverageReport

ToJSON CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

Monoid CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

Semigroup CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

Generic CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

Associated Types

type Rep CoverageReport :: Type -> Type Source #

Show CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

NFData CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

rnf :: CoverageReport -> () Source #

Eq CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

Ord CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

Pretty CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

pretty :: CoverageReport -> Doc ann

prettyList :: [CoverageReport] -> Doc ann

type Rep CoverageReport Source # 
Instance details

Defined in PlutusTx.Coverage

type Rep CoverageReport = D1 ('MetaData "CoverageReport" "PlutusTx.Coverage" "plutus-tx-1.36.0.0-8y1X6QaF1WM5mIhDTsyzym" 'False) (C1 ('MetaCons "CoverageReport" 'PrefixI 'True) (S1 ('MetaSel ('Just "_coverageIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CoverageIndex) :*: S1 ('MetaSel ('Just "_coverageData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CoverageData)))

data CovLoc Source #

A source location for coverage

Instances

Instances details
FromJSON CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

parseJSON :: Value -> Parser CovLoc

parseJSONList :: Value -> Parser [CovLoc]

omittedField :: Maybe CovLoc

ToJSON CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

toJSON :: CovLoc -> Value

toEncoding :: CovLoc -> Encoding

toJSONList :: [CovLoc] -> Value

toEncodingList :: [CovLoc] -> Encoding

omitField :: CovLoc -> Bool

Generic CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Associated Types

type Rep CovLoc :: Type -> Type Source #

Read CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Show CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

NFData CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

rnf :: CovLoc -> () Source #

Flat CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

encode :: CovLoc -> Encoding

decode :: Get CovLoc

size :: CovLoc -> NumBits -> NumBits

Eq CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Ord CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Pretty CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

pretty :: CovLoc -> Doc ann

prettyList :: [CovLoc] -> Doc ann

Serialise CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

Methods

encode :: CovLoc -> Encoding

decode :: Decoder s CovLoc

encodeList :: [CovLoc] -> Encoding

decodeList :: Decoder s [CovLoc]

type Rep CovLoc Source # 
Instance details

Defined in PlutusTx.Coverage

type Rep CovLoc = D1 ('MetaData "CovLoc" "PlutusTx.Coverage" "plutus-tx-1.36.0.0-8y1X6QaF1WM5mIhDTsyzym" 'False) (C1 ('MetaCons "CovLoc" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_covLocFile") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String) :*: S1 ('MetaSel ('Just "_covLocStartLine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "_covLocEndLine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: (S1 ('MetaSel ('Just "_covLocStartCol") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "_covLocEndCol") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))))

addCoverageMetadata :: CoverageAnnotation -> Metadata -> CoverageIndex -> CoverageIndex Source #

Add metadata to a coverage annotation. Does nothing if the annotation is not in the index.

addLocationToCoverageIndex :: MonadWriter CoverageIndex m => CovLoc -> m CoverageAnnotation Source #

Include a location coverage annotation in the index

addBoolCaseToCoverageIndex :: MonadWriter CoverageIndex m => CovLoc -> Bool -> CoverageMetadata -> m CoverageAnnotation Source #

Include a boolean coverage annotation in the index