Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data ShelleyGenesisStaking c = ShelleyGenesisStaking {}
- data ShelleyGenesis c = ShelleyGenesis {
- sgSystemStart ∷ !UTCTime
- sgNetworkMagic ∷ !Word32
- sgNetworkId ∷ !Network
- sgActiveSlotsCoeff ∷ !PositiveUnitInterval
- sgSecurityParam ∷ !Word64
- sgEpochLength ∷ !EpochSize
- sgSlotsPerKESPeriod ∷ !Word64
- sgMaxKESEvolutions ∷ !Word64
- sgSlotLength ∷ !NominalDiffTimeMicro
- sgUpdateQuorum ∷ !Word64
- sgMaxLovelaceSupply ∷ !Word64
- sgProtocolParams ∷ !(PParams (ShelleyEra c))
- sgGenDelegs ∷ !(Map (KeyHash 'Genesis c) (GenDelegPair c))
- sgInitialFunds ∷ ListMap (Addr c) Coin
- sgStaking ∷ ShelleyGenesisStaking c
- toShelleyGenesisPairs ∷ (KeyValue e a, Crypto c) ⇒ ShelleyGenesis c → [a]
- data ValidationErr
- newtype NominalDiffTimeMicro = NominalDiffTimeMicro Micro
- emptyGenesisStaking ∷ ShelleyGenesisStaking c
- sgActiveSlotCoeff ∷ ShelleyGenesis c → ActiveSlotCoeff
- genesisUTxO ∷ ∀ era. EraTxOut era ⇒ ShelleyGenesis (EraCrypto era) → UTxO era
- initialFundsPseudoTxIn ∷ ∀ c. Crypto c ⇒ Addr c → TxIn c
- validateGenesis ∷ ∀ c. Crypto c ⇒ ShelleyGenesis c → Either [ValidationErr] ()
- describeValidationErr ∷ ValidationErr → Text
- mkShelleyGlobals ∷ ShelleyGenesis c → 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 c) (ListMap (Addr c) Coin)
- sgStakingL ∷ Lens' (ShelleyGenesis c) (ShelleyGenesisStaking c)
Documentation
data ShelleyGenesisStaking c 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.
ShelleyGenesisStaking | |
|
Instances
data ShelleyGenesis c 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.
ShelleyGenesis | |
|
Instances
toShelleyGenesisPairs ∷ (KeyValue e a, Crypto c) ⇒ ShelleyGenesis c → [a] Source #
data ValidationErr Source #
EpochNotLongEnough EpochSize Word64 Rational EpochSize | |
MaxKESEvolutionsUnsupported Word64 Word | |
QuorumTooSmall Word64 Word64 Word64 |
Instances
Show ValidationErr Source # | |
Defined in Cardano.Ledger.Shelley.Genesis | |
Eq ValidationErr Source # | |
Defined in Cardano.Ledger.Shelley.Genesis (==) ∷ ValidationErr → ValidationErr → Bool Source # (/=) ∷ ValidationErr → ValidationErr → Bool Source # |
newtype NominalDiffTimeMicro Source #
Unlike
that supports NominalDiffTime
precision, this type
only supports Pico
precision.Micro
Instances
emptyGenesisStaking ∷ ShelleyGenesisStaking c Source #
Empty genesis staking
genesisUTxO ∷ ∀ era. EraTxOut era ⇒ ShelleyGenesis (EraCrypto era) → UTxO era Source #
initialFundsPseudoTxIn ∷ ∀ c. Crypto c ⇒ Addr c → TxIn c 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 ∷ ∀ c. Crypto c ⇒ ShelleyGenesis c → Either [ValidationErr] () Source #
Do some basic sanity checking on the Shelley genesis file.
mkShelleyGlobals ∷ ShelleyGenesis c → EpochInfo (Either Text) → Globals Source #
sgInitialFundsL ∷ Lens' (ShelleyGenesis c) (ListMap (Addr c) Coin) Source #
sgStakingL ∷ Lens' (ShelleyGenesis c) (ShelleyGenesisStaking c) Source #
Orphan instances
Crypto c ⇒ EraGenesis (ShelleyEra c) Source # | |
type Genesis (ShelleyEra c) Source # |