Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data CHAIN era
- data ChainState era = ChainState {}
- data TestChainPredicateFailure era
- = RealChainPredicateFailure !ChainPredicateFailure
- | BbodyFailure !(PredicateFailure (EraRule "BBODY" era))
- | TickFailure !(PredicateFailure (EraRule "TICK" 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 ∷ ∀ era. (EraTxOut era, EraGov era, Default (StashedAVVMAddresses era)) ⇒ WithOrigin LastAppliedBlock → EpochNo → UTxO era → Coin → Map (KeyHash 'Genesis) GenDelegPair → PParams era → Nonce → ChainState era
- totalAda ∷ (EraTxOut era, EraGov era) ⇒ ChainState era → Coin
- totalAdaPots ∷ (EraTxOut era, EraGov era) ⇒ ChainState era → AdaPots
- chainStateNesL ∷ Lens' (ChainState era) (NewEpochState era)
Documentation
Instances
data ChainState era Source #
Instances
Generic (ChainState era) Source # | |
Defined in Test.Cardano.Ledger.Shelley.Rules.Chain type Rep (ChainState era) ∷ Type → Type # 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 showsPrec ∷ Int → ChainState era → ShowS # show ∷ ChainState era → String # showList ∷ [ChainState era] → ShowS # | |
NFData (NewEpochState era) ⇒ NFData (ChainState era) Source # | |
Defined in Test.Cardano.Ledger.Shelley.Rules.Chain rnf ∷ ChainState era → () # | |
Eq (NewEpochState era) ⇒ Eq (ChainState era) Source # | |
Defined in Test.Cardano.Ledger.Shelley.Rules.Chain (==) ∷ ChainState era → ChainState era → Bool # (/=) ∷ ChainState era → ChainState era → Bool # | |
(ToExpr (PParams era), ToExpr (TxOut era), ToExpr (StashedAVVMAddresses era), ToExpr (GovState era)) ⇒ ToExpr (ChainState era) Source # | |
Defined in Test.Cardano.Ledger.Shelley.Rules.Chain toExpr ∷ ChainState era → Expr Source # listToExpr ∷ [ChainState era] → Expr Source # | |
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.6.0.0-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 #
RealChainPredicateFailure !ChainPredicateFailure | |
BbodyFailure !(PredicateFailure (EraRule "BBODY" era)) | |
TickFailure !(PredicateFailure (EraRule "TICK" era)) | |
TicknFailure !(PredicateFailure (EraRule "TICKN" era)) | |
PrtclFailure !(PredicateFailure (PRTCL MockCrypto)) | |
PrtclSeqFailure !PrtlSeqFailure |
Instances
data ChainEvent era Source #
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, PredicateFailure
s 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 PredicateFailure
s 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
Generic AdaPots | |
Show AdaPots | |
NFData AdaPots | |
Defined in Cardano.Ledger.Shelley.AdaPots | |
Eq AdaPots | |
type Rep AdaPots | |
Defined in Cardano.Ledger.Shelley.AdaPots type Rep AdaPots = D1 ('MetaData "AdaPots" "Cardano.Ledger.Shelley.AdaPots" "cardano-ledger-shelley-1.16.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 ∷ ∀ era. (EraTxOut era, EraGov era, Default (StashedAVVMAddresses era)) ⇒ WithOrigin LastAppliedBlock → EpochNo → UTxO era → Coin → Map (KeyHash 'Genesis) GenDelegPair → PParams era → Nonce → ChainState 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
chainStateNesL ∷ Lens' (ChainState era) (NewEpochState era) Source #
Orphan instances
ToExpr HashHeader Source # | |
toExpr ∷ HashHeader → Expr Source # listToExpr ∷ [HashHeader] → Expr Source # | |
ToExpr LastAppliedBlock Source # | |
toExpr ∷ LastAppliedBlock → Expr Source # listToExpr ∷ [LastAppliedBlock] → Expr Source # |