ouroboros-consensus
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.MiniProtocol.ObjectDiffusion.ObjectPool.PerasCert

Description

Instantiate ObjectPoolReader and ObjectPoolWriter using Peras certificates from the PerasCertDB (or the ChainDB which is wrapping the PerasCertDB).

Synopsis

Documentation

makePerasCertPoolWriterFromChainDB ∷ ∀ (m ∷ Type → Type) blk. (IOLike m, BlockSupportsPeras blk) ⇒ SystemTime m → ChainDB m blk → ObjectPoolWriter PerasRoundNo (PerasCert blk) m Source #

Create a pool writer from the ChainDB. This properly handles any needed chain selection side-effects.

For testing purposes

makeTestPerasCertPoolWriterFromCertDB ∷ ∀ (m ∷ Type → Type) blk. (IOLike m, BlockSupportsPeras blk) ⇒ SystemTime m → PerasCertDB m blk → PerasEpochContextResolverHandle m blk → ObjectPoolWriter PerasRoundNo (PerasCert blk) m Source #

Create a pool writer directly from a PerasCertDB. This is mostly meant for tests against the PerasCertDB in isolation; for actual production use, see makePerasCertPoolWriterFromChainDB which creates a pool writer from the ChainDB with proper handling of chain selection side-effects.