cardano-ledger-shelley-test-1.4.0.3: Test helpers from cardano-ledger-shelley exposed to other packages
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cardano.Ledger.Shelley.Rules.Chain

Synopsis

Documentation

data CHAIN era Source #

Instances

Instances details
(Era era, Era era, PredicateFailure (EraRule "TICKN" era) ~ TicknPredicateFailure, Event (EraRule "TICKN" era) ~ Void) ⇒ Embed TICKN (CHAIN era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

(EraGov era, Embed (EraRule "BBODY" era) (CHAIN era), Environment (EraRule "BBODY" era) ~ BbodyEnv era, State (EraRule "BBODY" era) ~ ShelleyBbodyState era, Signal (EraRule "BBODY" era) ~ Block (BHeaderView (EraCrypto era)) era, Embed (EraRule "TICKN" era) (CHAIN era), Environment (EraRule "TICKN" era) ~ TicknEnv, State (EraRule "TICKN" era) ~ TicknState, Signal (EraRule "TICKN" era) ~ Bool, Embed (EraRule "TICK" era) (CHAIN era), Environment (EraRule "TICK" era) ~ (), State (EraRule "TICK" era) ~ NewEpochState era, Signal (EraRule "TICK" era) ~ SlotNo, Embed (PRTCL (EraCrypto era)) (CHAIN era), EncCBORGroup (TxSeq era), ProtVerAtMost era 6, State (EraRule "LEDGERS" era) ~ LedgerState era) ⇒ STS (CHAIN era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

Associated Types

type State (CHAIN era) Source #

type Signal (CHAIN era) Source #

type Environment (CHAIN era) Source #

type BaseM (CHAIN era) ∷ TypeType Source #

type Event (CHAIN era) Source #

type PredicateFailure (CHAIN era) Source #

(Era era, Era era, STS (ShelleyBBODY era), PredicateFailure (EraRule "BBODY" era) ~ ShelleyBbodyPredFailure era, Event (EraRule "BBODY" era) ~ Event (ShelleyBBODY era)) ⇒ Embed (ShelleyBBODY era) (CHAIN era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

(Era era, Era era, STS (ShelleyTICK era), PredicateFailure (EraRule "TICK" era) ~ ShelleyTickPredFailure era, Event (EraRule "TICK" era) ~ ShelleyTickEvent era) ⇒ Embed (ShelleyTICK era) (CHAIN era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

(Era era, c ~ EraCrypto era, Era era, STS (PRTCL c)) ⇒ Embed (PRTCL c) (CHAIN era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

(EraGen era, EraSegWits era, Mock (EraCrypto era), ApplyBlock era, GetLedgerView era, MinLEDGER_STS era, MinCHAIN_STS era, Embed (EraRule "BBODY" era) (CHAIN era), Environment (EraRule "BBODY" era) ~ BbodyEnv era, State (EraRule "BBODY" era) ~ ShelleyBbodyState era, Signal (EraRule "BBODY" era) ~ Block (BHeaderView (EraCrypto era)) era, Embed (EraRule "TICKN" era) (CHAIN era), Environment (EraRule "TICKN" era) ~ TicknEnv, State (EraRule "TICKN" era) ~ TicknState, Signal (EraRule "TICKN" era) ~ Bool, Embed (EraRule "TICK" era) (CHAIN era), Environment (EraRule "TICK" era) ~ (), State (EraRule "TICK" era) ~ NewEpochState era, Signal (EraRule "TICK" era) ~ SlotNo, HasTrace (EraRule "LEDGERS" era) (GenEnv era)) ⇒ HasTrace (CHAIN era) (GenEnv era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Generator.Trace.Chain

Associated Types

type BaseEnv (CHAIN era) Source #

Methods

interpretSTSHasCallStackBaseEnv (CHAIN era) → BaseM (CHAIN era) a → a Source #

envGenGenEnv era → Gen (Environment (CHAIN era)) Source #

sigGenGenEnv era → Environment (CHAIN era) → State (CHAIN era) → Gen (Signal (CHAIN era)) Source #

shrinkSignalSignal (CHAIN era) → [Signal (CHAIN era)] Source #

type BaseM (CHAIN era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

type BaseM (CHAIN era) = ShelleyBase
type Environment (CHAIN era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

type Environment (CHAIN era) = ()
type Event (CHAIN era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

type Event (CHAIN era) = ChainEvent era
type PredicateFailure (CHAIN era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

type Signal (CHAIN era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

type Signal (CHAIN era) = Block (BHeader (EraCrypto era)) era
type State (CHAIN era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

type State (CHAIN era) = ChainState era
type BaseEnv (CHAIN era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Generator.Trace.Chain

type BaseEnv (CHAIN era) = Globals

data ChainState era Source #

Instances

Instances details
Generic (ChainState era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

Associated Types

type Rep (ChainState era) ∷ TypeType Source #

Methods

fromChainState era → Rep (ChainState era) x Source #

toRep (ChainState era) x → ChainState era Source #

Show (NewEpochState era) ⇒ Show (ChainState era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

Methods

showsPrecIntChainState era → ShowS Source #

showChainState era → String Source #

showList ∷ [ChainState era] → ShowS Source #

NFData (NewEpochState era) ⇒ NFData (ChainState era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

Methods

rnfChainState era → () Source #

Eq (NewEpochState era) ⇒ Eq (ChainState era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

Methods

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

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

(ToExpr (PParams era), ToExpr (TxOut era), ToExpr (StashedAVVMAddresses era), ToExpr (GovState era)) ⇒ ToExpr (ChainState era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

Methods

toExprChainState era → Expr Source #

listToExpr ∷ [ChainState era] → Expr Source #

type Rep (ChainState era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

type Rep (ChainState era) = D1 ('MetaData "ChainState" "Test.Cardano.Ledger.Shelley.Rules.Chain" "cardano-ledger-shelley-test-1.4.0.3-inplace" 'False) (C1 ('MetaCons "ChainState" 'PrefixI 'True) ((S1 ('MetaSel ('Just "chainNes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NewEpochState era)) :*: (S1 ('MetaSel ('Just "chainOCertIssue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map (KeyHash 'BlockIssuer (EraCrypto era)) Word64)) :*: S1 ('MetaSel ('Just "chainEpochNonce") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Nonce))) :*: ((S1 ('MetaSel ('Just "chainEvolvingNonce") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Nonce) :*: S1 ('MetaSel ('Just "chainCandidateNonce") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Nonce)) :*: (S1 ('MetaSel ('Just "chainPrevEpochNonce") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Nonce) :*: S1 ('MetaSel ('Just "chainLastAppliedBlock") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (WithOrigin (LastAppliedBlock (EraCrypto era))))))))

data TestChainPredicateFailure era Source #

Instances

Instances details
Generic (TestChainPredicateFailure era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

Associated Types

type Rep (TestChainPredicateFailure era) ∷ TypeType Source #

(Era era, Show (PredicateFailure (EraRule "BBODY" era)), Show (PredicateFailure (EraRule "TICK" era)), Show (PredicateFailure (EraRule "TICKN" era))) ⇒ Show (TestChainPredicateFailure era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

(Era era, Eq (PredicateFailure (EraRule "BBODY" era)), Eq (PredicateFailure (EraRule "TICK" era)), Eq (PredicateFailure (EraRule "TICKN" era))) ⇒ Eq (TestChainPredicateFailure era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

(Era era, NoThunks (PredicateFailure (EraRule "BBODY" era)), NoThunks (PredicateFailure (EraRule "TICK" era)), NoThunks (PredicateFailure (EraRule "TICKN" era))) ⇒ NoThunks (TestChainPredicateFailure era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

type Rep (TestChainPredicateFailure era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

type Rep (TestChainPredicateFailure era) = D1 ('MetaData "TestChainPredicateFailure" "Test.Cardano.Ledger.Shelley.Rules.Chain" "cardano-ledger-shelley-test-1.4.0.3-inplace" 'False) ((C1 ('MetaCons "RealChainPredicateFailure" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainPredicateFailure)) :+: (C1 ('MetaCons "BbodyFailure" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PredicateFailure (EraRule "BBODY" era)))) :+: C1 ('MetaCons "TickFailure" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PredicateFailure (EraRule "TICK" era)))))) :+: (C1 ('MetaCons "TicknFailure" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PredicateFailure (EraRule "TICKN" era)))) :+: (C1 ('MetaCons "PrtclFailure" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PredicateFailure (PRTCL (EraCrypto era))))) :+: C1 ('MetaCons "PrtclSeqFailure" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PrtlSeqFailure (EraCrypto era)))))))

data ChainEvent era Source #

Constructors

BbodyEvent !(Event (EraRule "BBODY" era)) 
TickEvent !(Event (EraRule "TICK" era)) 
TicknEvent !(Event (EraRule "TICKN" era)) 
PrtclEvent !(Event (PRTCL (EraCrypto era))) 

type family PredicateFailure a Source #

Descriptive type for the possible failures which might cause a transition to fail.

As a convention, PredicateFailures which are "structural" (meaning that they are not "throwable" in practice, and are used to pass control from one transition rule to another) are prefixed with S_.

Structural PredicateFailures represent conditions between rules where the disjunction of all rules' preconditions is equal to True. That is, either one rule will throw a structural PredicateFailure and the other will succeed, or vice-versa.

Instances

Instances details
type PredicateFailure TICKN 
Instance details

Defined in Cardano.Protocol.TPraos.Rules.Tickn

type PredicateFailure (AllegraUTXO era) 
Instance details

Defined in Cardano.Ledger.Allegra.Rules.Utxo

type PredicateFailure (AllegraUTXOW era) 
Instance details

Defined in Cardano.Ledger.Allegra.Rules.Utxow

type PredicateFailure (AlonzoBBODY era) 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Bbody

type PredicateFailure (AlonzoLEDGER era) 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Ledger

type PredicateFailure (AlonzoUTXO era) 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

type PredicateFailure (AlonzoUTXOS era) 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Utxos

type PredicateFailure (AlonzoUTXOW era) 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Utxow

type PredicateFailure (BabbageLEDGER era) 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Ledger

type PredicateFailure (BabbageUTXO era) 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

type PredicateFailure (BabbageUTXOS era) 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxos

type PredicateFailure (BabbageUTXOW era) 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxow

type PredicateFailure (ConwayBBODY era) 
Instance details

Defined in Cardano.Ledger.Conway.Rules.Bbody

type PredicateFailure (ConwayCERT era) 
Instance details

Defined in Cardano.Ledger.Conway.Rules.Cert

type PredicateFailure (ConwayCERTS era) 
Instance details

Defined in Cardano.Ledger.Conway.Rules.Certs

type PredicateFailure (ConwayDELEG era) 
Instance details

Defined in Cardano.Ledger.Conway.Rules.Deleg

type PredicateFailure (ConwayENACT era) 
Instance details

Defined in Cardano.Ledger.Conway.Rules.Enact

type PredicateFailure (ConwayEPOCH era) 
Instance details

Defined in Cardano.Ledger.Conway.Rules.Epoch

type PredicateFailure (ConwayGOV era) 
Instance details

Defined in Cardano.Ledger.Conway.Rules.Gov

type PredicateFailure (ConwayGOVCERT era) 
Instance details

Defined in Cardano.Ledger.Conway.Rules.GovCert

type PredicateFailure (ConwayLEDGER era) 
Instance details

Defined in Cardano.Ledger.Conway.Rules.Ledger

type PredicateFailure (ConwayNEWEPOCH era) 
Instance details

Defined in Cardano.Ledger.Conway.Rules.NewEpoch

type PredicateFailure (ConwayRATIFY era) 
Instance details

Defined in Cardano.Ledger.Conway.Rules.Ratify

type PredicateFailure (ConwayTICKF era) 
Instance details

Defined in Cardano.Ledger.Conway.Rules.Tickf

type PredicateFailure (ConwayUTXO era) 
Instance details

Defined in Cardano.Ledger.Conway.Rules.Utxo

type PredicateFailure (ConwayUTXOS era) 
Instance details

Defined in Cardano.Ledger.Conway.Rules.Utxos

type PredicateFailure (ConwayUTXOW era) 
Instance details

Defined in Cardano.Ledger.Conway.Rules.Utxow

type PredicateFailure (ShelleyBBODY era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Bbody

type PredicateFailure (ShelleyDELEG era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Deleg

type PredicateFailure (ShelleyDELEGS era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Delegs

type PredicateFailure (ShelleyDELPL era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Delpl

type PredicateFailure (ShelleyEPOCH era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Epoch

type PredicateFailure (ShelleyLEDGER era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Ledger

type PredicateFailure (ShelleyLEDGERS era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Ledgers

type PredicateFailure (ShelleyMIR era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Mir

type PredicateFailure (ShelleyNEWEPOCH era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.NewEpoch

type PredicateFailure (ShelleyNEWPP era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Newpp

type PredicateFailure (ShelleyPOOL era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Pool

type PredicateFailure (ShelleyPOOLREAP era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.PoolReap

type PredicateFailure (ShelleyPPUP era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Ppup

type PredicateFailure (ShelleyRUPD era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Rupd

type PredicateFailure (ShelleySNAP era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Snap

type PredicateFailure (ShelleyTICK era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Tick

type PredicateFailure (ShelleyTICKF era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Tick

type PredicateFailure (ShelleyUPEC era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Upec

type PredicateFailure (ShelleyUTXO era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxo

type PredicateFailure (ShelleyUTXOW era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

type PredicateFailure (CERTS era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Generator.Trace.TxCert

type PredicateFailure (CHAIN era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Rules.Chain

type PredicateFailure (OCERT c) 
Instance details

Defined in Cardano.Protocol.TPraos.Rules.OCert

type PredicateFailure (OVERLAY c) 
Instance details

Defined in Cardano.Protocol.TPraos.Rules.Overlay

type PredicateFailure (PRTCL c) 
Instance details

Defined in Cardano.Protocol.TPraos.Rules.Prtcl

type PredicateFailure (UPDN c) 
Instance details

Defined in Cardano.Protocol.TPraos.Rules.Updn

type PredicateFailure (STUB e st si f m) 
Instance details

Defined in Control.State.Transition.Extended

type PredicateFailure (STUB e st si f m) = f

data AdaPots Source #

Instances

Instances details
Generic AdaPots 
Instance details

Defined in Cardano.Ledger.Shelley.AdaPots

Associated Types

type Rep AdaPotsTypeType Source #

Methods

fromAdaPotsRep AdaPots x Source #

toRep AdaPots x → AdaPots Source #

Show AdaPots 
Instance details

Defined in Cardano.Ledger.Shelley.AdaPots

NFData AdaPots 
Instance details

Defined in Cardano.Ledger.Shelley.AdaPots

Methods

rnfAdaPots → () Source #

Eq AdaPots 
Instance details

Defined in Cardano.Ledger.Shelley.AdaPots

Methods

(==)AdaPotsAdaPotsBool Source #

(/=)AdaPotsAdaPotsBool Source #

type Rep AdaPots 
Instance details

Defined in Cardano.Ledger.Shelley.AdaPots

type Rep AdaPots = D1 ('MetaData "AdaPots" "Cardano.Ledger.Shelley.AdaPots" "cardano-ledger-shelley-1.12.2.1-inplace" 'False) (C1 ('MetaCons "AdaPots" 'PrefixI 'True) ((S1 ('MetaSel ('Just "treasuryAdaPot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Coin) :*: (S1 ('MetaSel ('Just "reservesAdaPot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Coin) :*: S1 ('MetaSel ('Just "rewardsAdaPot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Coin))) :*: (S1 ('MetaSel ('Just "utxoAdaPot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Coin) :*: (S1 ('MetaSel ('Just "feesAdaPot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Coin) :*: S1 ('MetaSel ('Just "obligationsPot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Obligations)))))

initialShelleyState ∷ ∀ era. (EraTxOut era, EraGov era, Default (StashedAVVMAddresses era)) ⇒ WithOrigin (LastAppliedBlock (EraCrypto era)) → EpochNoUTxO era → CoinMap (KeyHash 'Genesis (EraCrypto era)) (GenDelegPair (EraCrypto era)) → PParams era → NonceChainState era Source #

Creates a valid initial chain state

totalAda ∷ (EraTxOut era, EraGov era) ⇒ ChainState era → Coin Source #

Calculate the total ada in the chain state

totalAdaPots ∷ (EraTxOut era, EraGov era) ⇒ ChainState era → AdaPots Source #

Calculate the total ada pots in the chain state

Orphan instances

ToExpr (HashHeader c) Source # 
Instance details

ToExpr (LastAppliedBlock c) Source # 
Instance details