cardano-ledger-conformance-9.9.9.9: Testing utilities for conformance testing
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cardano.Ledger.Conformance.ExecSpecRule.Core

Synopsis

Documentation

class (ShelleyEraImp era, STS (EraRule rule era), BaseM (EraRule rule era) ~ ShelleyBase, KnownSymbol rule, ForAllExecSpecRep NFData rule era, ForAllExecSpecRep ToExpr rule era, ForAllExecTypes NFData rule era, ForAllExecTypes ToExpr rule era, ForAllExecTypes EncCBOR rule era, EncCBOR (ExecContext rule era), Eq (SpecState rule era), SpecNormalize (SpecState rule era), NFData (ExecContext rule era), NFData (PredicateFailure (EraRule rule era)), NFData (SpecTRC rule era), ToExpr (ExecContext rule era), ToExpr (PredicateFailure (EraRule rule era))) ⇒ ExecSpecRule (rule ∷ Symbol) era where Source #

Minimal complete definition

runAgdaRule

Associated Types

type ExecContext rule era Source #

type ExecContext rule era = ()

type SpecEnvironment rule era Source #

type SpecEnvironment rule era = SpecRep (Environment (EraRule rule era))

type SpecState rule era Source #

type SpecState rule era = SpecRep (State (EraRule rule era))

type SpecSignal rule era Source #

type SpecSignal rule era = SpecRep (Signal (EraRule rule era))

Methods

runAgdaRuleHasCallStackSpecTRC rule era → Either Text (SpecState rule era) Source #

translateInputsHasCallStackExecContext rule era → TRC (EraRule rule era) → Either Text (SpecTRC rule era) Source #

default translateInputs ∷ (SpecTranslate (ExecContext rule era) (Environment (EraRule rule era)), SpecTranslate (ExecContext rule era) (State (EraRule rule era)), SpecTranslate (ExecContext rule era) (Signal (EraRule rule era)), SpecRep (Environment (EraRule rule era)) ~ SpecEnvironment rule era, SpecRep (State (EraRule rule era)) ~ SpecState rule era, SpecRep (Signal (EraRule rule era)) ~ SpecSignal rule era) ⇒ ExecContext rule era → TRC (EraRule rule era) → Either Text (SpecTRC rule era) Source #

translateOutputExecContext rule era → TRC (EraRule rule era) → State (EraRule rule era) → Either Text (SpecState rule era) Source #

default translateOutput ∷ (SpecTranslate (ExecContext rule era) (State (EraRule rule era)), SpecRep (State (EraRule rule era)) ~ SpecState rule era) ⇒ ExecContext rule era → TRC (EraRule rule era) → State (EraRule rule era) → Either Text (SpecState rule era) Source #

extraInfoHasCallStackGlobalsExecContext rule era → TRC (EraRule rule era) → Either Text (State (EraRule rule era), [Event (EraRule rule era)]) → Doc AnsiStyle Source #

Instances

Instances details
ExecSpecRule "CERT" ConwayEra Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Conway.Cert

Associated Types

type ExecContext "CERT" ConwayEra Source #

type SpecEnvironment "CERT" ConwayEra Source #

type SpecState "CERT" ConwayEra Source #

type SpecSignal "CERT" ConwayEra Source #

ExecSpecRule "CERTS" ConwayEra Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Conway.Certs

Associated Types

type ExecContext "CERTS" ConwayEra Source #

type SpecEnvironment "CERTS" ConwayEra Source #

type SpecState "CERTS" ConwayEra Source #

type SpecSignal "CERTS" ConwayEra Source #

ExecSpecRule "DELEG" ConwayEra Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Conway.Deleg

Associated Types

type ExecContext "DELEG" ConwayEra Source #

type SpecEnvironment "DELEG" ConwayEra Source #

type SpecState "DELEG" ConwayEra Source #

type SpecSignal "DELEG" ConwayEra Source #

ExecSpecRule "ENACT" ConwayEra Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Conway.Enact

Associated Types

type ExecContext "ENACT" ConwayEra Source #

type SpecEnvironment "ENACT" ConwayEra Source #

type SpecState "ENACT" ConwayEra Source #

type SpecSignal "ENACT" ConwayEra Source #

ExecSpecRule "EPOCH" ConwayEra Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Conway.Epoch

Associated Types

type ExecContext "EPOCH" ConwayEra Source #

type SpecEnvironment "EPOCH" ConwayEra Source #

type SpecState "EPOCH" ConwayEra Source #

type SpecSignal "EPOCH" ConwayEra Source #

ExecSpecRule "GOV" ConwayEra Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Conway.Gov

ExecSpecRule "GOVCERT" ConwayEra Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Conway.GovCert

Associated Types

type ExecContext "GOVCERT" ConwayEra Source #

type SpecEnvironment "GOVCERT" ConwayEra Source #

type SpecState "GOVCERT" ConwayEra Source #

type SpecSignal "GOVCERT" ConwayEra Source #

Methods

runAgdaRuleSpecTRC "GOVCERT" ConwayEraEither Text (SpecState "GOVCERT" ConwayEra) Source #

translateInputsExecContext "GOVCERT" ConwayEraTRC (EraRule "GOVCERT" ConwayEra) → Either Text (SpecTRC "GOVCERT" ConwayEra) Source #

translateOutputExecContext "GOVCERT" ConwayEraTRC (EraRule "GOVCERT" ConwayEra) → State (EraRule "GOVCERT" ConwayEra) → Either Text (SpecState "GOVCERT" ConwayEra) Source #

extraInfoGlobalsExecContext "GOVCERT" ConwayEraTRC (EraRule "GOVCERT" ConwayEra) → Either Text (State (EraRule "GOVCERT" ConwayEra), [Event (EraRule "GOVCERT" ConwayEra)]) → Doc AnsiStyle Source #

ExecSpecRule "LEDGER" ConwayEra Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Conway.Ledger

Associated Types

type ExecContext "LEDGER" ConwayEra Source #

type SpecEnvironment "LEDGER" ConwayEra Source #

type SpecState "LEDGER" ConwayEra Source #

type SpecSignal "LEDGER" ConwayEra Source #

ExecSpecRule "LEDGERS" ConwayEra Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Conway.Ledgers

Associated Types

type ExecContext "LEDGERS" ConwayEra Source #

type SpecEnvironment "LEDGERS" ConwayEra Source #

type SpecState "LEDGERS" ConwayEra Source #

type SpecSignal "LEDGERS" ConwayEra Source #

Methods

runAgdaRuleSpecTRC "LEDGERS" ConwayEraEither Text (SpecState "LEDGERS" ConwayEra) Source #

translateInputsExecContext "LEDGERS" ConwayEraTRC (EraRule "LEDGERS" ConwayEra) → Either Text (SpecTRC "LEDGERS" ConwayEra) Source #

translateOutputExecContext "LEDGERS" ConwayEraTRC (EraRule "LEDGERS" ConwayEra) → State (EraRule "LEDGERS" ConwayEra) → Either Text (SpecState "LEDGERS" ConwayEra) Source #

extraInfoGlobalsExecContext "LEDGERS" ConwayEraTRC (EraRule "LEDGERS" ConwayEra) → Either Text (State (EraRule "LEDGERS" ConwayEra), [Event (EraRule "LEDGERS" ConwayEra)]) → Doc AnsiStyle Source #

ExecSpecRule "NEWEPOCH" ConwayEra Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Conway.NewEpoch

Associated Types

type ExecContext "NEWEPOCH" ConwayEra Source #

type SpecEnvironment "NEWEPOCH" ConwayEra Source #

type SpecState "NEWEPOCH" ConwayEra Source #

type SpecSignal "NEWEPOCH" ConwayEra Source #

Methods

runAgdaRuleSpecTRC "NEWEPOCH" ConwayEraEither Text (SpecState "NEWEPOCH" ConwayEra) Source #

translateInputsExecContext "NEWEPOCH" ConwayEraTRC (EraRule "NEWEPOCH" ConwayEra) → Either Text (SpecTRC "NEWEPOCH" ConwayEra) Source #

translateOutputExecContext "NEWEPOCH" ConwayEraTRC (EraRule "NEWEPOCH" ConwayEra) → State (EraRule "NEWEPOCH" ConwayEra) → Either Text (SpecState "NEWEPOCH" ConwayEra) Source #

extraInfoGlobalsExecContext "NEWEPOCH" ConwayEraTRC (EraRule "NEWEPOCH" ConwayEra) → Either Text (State (EraRule "NEWEPOCH" ConwayEra), [Event (EraRule "NEWEPOCH" ConwayEra)]) → Doc AnsiStyle Source #

ExecSpecRule "POOL" ConwayEra Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Conway.Pool

Associated Types

type ExecContext "POOL" ConwayEra Source #

type SpecEnvironment "POOL" ConwayEra Source #

type SpecState "POOL" ConwayEra Source #

type SpecSignal "POOL" ConwayEra Source #

ExecSpecRule "RATIFY" ConwayEra Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Conway.Ratify

Associated Types

type ExecContext "RATIFY" ConwayEra Source #

type SpecEnvironment "RATIFY" ConwayEra Source #

type SpecState "RATIFY" ConwayEra Source #

type SpecSignal "RATIFY" ConwayEra Source #

ExecSpecRule "UTXO" ConwayEra Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Conway.Utxo

Associated Types

type ExecContext "UTXO" ConwayEra Source #

type SpecEnvironment "UTXO" ConwayEra Source #

type SpecState "UTXO" ConwayEra Source #

type SpecSignal "UTXO" ConwayEra Source #

SpecTranslate TxId (ConwayTxCert ConwayEra) ⇒ ExecSpecRule "UTXOW" ConwayEra Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Conway.Utxow

Associated Types

type ExecContext "UTXOW" ConwayEra Source #

type SpecEnvironment "UTXOW" ConwayEra Source #

type SpecState "UTXOW" ConwayEra Source #

type SpecSignal "UTXOW" ConwayEra Source #

data ConformanceResult rule era Source #

Instances

Instances details
Generic (ConformanceResult rule era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Core

Associated Types

type Rep (ConformanceResult rule era) ∷ TypeType #

Methods

fromConformanceResult rule era → Rep (ConformanceResult rule era) x #

toRep (ConformanceResult rule era) x → ConformanceResult rule era #

(Show (SpecState rule era), Show (PredicateFailure (EraRule rule era)), Show (State (EraRule rule era)), Show (Event (EraRule rule era))) ⇒ Show (ConformanceResult rule era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Core

Methods

showsPrecIntConformanceResult rule era → ShowS #

showConformanceResult rule era → String #

showList ∷ [ConformanceResult rule era] → ShowS #

(ToExpr (SpecState rule era), ToExpr (PredicateFailure (EraRule rule era)), ToExpr (State (EraRule rule era)), ToExpr (Event (EraRule rule era))) ⇒ ToExpr (ConformanceResult rule era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Core

Methods

toExprConformanceResult rule era → Expr Source #

listToExpr ∷ [ConformanceResult rule era] → Expr Source #

type Rep (ConformanceResult rule era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Core

type Rep (ConformanceResult rule era) = D1 ('MetaData "ConformanceResult" "Test.Cardano.Ledger.Conformance.ExecSpecRule.Core" "cardano-ledger-conformance-9.9.9.9-inplace" 'False) (C1 ('MetaCons "ConformanceResult" 'PrefixI 'True) (S1 ('MetaSel ('Just "crTranslationResult") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Either (NonEmpty (PredicateFailure (EraRule rule era))) (SpecState rule era))) :*: (S1 ('MetaSel ('Just "crSpecificationResult") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Either Text (SpecState rule era))) :*: S1 ('MetaSel ('Just "crImplementationResult") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Either (NonEmpty (PredicateFailure (EraRule rule era))) (State (EraRule rule era), [Event (EraRule rule era)]))))))

data SpecTRC rule era Source #

Constructors

SpecTRC 

Fields

Instances

Instances details
Generic (SpecTRC rule era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Core

Associated Types

type Rep (SpecTRC rule era) ∷ TypeType #

Methods

fromSpecTRC rule era → Rep (SpecTRC rule era) x #

toRep (SpecTRC rule era) x → SpecTRC rule era #

ForAllExecSpecRep NFData rule era ⇒ NFData (SpecTRC rule era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Core

Methods

rnfSpecTRC rule era → () #

ForAllExecSpecRep Eq rule era ⇒ Eq (SpecTRC rule era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Core

Methods

(==)SpecTRC rule era → SpecTRC rule era → Bool #

(/=)SpecTRC rule era → SpecTRC rule era → Bool #

ForAllExecSpecRep ToExpr rule era ⇒ ToExpr (SpecTRC rule era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Core

Methods

toExprSpecTRC rule era → Expr Source #

listToExpr ∷ [SpecTRC rule era] → Expr Source #

type Rep (SpecTRC rule era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Conformance.ExecSpecRule.Core

type Rep (SpecTRC rule era) = D1 ('MetaData "SpecTRC" "Test.Cardano.Ledger.Conformance.ExecSpecRule.Core" "cardano-ledger-conformance-9.9.9.9-inplace" 'False) (C1 ('MetaCons "SpecTRC" 'PrefixI 'True) (S1 ('MetaSel ('Just "strcEnvironment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SpecEnvironment rule era)) :*: (S1 ('MetaSel ('Just "strcState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SpecState rule era)) :*: S1 ('MetaSel ('Just "strcSignal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SpecSignal rule era)))))

generatesWithin ∷ ∀ a. (NFData a, ToExpr a, Typeable a, HasCallStack) ⇒ Gen a → IntSpec Source #

runConformance ∷ ∀ (rule ∷ Symbol) era. ExecSpecRule rule era ⇒ ExecContext rule era → TRC (EraRule rule era) → ImpTestM era (ConformanceResult rule era) Source #

checkConformance ∷ ∀ rule era. (HasCallStack, Era era, EncCBOR (ExecContext rule era), EncCBOR (Environment (EraRule rule era)), EncCBOR (State (EraRule rule era)), EncCBOR (Signal (EraRule rule era)), ToExpr (SpecState rule era), Eq (SpecState rule era), SpecNormalize (SpecState rule era)) ⇒ ExecContext rule era → TRC (EraRule rule era) → Either Text (SpecState rule era) → Either Text (SpecState rule era) → ImpTestM era () Source #

testConformance ∷ ∀ rule era. (HasCallStack, ExecSpecRule rule era) ⇒ ExecContext rule era → TRC (EraRule rule era) → Property Source #

translateWithContextSpecTranslate ctx a ⇒ ctx → a → ImpTestM era (Either Text (SpecRep a)) Source #

Translate a Haskell type a whose translation context is ctx into its Agda type, in the ImpTest monad.

type ForAllExecSpecRep (c ∷ TypeConstraint) rule era = (c (SpecEnvironment rule era), c (SpecState rule era), c (SpecSignal rule era)) Source #

type ForAllExecTypes (c ∷ TypeConstraint) rule era = (c (Environment (EraRule rule era)), c (State (EraRule rule era)), c (Signal (EraRule rule era))) Source #

runFromAgdaFunction ∷ (SpecEnvironment rule era → SpecState rule era → SpecSignal rule era → ComputationResult Text (SpecState rule era)) → SpecTRC rule era → Either Text (SpecState rule era) Source #