| 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
toShelleyGenesisPairs ∷ KeyValue e a ⇒ ShelleyGenesis → [a] Source #
Deprecated: In favor of toKeyValuePairs
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 # | |