cardano-ledger-test-9.9.9.9: Testing harness, tests and benchmarks for Shelley style cardano ledgers
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Synopsis

Documentation

class (Eq (ProofType hashtype era), EncCBOR (ProofType hashtype era), ToExpr (ProofType hashtype era), NFData (ProofType hashtype era), NFData hashtype, Eq hashtype) ⇒ HasWitness hashtype era where Source #

Associated Types

type ProofType hashtype era Source #

type WitnessType hashtype era Source #

type TypeHashed hashtype era Source #

Methods

hashTypeHashed hashtype era → hashtype Source #

mkWitnessProofType hashtype era → WitnessType hashtype era Source #

getTypeHashedProofType hashtype era → TypeHashed hashtype era Source #

prettyHash ∷ hashtype → PDoc Source #

Instances

Instances details
Reflect era ⇒ HasWitness BootstrapAddress era Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

EraScript era ⇒ HasWitness DataHash era Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Associated Types

type ProofType DataHash era Source #

type WitnessType DataHash era Source #

type TypeHashed DataHash era Source #

GenScript era ⇒ HasWitness ScriptHash era Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Reflect era ⇒ HasWitness (KeyHash 'Witness) era Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Associated Types

type ProofType (KeyHash 'Witness) era Source #

type WitnessType (KeyHash 'Witness) era Source #

type TypeHashed (KeyHash 'Witness) era Source #

data WitBlock t era where Source #

A WitBlock is designed to have five purposes 1) To efficiently constrain objects to be witnessed when using constraint generators the (Set hashtype) allows efficient constraints like :: (member_ t) (lit (wbHash witblock)) 2) To efficiently compute witnesses from a hashtype the (Map hashtype (ProofType hashtype era)) can be used like this case Map.lookup hash (wbMap witblock) of Just base -> mkWitness base Nothing -> error "Missing hash. perhaps generator did not constrain the hash to be witnessed?" 3) When (HasWitness hashtype era) holds, the WitBlock can be computed from only [ProofType hashtype era] using getTypeHashed. This makes Gen and CBOR instances, especially easy. We compute only with [ProofType hashtype era] and then reconstruct the rest 4) WitBlock is a Monoid, so we can combine them easily 5) We can easily make (Gen (WitBlock t era)), so we can make them for testing.

Constructors

WitBlock ∷ (Era era, HasWitness t era) ⇒ Set t → Map t (ProofType t era) → WitBlock t era 

Instances

Instances details
(Era era, Ord t, HasWitness t era) ⇒ Monoid (WitBlock t era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

memptyWitBlock t era Source #

mappendWitBlock t era → WitBlock t era → WitBlock t era Source #

mconcat ∷ [WitBlock t era] → WitBlock t era Source #

Ord t ⇒ Semigroup (WitBlock t era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

(<>)WitBlock t era → WitBlock t era → WitBlock t era Source #

sconcatNonEmpty (WitBlock t era) → WitBlock t era Source #

stimesIntegral b ⇒ b → WitBlock t era → WitBlock t era Source #

Show (WitBlock t era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

showsPrecIntWitBlock t era → ShowS Source #

showWitBlock t era → String Source #

showList ∷ [WitBlock t era] → ShowS Source #

(Era era, Typeable t) ⇒ EncCBOR (WitBlock t era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

encCBORWitBlock t era → Encoding Source #

encodedSizeExpr ∷ (∀ t0. EncCBOR t0 ⇒ Proxy t0 → Size) → Proxy (WitBlock t era) → Size Source #

encodedListSizeExpr ∷ (∀ t0. EncCBOR t0 ⇒ Proxy t0 → Size) → Proxy [WitBlock t era] → Size Source #

PrettyA (WitBlock t era) Source #

when we print a WitBlock, we are only interested in the hashes, not the witnesses

Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

prettyAWitBlock t era → PDoc Source #

NFData (WitBlock t era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

rnfWitBlock t era → () Source #

Eq (WitBlock t era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

(==)WitBlock t era → WitBlock t era → Bool Source #

(/=)WitBlock t era → WitBlock t era → Bool Source #

ToExpr t ⇒ ToExpr (WitBlock t era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

toExprWitBlock t era → Expr Source #

listToExpr ∷ [WitBlock t era] → Expr Source #

wbHashWitBlock t era → Set t Source #

wbMapWitBlock t era → Map t (ProofType t era) Source #

data WitUniv era Source #

Instances

Instances details
(HasWitness ScriptHash era, GenScript era) ⇒ Arbitrary (WitUniv era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

arbitraryGen (WitUniv era) Source #

shrinkWitUniv era → [WitUniv era] Source #

(Reflect era, HasWitness ScriptHash era) ⇒ Monoid (WitUniv era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

memptyWitUniv era Source #

mappendWitUniv era → WitUniv era → WitUniv era Source #

mconcat ∷ [WitUniv era] → WitUniv era Source #

Era era ⇒ Semigroup (WitUniv era) Source #

Easy to extend Monoid from WitBlock to WitUniv

Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

(<>)WitUniv era → WitUniv era → WitUniv era Source #

sconcatNonEmpty (WitUniv era) → WitUniv era Source #

stimesIntegral b ⇒ b → WitUniv era → WitUniv era Source #

Generic (WitUniv era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Associated Types

type Rep (WitUniv era) ∷ TypeType Source #

Methods

fromWitUniv era → Rep (WitUniv era) x Source #

toRep (WitUniv era) x → WitUniv era Source #

Reflect era ⇒ Show (WitUniv era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

showsPrecIntWitUniv era → ShowS Source #

showWitUniv era → String Source #

showList ∷ [WitUniv era] → ShowS Source #

Era era ⇒ EncCBOR (WitUniv era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

encCBORWitUniv era → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (WitUniv era) → Size Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [WitUniv era] → Size Source #

Reflect era ⇒ PrettyA (WitUniv era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

prettyAWitUniv era → PDoc Source #

NFData (WitUniv era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

rnfWitUniv era → () Source #

Eq (WitUniv era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

(==)WitUniv era → WitUniv era → Bool Source #

(/=)WitUniv era → WitUniv era → Bool Source #

ToExpr (WitUniv era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

toExprWitUniv era → Expr Source #

listToExpr ∷ [WitUniv era] → Expr Source #

type Rep (WitUniv era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

type Rep (WitUniv era) = D1 ('MetaData "WitUniv" "Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse" "cardano-ledger-test-9.9.9.9-inplace" 'False) (C1 ('MetaCons "WitUniv" 'PrefixI 'True) ((S1 ('MetaSel ('Just "wvSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "wvVKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (WitBlock (KeyHash 'Witness) era))) :*: (S1 ('MetaSel ('Just "wvBoot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (WitBlock BootstrapAddress era)) :*: (S1 ('MetaSel ('Just "wvScript") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (WitBlock ScriptHash era)) :*: S1 ('MetaSel ('Just "wvDats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (WitBlock DataHash era))))))

witKeyHashSpec ∷ ∀ fn era krole. (IsConwayUniv fn, Typeable krole) ⇒ WitUniv era → Specification fn (KeyHash krole) Source #

witCredSpec ∷ ∀ fn era krole. (IsConwayUniv fn, Typeable krole) ⇒ WitUniv era → Specification fn (Credential krole) Source #

witDRepSpec ∷ ∀ fn era. IsConwayUniv fn ⇒ WitUniv era → Specification fn DRep Source #

witRewardAccountSpec ∷ ∀ fn era. IsConwayUniv fn ⇒ WitUniv era → Specification fn RewardAccount Source #

Used only in Withdrawals, other RewardAccounts, not being withdrawn do not need witnessing

witShelleyTxCert ∷ ∀ fn era. (Era era, IsConwayUniv fn) ⇒ WitUniv era → Specification fn (ShelleyTxCert era) Source #

Constrains all the Certificate Authors. Sometimes thay are keyHashes, and sometimes Credentials

witConwayTxCert ∷ ∀ fn era. (Era era, IsConwayUniv fn) ⇒ WitUniv era → Specification fn (ConwayTxCert era) Source #

Constrains all the Certificate Authors. Sometimes thay are keyHashes, and sometimes Credentials

witnessBootAddr ∷ ∀ era. Reflect era ⇒ BodyHashBootstrapAddressWitUniv era → TxWits era Source #

witnessKeyHash ∷ ∀ era. Reflect era ⇒ BodyHashKeyHash 'WitnessWitUniv era → TxWits era Source #

witnessScriptHash ∷ ∀ era. EraTxWits era ⇒ ScriptHashWitUniv era → TxWits era Source #

witnessDataHash ∷ ∀ era. AlonzoEraTxWits era ⇒ DataHashWitUniv era → TxWits era Source #

blockFromProofList ∷ ∀ t era. (Era era, Ord t, HasWitness t era) ⇒ [ProofType t era] → WitBlock t era Source #

Reconstruct a (WitBlock t era) from only a [ProofType t era]

genWitBlock ∷ ∀ t era. (Era era, Ord t, HasWitness t era) ⇒ IntGen (ProofType t era) → Gen (WitBlock t era) Source #

genWitUniv ∷ ∀ era. (GenScript era, HasWitness ScriptHash era) ⇒ IntGen (WitUniv era) Source #

class Witnessed fn era t where Source #

The class of things we know how to witness. This way you don't have to remember long complicated names.

Methods

witnessWitUniv era → Term fn t → Pred fn Source #

Instances

Instances details
(IsConwayUniv fn, Era era) ⇒ Witnessed fn era BootstrapAddress Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

witnessWitUniv era → Term fn BootstrapAddressPred fn Source #

(IsConwayUniv fn, Era era) ⇒ Witnessed fn era RewardAccount Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

witnessWitUniv era → Term fn RewardAccountPred fn Source #

(IsConwayUniv fn, Era era) ⇒ Witnessed fn era DRep Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

witnessWitUniv era → Term fn DRepPred fn Source #

(IsConwayUniv fn, Era era) ⇒ Witnessed fn era GenDelegPair Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

witnessWitUniv era → Term fn GenDelegPairPred fn Source #

(IsConwayUniv fn, Era era) ⇒ Witnessed fn era ScriptHash Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

witnessWitUniv era → Term fn ScriptHashPred fn Source #

(IsConwayUniv fn, Era era) ⇒ Witnessed fn era PoolParams Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

witnessWitUniv era → Term fn PoolParamsPred fn Source #

(IsConwayUniv fn, EraSpecPParams era) ⇒ Witnessed fn era (Committee era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

witnessWitUniv era → Term fn (Committee era) → Pred fn Source #

(IsConwayUniv fn, Era era) ⇒ Witnessed fn era (ConwayTxCert era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

witnessWitUniv era → Term fn (ConwayTxCert era) → Pred fn Source #

(IsConwayUniv fn, Era era, Typeable r) ⇒ Witnessed fn era (Credential r) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

witnessWitUniv era → Term fn (Credential r) → Pred fn Source #

(IsConwayUniv fn, Era era, Typeable r) ⇒ Witnessed fn era (KeyHash r) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

witnessWitUniv era → Term fn (KeyHash r) → Pred fn Source #

(IsConwayUniv fn, Era era) ⇒ Witnessed fn era (ShelleyTxCert era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

witnessWitUniv era → Term fn (ShelleyTxCert era) → Pred fn Source #

(Era era, HasSpec fn t, Witnessed fn era t, IsNormalType t) ⇒ Witnessed fn era (StrictMaybe t) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

witnessWitUniv era → Term fn (StrictMaybe t) → Pred fn Source #

(Era era, HasSpec fn t, Ord t, Witnessed fn era t) ⇒ Witnessed fn era (Set t) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

witnessWitUniv era → Term fn (Set t) → Pred fn Source #

(Era era, HasSpec fn t, Witnessed fn era t, IsNormalType t) ⇒ Witnessed fn era (Maybe t) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

witnessWitUniv era → Term fn (Maybe t) → Pred fn Source #

(Era era, HasSpec fn t, Witnessed fn era t) ⇒ Witnessed fn era [t] Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

witnessWitUniv era → Term fn [t] → Pred fn Source #

(Era era, HasSpec fn t, HasSpec fn v, Ord t, Witnessed fn era t) ⇒ Witnessed fn era (Map t v) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Conway.WitnessUniverse

Methods

witnessWitUniv era → Term fn (Map t v) → Pred fn Source #

class (EraTxCert era, HasSpec fn (TxCert era)) ⇒ EraSpecTxCert fn era where Source #

Parametric TxCert

Methods

witTxCertWitUniv era → Specification fn (TxCert era) Source #

go1IO () Source #

go2IO () Source #

govActionStateWitness ∷ ∀ fn era. (IsConwayUniv fn, EraSpecPParams era) ⇒ WitUniv era → Specification fn (GovActionState era) Source #

Constrains just the parts that need witnessing in GovActionState

govActionWitness ∷ ∀ fn era. (IsConwayUniv fn, EraSpecPParams era) ⇒ WitUniv era → Specification fn (GovAction era) Source #

Constrains just the parts that need witnessing in GovAction

proposalProcedureWitness ∷ ∀ fn era. (IsConwayUniv fn, EraSpecPParams era) ⇒ WitUniv era → Specification fn (ProposalProcedure era) Source #

Constrains just the parts that need witnessing in ProposalProcedure

committeeWitness ∷ (IsConwayUniv fn, EraSpecPParams era) ⇒ WitUniv era → Specification fn (Committee era) Source #

Constrains just the parts that need witnessing in Committee

go9IO () Source #

Orphan instances

ToExpr SigningKey Source # 
Instance details

(IsConwayUniv fn, Era era) ⇒ HasSpec fn (TxDats era) Source # 
Instance details

Associated Types

type TypeSpec fn (TxDats era) Source #

type Prerequisites fn (TxDats era) Source #

(IsConwayUniv fn, ShelleyEraScript era, NativeScript era ~ MultiSig era) ⇒ HasSpec fn (MultiSig era) Source # 
Instance details

Associated Types

type TypeSpec fn (MultiSig era) Source #

type Prerequisites fn (MultiSig era) Source #

AlonzoEraScript era ⇒ HasSimpleRep (Redeemers era) Source # 
Instance details

Associated Types

type SimpleRep (Redeemers era) Source #

type TheSop (Redeemers era) ∷ [Type] Source #

Era era ⇒ HasSimpleRep (TxDats era) Source # 
Instance details

Associated Types

type SimpleRep (TxDats era) Source #

type TheSop (TxDats era) ∷ [Type] Source #