| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Test.Cardano.Ledger.Shelley.Rules.Chain
Contents
Synopsis
- data CHAIN era
- data ChainState era = ChainState {}
- data TestChainPredicateFailure era
- = RealChainPredicateFailure ChainPredicateFailure
- | BbodyFailure (PredicateFailure (EraRule "BBODY" era))
- | TicknFailure (PredicateFailure (EraRule "TICKN" era))
- | PrtclFailure (PredicateFailure (PRTCL MockCrypto))
- | PrtclSeqFailure PrtlSeqFailure
- data ChainEvent era
- = BbodyEvent !(Event (EraRule "BBODY" era))
- | TickEvent !(Event (EraRule "TICK" era))
- | TicknEvent !(Event (EraRule "TICKN" era))
- | PrtclEvent !(Event (PRTCL MockCrypto))
- type family PredicateFailure a
- data AdaPots = AdaPots {}
- initialShelleyState ∷ (EraGov era, EraStake era, EraCertState era, Default (StashedAVVMAddresses era)) ⇒ WithOrigin LastAppliedBlock → EpochNo → UTxO era → Coin → Map (KeyHash 'GenesisRole) GenDelegPair → PParams era → Nonce → ChainState era
- totalAda ∷ (EraTxOut era, EraGov era, EraCertState era) ⇒ ChainState era → Coin
- totalAdaPots ∷ (EraTxOut era, EraGov era, EraCertState era) ⇒ ChainState era → AdaPots
- chainStateNesL ∷ ∀ era f. Functor f ⇒ (NewEpochState era → f (NewEpochState era)) → ChainState era → f (ChainState era)
Documentation
Instances
data ChainState era Source #
Constructors
| ChainState | |
Instances
| NFData (NewEpochState era) ⇒ NFData (ChainState era) Source # | |||||
Defined in Test.Cardano.Ledger.Shelley.Rules.Chain Methods rnf ∷ ChainState era → () # | |||||
| Generic (ChainState era) Source # | |||||
Defined in Test.Cardano.Ledger.Shelley.Rules.Chain Associated Types
Methods from ∷ ChainState era → Rep (ChainState era) x # to ∷ Rep (ChainState era) x → ChainState era # | |||||
| Show (NewEpochState era) ⇒ Show (ChainState era) Source # | |||||
Defined in Test.Cardano.Ledger.Shelley.Rules.Chain Methods showsPrec ∷ Int → ChainState era → ShowS # show ∷ ChainState era → String # showList ∷ [ChainState era] → ShowS # | |||||
| Eq (NewEpochState era) ⇒ Eq (ChainState era) Source # | |||||
Defined in Test.Cardano.Ledger.Shelley.Rules.Chain Methods (==) ∷ ChainState era → ChainState era → Bool # (/=) ∷ ChainState era → ChainState era → Bool # | |||||
| (ToExpr (PParams era), ToExpr (TxOut era), ToExpr (StashedAVVMAddresses era), ToExpr (GovState era), ToExpr (CertState era), ToExpr (InstantStake era)) ⇒ ToExpr (ChainState era) Source # | |||||
Defined in Test.Cardano.Ledger.Shelley.Rules.Chain | |||||
| type Rep (ChainState era) Source # | |||||
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.7.0.1-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) 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)))))) | |||||
data TestChainPredicateFailure era Source #
Constructors
| RealChainPredicateFailure ChainPredicateFailure | |
| BbodyFailure (PredicateFailure (EraRule "BBODY" era)) | |
| TicknFailure (PredicateFailure (EraRule "TICKN" era)) | |
| PrtclFailure (PredicateFailure (PRTCL MockCrypto)) | |
| PrtclSeqFailure PrtlSeqFailure |
Instances
| Generic (TestChainPredicateFailure era) Source # | |||||
Defined in Test.Cardano.Ledger.Shelley.Rules.Chain Associated Types
Methods from ∷ TestChainPredicateFailure era → Rep (TestChainPredicateFailure era) x # to ∷ Rep (TestChainPredicateFailure era) x → TestChainPredicateFailure era # | |||||
| (Era era, Show (PredicateFailure (EraRule "BBODY" era)), Show (PredicateFailure (EraRule "TICK" era)), Show (PredicateFailure (EraRule "TICKN" era))) ⇒ Show (TestChainPredicateFailure era) Source # | |||||
Defined in Test.Cardano.Ledger.Shelley.Rules.Chain Methods showsPrec ∷ Int → TestChainPredicateFailure era → ShowS # show ∷ TestChainPredicateFailure era → String # showList ∷ [TestChainPredicateFailure era] → ShowS # | |||||
| (Era era, Eq (PredicateFailure (EraRule "BBODY" era)), Eq (PredicateFailure (EraRule "TICK" era)), Eq (PredicateFailure (EraRule "TICKN" era))) ⇒ Eq (TestChainPredicateFailure era) Source # | |||||
Defined in Test.Cardano.Ledger.Shelley.Rules.Chain Methods (==) ∷ TestChainPredicateFailure era → TestChainPredicateFailure era → Bool # (/=) ∷ TestChainPredicateFailure era → TestChainPredicateFailure era → Bool # | |||||
| (Era era, NoThunks (PredicateFailure (EraRule "BBODY" era)), NoThunks (PredicateFailure (EraRule "TICK" era)), NoThunks (PredicateFailure (EraRule "TICKN" era))) ⇒ NoThunks (TestChainPredicateFailure era) Source # | |||||
Defined in Test.Cardano.Ledger.Shelley.Rules.Chain | |||||
| type Rep (TestChainPredicateFailure era) Source # | |||||
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.7.0.1-inplace" 'False) ((C1 ('MetaCons "RealChainPredicateFailure" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChainPredicateFailure)) :+: C1 ('MetaCons "BbodyFailure" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PredicateFailure (EraRule "BBODY" era))))) :+: (C1 ('MetaCons "TicknFailure" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PredicateFailure (EraRule "TICKN" era)))) :+: (C1 ('MetaCons "PrtclFailure" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PredicateFailure (PRTCL MockCrypto)))) :+: C1 ('MetaCons "PrtclSeqFailure" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PrtlSeqFailure))))) | |||||
data ChainEvent era Source #
Constructors
| BbodyEvent !(Event (EraRule "BBODY" era)) | |
| TickEvent !(Event (EraRule "TICK" era)) | |
| TicknEvent !(Event (EraRule "TICKN" era)) | |
| PrtclEvent !(Event (PRTCL MockCrypto)) |
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
| type PredicateFailure TICKN | |
Defined in Cardano.Protocol.TPraos.Rules.Tickn | |
| type PredicateFailure (AllegraUTXO era) | |
Defined in Cardano.Ledger.Allegra.Rules.Utxo | |
| type PredicateFailure (AllegraUTXOW era) | |
Defined in Cardano.Ledger.Allegra.Rules.Utxow | |
| type PredicateFailure (AlonzoBBODY era) | |
Defined in Cardano.Ledger.Alonzo.Rules.Bbody | |
| type PredicateFailure (AlonzoLEDGER era) | |
Defined in Cardano.Ledger.Alonzo.Rules.Ledger | |
| type PredicateFailure (AlonzoUTXO era) | |
Defined in Cardano.Ledger.Alonzo.Rules.Utxo | |
| type PredicateFailure (AlonzoUTXOS era) | |
Defined in Cardano.Ledger.Alonzo.Rules.Utxos | |
| type PredicateFailure (AlonzoUTXOW era) | |
Defined in Cardano.Ledger.Alonzo.Rules.Utxow | |
| type PredicateFailure (BabbageLEDGER era) | |
Defined in Cardano.Ledger.Babbage.Rules.Ledger | |
| type PredicateFailure (BabbageUTXO era) | |
Defined in Cardano.Ledger.Babbage.Rules.Utxo | |
| type PredicateFailure (BabbageUTXOS era) | |
Defined in Cardano.Ledger.Babbage.Rules.Utxos | |
| type PredicateFailure (BabbageUTXOW era) | |
Defined in Cardano.Ledger.Babbage.Rules.Utxow | |
| type PredicateFailure (ConwayBBODY era) | |
Defined in Cardano.Ledger.Conway.Rules.Bbody | |
| type PredicateFailure (ConwayCERT era) | |
Defined in Cardano.Ledger.Conway.Rules.Cert | |
| type PredicateFailure (ConwayCERTS era) | |
Defined in Cardano.Ledger.Conway.Rules.Certs | |
| type PredicateFailure (ConwayDELEG era) | |
Defined in Cardano.Ledger.Conway.Rules.Deleg | |
| type PredicateFailure (ConwayENACT era) | |
Defined in Cardano.Ledger.Conway.Rules.Enact | |
| type PredicateFailure (ConwayEPOCH era) | |
Defined in Cardano.Ledger.Conway.Rules.Epoch | |
| type PredicateFailure (ConwayGOV era) | |
Defined in Cardano.Ledger.Conway.Rules.Gov | |
| type PredicateFailure (ConwayGOVCERT era) | |
Defined in Cardano.Ledger.Conway.Rules.GovCert | |
| type PredicateFailure (ConwayHARDFORK era) | |
Defined in Cardano.Ledger.Conway.Rules.HardFork | |
| type PredicateFailure (ConwayLEDGER era) | |
Defined in Cardano.Ledger.Conway.Rules.Ledger | |
| type PredicateFailure (ConwayMEMPOOL era) | |
Defined in Cardano.Ledger.Conway.Rules.Mempool | |
| type PredicateFailure (ConwayNEWEPOCH era) | |
Defined in Cardano.Ledger.Conway.Rules.NewEpoch | |
| type PredicateFailure (ConwayRATIFY era) | |
Defined in Cardano.Ledger.Conway.Rules.Ratify | |
| type PredicateFailure (ConwayTICKF era) | |
Defined in Cardano.Ledger.Conway.Rules.Tickf | |
| type PredicateFailure (ConwayUTXO era) | |
Defined in Cardano.Ledger.Conway.Rules.Utxo | |
| type PredicateFailure (ConwayUTXOS era) | |
Defined in Cardano.Ledger.Conway.Rules.Utxos | |
| type PredicateFailure (ConwayUTXOW era) | |
Defined in Cardano.Ledger.Conway.Rules.Utxow | |
| type PredicateFailure (DijkstraCERT era) | |
Defined in Cardano.Ledger.Dijkstra.Rules.Cert | |
| type PredicateFailure (ShelleyBBODY era) | |
Defined in Cardano.Ledger.Shelley.Rules.Bbody | |
| type PredicateFailure (ShelleyDELEG era) | |
Defined in Cardano.Ledger.Shelley.Rules.Deleg | |
| type PredicateFailure (ShelleyDELEGS era) | |
Defined in Cardano.Ledger.Shelley.Rules.Delegs | |
| type PredicateFailure (ShelleyDELPL era) | |
Defined in Cardano.Ledger.Shelley.Rules.Delpl | |
| type PredicateFailure (ShelleyEPOCH era) | |
Defined in Cardano.Ledger.Shelley.Rules.Epoch | |
| type PredicateFailure (ShelleyLEDGER era) | |
Defined in Cardano.Ledger.Shelley.Rules.Ledger | |
| type PredicateFailure (ShelleyLEDGERS era) | |
Defined in Cardano.Ledger.Shelley.Rules.Ledgers | |
| type PredicateFailure (ShelleyMIR era) | |
Defined in Cardano.Ledger.Shelley.Rules.Mir | |
| type PredicateFailure (ShelleyNEWEPOCH era) | |
Defined in Cardano.Ledger.Shelley.Rules.NewEpoch | |
| type PredicateFailure (ShelleyNEWPP era) | |
Defined in Cardano.Ledger.Shelley.Rules.Newpp | |
| type PredicateFailure (ShelleyPOOL era) | |
Defined in Cardano.Ledger.Shelley.Rules.Pool | |
| type PredicateFailure (ShelleyPOOLREAP era) | |
Defined in Cardano.Ledger.Shelley.Rules.PoolReap | |
| type PredicateFailure (ShelleyPPUP era) | |
Defined in Cardano.Ledger.Shelley.Rules.Ppup | |
| type PredicateFailure (ShelleyRUPD era) | |
Defined in Cardano.Ledger.Shelley.Rules.Rupd | |
| type PredicateFailure (ShelleySNAP era) | |
Defined in Cardano.Ledger.Shelley.Rules.Snap | |
| type PredicateFailure (ShelleyTICK era) | |
Defined in Cardano.Ledger.Shelley.Rules.Tick | |
| type PredicateFailure (ShelleyTICKF era) | |
Defined in Cardano.Ledger.Shelley.Rules.Tick | |
| type PredicateFailure (ShelleyUPEC era) | |
Defined in Cardano.Ledger.Shelley.Rules.Upec | |
| type PredicateFailure (ShelleyUTXO era) | |
Defined in Cardano.Ledger.Shelley.Rules.Utxo | |
| type PredicateFailure (ShelleyUTXOW era) | |
Defined in Cardano.Ledger.Shelley.Rules.Utxow | |
| type PredicateFailure (CERTS era) Source # | |
| type PredicateFailure (CHAIN era) Source # | |
Defined in Test.Cardano.Ledger.Shelley.Rules.Chain | |
| type PredicateFailure (OCERT c) | |
Defined in Cardano.Protocol.TPraos.Rules.OCert | |
| type PredicateFailure (OVERLAY c) | |
Defined in Cardano.Protocol.TPraos.Rules.Overlay | |
| type PredicateFailure (PRTCL c) | |
Defined in Cardano.Protocol.TPraos.Rules.Prtcl | |
| type PredicateFailure (UPDN c) | |
Defined in Cardano.Protocol.TPraos.Rules.Updn | |
| type PredicateFailure (STUB e st si f m) | |
Defined in Control.State.Transition.Extended | |
Constructors
| AdaPots | |
Fields | |
Instances
| NFData AdaPots | |||||
Defined in Cardano.Ledger.Shelley.AdaPots | |||||
| Generic AdaPots | |||||
Defined in Cardano.Ledger.Shelley.AdaPots Associated Types
| |||||
| Show AdaPots | |||||
| Eq AdaPots | |||||
| ToExpr AdaPots | |||||
| type Rep AdaPots | |||||
Defined in Cardano.Ledger.Shelley.AdaPots type Rep AdaPots = D1 ('MetaData "AdaPots" "Cardano.Ledger.Shelley.AdaPots" "cardano-ledger-shelley-1.18.0.0-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 ∷ (EraGov era, EraStake era, EraCertState era, Default (StashedAVVMAddresses era)) ⇒ WithOrigin LastAppliedBlock → EpochNo → UTxO era → Coin → Map (KeyHash 'GenesisRole) GenDelegPair → PParams era → Nonce → ChainState era Source #
Creates a valid initial chain state
totalAda ∷ (EraTxOut era, EraGov era, EraCertState era) ⇒ ChainState era → Coin Source #
Calculate the total ada in the chain state
totalAdaPots ∷ (EraTxOut era, EraGov era, EraCertState era) ⇒ ChainState era → AdaPots Source #
Calculate the total ada pots in the chain state
chainStateNesL ∷ ∀ era f. Functor f ⇒ (NewEpochState era → f (NewEpochState era)) → ChainState era → f (ChainState era) Source #