Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Cardano.Ledger.Shelley.Genesis
Contents
Synopsis
- data ShelleyGenesisStaking = ShelleyGenesisStaking {}
- data ShelleyGenesis = ShelleyGenesis {
- sgSystemStart ∷ !UTCTime
- sgNetworkMagic ∷ !Word32
- sgNetworkId ∷ !Network
- sgActiveSlotsCoeff ∷ !PositiveUnitInterval
- sgSecurityParam ∷ !(NonZero Word64)
- sgEpochLength ∷ !EpochSize
- sgSlotsPerKESPeriod ∷ !Word64
- sgMaxKESEvolutions ∷ !Word64
- sgSlotLength ∷ !NominalDiffTimeMicro
- sgUpdateQuorum ∷ !Word64
- sgMaxLovelaceSupply ∷ !Word64
- sgProtocolParams ∷ !(PParams ShelleyEra)
- sgGenDelegs ∷ !(Map (KeyHash 'Genesis) GenDelegPair)
- sgInitialFunds ∷ ListMap Addr Coin
- sgStaking ∷ ShelleyGenesisStaking
- toShelleyGenesisPairs ∷ KeyValue e a ⇒ ShelleyGenesis → [a]
- data ValidationErr
- newtype NominalDiffTimeMicro = NominalDiffTimeMicro Micro
- emptyGenesisStaking ∷ ShelleyGenesisStaking
- sgActiveSlotCoeff ∷ ShelleyGenesis → ActiveSlotCoeff
- genesisUTxO ∷ ∀ era. EraTxOut era ⇒ ShelleyGenesis → UTxO era
- initialFundsPseudoTxIn ∷ Addr → TxIn
- validateGenesis ∷ ShelleyGenesis → Either [ValidationErr] ()
- describeValidationErr ∷ ValidationErr → Text
- mkShelleyGlobals ∷ ShelleyGenesis → EpochInfo (Either Text) → Globals
- nominalDiffTimeMicroToMicroseconds ∷ NominalDiffTimeMicro → Micro
- nominalDiffTimeMicroToSeconds ∷ NominalDiffTimeMicro → Pico
- toNominalDiffTimeMicro ∷ NominalDiffTime → Maybe NominalDiffTimeMicro
- toNominalDiffTimeMicroWithRounding ∷ NominalDiffTime → NominalDiffTimeMicro
- fromNominalDiffTimeMicro ∷ NominalDiffTimeMicro → NominalDiffTime
- secondsToNominalDiffTimeMicro ∷ Micro → NominalDiffTimeMicro
- sgInitialFundsL ∷ Lens' ShelleyGenesis (ListMap Addr Coin)
- sgStakingL ∷ Lens' ShelleyGenesis ShelleyGenesisStaking
Documentation
data ShelleyGenesisStaking Source #
Genesis Shelley staking configuration.
This allows us to configure some initial stake pools and delegation to them, in order to test Praos in a static configuration, without requiring on-chain registration and delegation.
For simplicity, pools defined in the genesis staking do not pay deposits for their registration.
Constructors
ShelleyGenesisStaking | |
Fields
|
Instances
data ShelleyGenesis Source #
Shelley genesis information
Note that this is needed only for a pure Shelley network, hence it being defined here rather than in its own module. In mainnet, Shelley will transition naturally from Byron, and thus will never have its own genesis information.
Constructors
ShelleyGenesis | |
Fields
|
Instances
FromJSON ShelleyGenesis Source # | |
Defined in Cardano.Ledger.Shelley.Genesis Methods parseJSON ∷ Value → Parser ShelleyGenesis Source # | |
ToJSON ShelleyGenesis Source # | |
Defined in Cardano.Ledger.Shelley.Genesis Methods toJSON ∷ ShelleyGenesis → Value Source # toEncoding ∷ ShelleyGenesis → Encoding Source # toJSONList ∷ [ShelleyGenesis] → Value Source # | |
Generic ShelleyGenesis Source # | |
Defined in Cardano.Ledger.Shelley.Genesis Associated Types type Rep ShelleyGenesis ∷ Type → Type # | |
Show ShelleyGenesis Source # | |
Defined in Cardano.Ledger.Shelley.Genesis Methods showsPrec ∷ Int → ShelleyGenesis → ShowS # show ∷ ShelleyGenesis → String # showList ∷ [ShelleyGenesis] → ShowS # | |
FromCBOR ShelleyGenesis Source # | |
Defined in Cardano.Ledger.Shelley.Genesis | |
ToCBOR ShelleyGenesis Source # | |
Defined in Cardano.Ledger.Shelley.Genesis Methods toCBOR ∷ ShelleyGenesis → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy ShelleyGenesis → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [ShelleyGenesis] → Size Source # | |
DecCBOR ShelleyGenesis Source # | Genesis are always encoded with the version of era they are defined in. |
Defined in Cardano.Ledger.Shelley.Genesis | |
EncCBOR ShelleyGenesis Source # | |
Defined in Cardano.Ledger.Shelley.Genesis Methods encCBOR ∷ ShelleyGenesis → Encoding Source # encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy ShelleyGenesis → Size Source # encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [ShelleyGenesis] → Size Source # | |
Eq ShelleyGenesis Source # | |
Defined in Cardano.Ledger.Shelley.Genesis Methods (==) ∷ ShelleyGenesis → ShelleyGenesis → Bool # (/=) ∷ ShelleyGenesis → ShelleyGenesis → Bool # | |
NoThunks ShelleyGenesis Source # | |
Defined in Cardano.Ledger.Shelley.Genesis | |
type Rep ShelleyGenesis Source # | |
Defined in Cardano.Ledger.Shelley.Genesis type Rep ShelleyGenesis = D1 ('MetaData "ShelleyGenesis" "Cardano.Ledger.Shelley.Genesis" "cardano-ledger-shelley-1.16.0.0-inplace" 'False) (C1 ('MetaCons "ShelleyGenesis" 'PrefixI 'True) (((S1 ('MetaSel ('Just "sgSystemStart") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 UTCTime) :*: (S1 ('MetaSel ('Just "sgNetworkMagic") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "sgNetworkId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Network))) :*: ((S1 ('MetaSel ('Just "sgActiveSlotsCoeff") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PositiveUnitInterval) :*: S1 ('MetaSel ('Just "sgSecurityParam") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NonZero Word64))) :*: (S1 ('MetaSel ('Just "sgEpochLength") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochSize) :*: S1 ('MetaSel ('Just "sgSlotsPerKESPeriod") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64)))) :*: (((S1 ('MetaSel ('Just "sgMaxKESEvolutions") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: S1 ('MetaSel ('Just "sgSlotLength") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NominalDiffTimeMicro)) :*: (S1 ('MetaSel ('Just "sgUpdateQuorum") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: S1 ('MetaSel ('Just "sgMaxLovelaceSupply") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64))) :*: ((S1 ('MetaSel ('Just "sgProtocolParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PParams ShelleyEra)) :*: S1 ('MetaSel ('Just "sgGenDelegs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'Genesis) GenDelegPair))) :*: (S1 ('MetaSel ('Just "sgInitialFunds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ListMap Addr Coin)) :*: S1 ('MetaSel ('Just "sgStaking") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShelleyGenesisStaking)))))) |
toShelleyGenesisPairs ∷ KeyValue e a ⇒ ShelleyGenesis → [a] Source #
data ValidationErr Source #
Constructors
EpochNotLongEnough EpochSize Word64 Rational EpochSize | |
MaxKESEvolutionsUnsupported Word64 Word | |
QuorumTooSmall Word64 Word64 Word64 |
Instances
Show ValidationErr Source # | |
Defined in Cardano.Ledger.Shelley.Genesis Methods showsPrec ∷ Int → ValidationErr → ShowS # show ∷ ValidationErr → String # showList ∷ [ValidationErr] → ShowS # | |
Eq ValidationErr Source # | |
Defined in Cardano.Ledger.Shelley.Genesis |
newtype NominalDiffTimeMicro Source #
Unlike
that supports NominalDiffTime
precision, this type
only supports Pico
precision.Micro
Constructors
NominalDiffTimeMicro Micro |
Instances
emptyGenesisStaking ∷ ShelleyGenesisStaking Source #
Empty genesis staking
genesisUTxO ∷ ∀ era. EraTxOut era ⇒ ShelleyGenesis → UTxO era Source #
initialFundsPseudoTxIn ∷ Addr → TxIn Source #
Compute the TxIn
of the initial UTxO pseudo-transaction corresponding
to the given address in the genesis initial funds.
The Shelley initial UTxO is constructed from the sgInitialFunds
which
is not a full UTxO but just a map from addresses to coin values.
This gets turned into a UTxO by making a pseudo-transaction for each address,
with the 0th output being the coin value. So to spend from the initial UTxO
we need this same TxIn
to use as an input to the spending transaction.
validateGenesis ∷ ShelleyGenesis → Either [ValidationErr] () Source #
Do some basic sanity checking on the Shelley genesis file.
Orphan instances
EraGenesis ShelleyEra Source # | |
Associated Types type Genesis ShelleyEra Source # |