| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
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
- makePerasVotePoolReaderFromVoteDB ∷ ∀ (m ∷ Type → Type) blk. IOLike m ⇒ PerasVoteDB m blk → ObjectPoolReader (PerasVoteId blk) (PerasVote blk) PerasVoteTicketNo m
- makePerasVotePoolWriterFromVoteDB ∷ ∀ blk (m ∷ Type → Type). (StandardHash blk, IOLike m) ⇒ SystemTime m → STM m PerasVoteStakeDistr → PerasVoteDB m blk → ObjectPoolWriter (PerasVoteId blk) (PerasVote blk) m
- makePerasVotePoolReaderFromChainDB ∷ ∀ (m ∷ Type → Type) blk. IOLike m ⇒ ChainDB m blk → ObjectPoolReader (PerasVoteId blk) (PerasVote blk) PerasVoteTicketNo m
- makePerasVotePoolWriterFromChainDB ∷ ∀ blk (m ∷ Type → Type). (StandardHash blk, IOLike m) ⇒ SystemTime m → STM m PerasVoteStakeDistr → ChainDB m blk → ObjectPoolWriter (PerasVoteId blk) (PerasVote blk) m
Documentation
makePerasVotePoolReaderFromVoteDB ∷ ∀ (m ∷ Type → Type) blk. IOLike m ⇒ PerasVoteDB m blk → ObjectPoolReader (PerasVoteId blk) (PerasVote blk) PerasVoteTicketNo m Source #
makePerasVotePoolWriterFromVoteDB Source #
Arguments
| ∷ ∀ blk (m ∷ Type → Type). (StandardHash blk, IOLike m) | |
| ⇒ SystemTime m | |
| → STM m PerasVoteStakeDistr | This is needed for validating votes (since it is during the validation of votes that we give them a verified weight. In the future, we won't read it from the stake distr directly, but rather use the committee selection data) |
| → PerasVoteDB m blk | |
| → ObjectPoolWriter (PerasVoteId blk) (PerasVote blk) m |
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.
makePerasVotePoolReaderFromChainDB ∷ ∀ (m ∷ Type → Type) blk. IOLike m ⇒ ChainDB m blk → ObjectPoolReader (PerasVoteId blk) (PerasVote blk) PerasVoteTicketNo m Source #
makePerasVotePoolWriterFromChainDB Source #
Arguments
| ∷ ∀ blk (m ∷ Type → Type). (StandardHash blk, IOLike m) | |
| ⇒ SystemTime m | |
| → STM m PerasVoteStakeDistr | This is needed for validating votes (since its during the validation of votes that we give them a verified weight. In the future, we won't read it from the stake distr directly, but rather use the committee selection data) |
| → ChainDB m blk | |
| → ObjectPoolWriter (PerasVoteId blk) (PerasVote blk) m |
Create a pool writer from the ChainDB.
This properly handles the produced certs by letting the ChainDB take care
of them (see addPerasVoteWithAsyncCertHandling).