cardano-wallet-core-2022.7.1: The Wallet Backend for a Cardano node.
Copyright © 2018-2020 IOHK
License Apache-2.0
Safe Haskell None
Language Haskell2010

Cardano.Pool.DB

Description

Database / Persistence layer for the pool production.

Synopsis

Interface

data DBLayer m Source #

A Database interface for storing pool production in DB.

To use it, you will need the NamedFieldPuns extension and wrap operations with atomically :

Example:

>>> :set -XNamedFieldPuns
>>> DBLayer{atomically,putPoolProduction} = db
>>> atomically $ putPoolProduction blockHeader pool

This gives you the power to also run multiple operations atomically.

FIXME: Allowing MonadIO to enable logging also within db transactions. Ideally, we should lower than constraint to only allow logging effects and not any dragons in IO.

Constructors

forall stm.( MonadFail stm, MonadIO stm) => DBLayer

Fields

Utilities

determinePoolLifeCycleStatus :: ( Ord publicationTime, Show publicationTime) => Maybe (publicationTime, PoolRegistrationCertificate ) -> Maybe (publicationTime, PoolRetirementCertificate ) -> PoolLifeCycleStatus Source #

Given the latest registration and retirement certificates for a pool, determine the pool's current life cycle status, based on the relative order in which the certificates were published.

If two certificates are supplied, then:

  • the certificates must be from the same pool.
  • the publication times must be non-equal.

Violating either of the above pre-conditions is a programming error.

This function determines order of precedence according to the "pool inference rule", as described in "A Formal Specification of the Cardano Ledger":

https://hydra.iohk.io/build/3202141/download/1/ledger-spec.pdf

Errors