Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data ShelleyGenesisStaking crypto = ShelleyGenesisStaking { }
-
data
ShelleyGenesis
era =
ShelleyGenesis
{
- sgSystemStart :: ! UTCTime
- sgNetworkMagic :: ! Word32
- sgNetworkId :: ! Network
- sgActiveSlotsCoeff :: ! PositiveUnitInterval
- sgSecurityParam :: ! Word64
- sgEpochLength :: ! EpochSize
- sgSlotsPerKESPeriod :: ! Word64
- sgMaxKESEvolutions :: ! Word64
- sgSlotLength :: ! NominalDiffTime
- sgUpdateQuorum :: ! Word64
- sgMaxLovelaceSupply :: ! Word64
- sgProtocolParams :: !( PParams era)
- sgGenDelegs :: !( Map ( KeyHash ' Genesis ( Crypto era)) ( GenDelegPair ( Crypto era)))
- sgInitialFunds :: !( Map ( Addr ( Crypto era)) Coin )
- sgStaking :: !( ShelleyGenesisStaking ( Crypto era))
- data ValidationErr
- emptyGenesisStaking :: ShelleyGenesisStaking crypto
- sgActiveSlotCoeff :: ShelleyGenesis era -> ActiveSlotCoeff
- genesisUTxO :: forall era. ( Era era, UsesTxOut era) => ShelleyGenesis era -> UTxO era
- initialFundsPseudoTxIn :: forall crypto. Crypto crypto => Addr crypto -> TxIn crypto
- validateGenesis :: forall era. Era era => ShelleyGenesis era -> Either [ ValidationErr ] ()
- describeValidationErr :: ValidationErr -> Text
- mkShelleyGlobals :: ShelleyGenesis era -> EpochInfo ( Either Text ) -> Natural -> Globals
Documentation
data ShelleyGenesisStaking crypto 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 era 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
data ValidationErr Source #
EpochNotLongEnough EpochSize Word64 Rational EpochSize | |
MaxKESEvolutionsUnsupported Word64 Word | |
QuorumTooSmall Word64 Word64 Word64 |
Instances
Eq ValidationErr Source # | |
Defined in Cardano.Ledger.Shelley.Genesis (==) :: ValidationErr -> ValidationErr -> Bool Source # (/=) :: ValidationErr -> ValidationErr -> Bool Source # |
|
Show ValidationErr Source # | |
Defined in Cardano.Ledger.Shelley.Genesis |
emptyGenesisStaking :: ShelleyGenesisStaking crypto Source #
Empty genesis staking
sgActiveSlotCoeff :: ShelleyGenesis era -> ActiveSlotCoeff Source #
genesisUTxO :: forall era. ( Era era, UsesTxOut era) => ShelleyGenesis era -> UTxO era Source #
initialFundsPseudoTxIn :: forall crypto. Crypto crypto => Addr crypto -> TxIn crypto 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 :: forall era. Era era => ShelleyGenesis era -> Either [ ValidationErr ] () Source #
Do some basic sanity checking on the Shelley genesis file.
mkShelleyGlobals :: ShelleyGenesis era -> EpochInfo ( Either Text ) -> Natural -> Globals Source #