ouroboros-consensus
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.MiniProtocol.ObjectDiffusion.ObjectPool.PerasVote

Description

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

Synopsis

Documentation

makePerasVotePoolWriterFromChainDB ∷ ∀ (m ∷ Type → Type) blk. (IOLike m, BlockSupportsPeras blk) ⇒ SystemTime m → ChainDB m blk → ObjectPoolWriter PerasVoteId (PerasVote blk) m Source #

Create a pool writer from the ChainDB. This properly handles the produced certs by letting the ChainDB take care of them (see addPerasVoteWithAsyncCertHandling).

For testing purposes

makeTestPerasVotePoolWriterFromVoteDB ∷ ∀ (m ∷ Type → Type) blk. (IOLike m, BlockSupportsPeras blk) ⇒ SystemTime m → PerasVoteDB m blk → PerasEpochContextResolverHandle m blk → ObjectPoolWriter PerasVoteId (PerasVote blk) m Source #

Create a pool writer directly from a PerasVoteDB. In particular, the result of addVote is ignored, so any produced cert will have to be handled manually by another mean. This function is mostly meant for tests against the PerasVoteDB in isolation; for actual production use, see makePerasVotePoolWriterFromChainDB which creates a pool writer from the ChainDB and thus properly handles the produced certs.